Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-30 Thread Aleksandar Markovic
On Saturday, November 30, 2019, Michael Rolnik wrote: > Aleksandar. > > if download AVR specs you can see that some cores implement some > instructions and some don't. > We could go other way, just implement all of them regardless of what is > supported and what is not and hope that executed elf

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-30 Thread Michael Rolnik
Aleksandar. if download AVR specs you can see that some cores implement some instructions and some don't. We could go other way, just implement all of them regardless of what is supported and what is not and hope that executed elf contains only supported ones. Regards, Michael Rolnik On Sat, N

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-30 Thread Aleksandar Markovic
On Saturday, November 23, 2019, Michael Rolnik wrote: > On Fri, Nov 22, 2019 at 7:12 PM Aleksandar Markovic > wrote: > > > > > + > > > +static void avr_avr1_initfn(Object *obj) > > > +{ > > > +AVRCPU *cpu = AVR_CPU(obj); > > > +CPUAVRState *env = &cpu->env; > > > + > > > +avr_set_fea

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-23 Thread Michael Rolnik
On Fri, Nov 22, 2019 at 7:12 PM Aleksandar Markovic wrote: > > > + > > +static void avr_avr1_initfn(Object *obj) > > +{ > > +AVRCPU *cpu = AVR_CPU(obj); > > +CPUAVRState *env = &cpu->env; > > + > > +avr_set_feature(env, AVR_FEATURE_LPM); > > +avr_set_feature(env, AVR_FEATURE_2_BYTE

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-23 Thread Michael Rolnik
I believe I got this number from this spec https://ww1.microchip.com/downloads/en/devicedoc/atmel-2549-8-bit-avr-microcontroller-atmega640-1280-1281-2560-2561_datasheet.pdf on page 101 On Fri, Nov 22, 2019 at 7:28 PM Aleksandar Markovic wrote: > > > +#ifndef CONFIG_USER_ONLY > > +/* Set the n

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-22 Thread Aleksandar Markovic
> +/* Number of CPU registers */ > +#define NO_CPU_REGISTERS 32 > +/* Number of IO registers accessible by ld/st/in/out */ > +#define NO_IO_REGISTERS 64 Hi again, Michael. :) May I ask you to do a global replace of names of these two constants to CPU_REGISTERS_COUNT / IO_REGISTERS_COUNT or NUMBER

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-22 Thread Aleksandar Markovic
> +#ifndef CONFIG_USER_ONLY > +/* Set the number of interrupts supported by the CPU. */ > +qdev_init_gpio_in(DEVICE(cpu), avr_cpu_set_int, 57); > +#endif Can you please, Michael, explain to me the origin of number "57" here? Thanks, Aleksandar

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-22 Thread Aleksandar Markovic
> + > +static void avr_avr1_initfn(Object *obj) > +{ > +AVRCPU *cpu = AVR_CPU(obj); > +CPUAVRState *env = &cpu->env; > + > +avr_set_feature(env, AVR_FEATURE_LPM); > +avr_set_feature(env, AVR_FEATURE_2_BYTE_SP); > +avr_set_feature(env, AVR_FEATURE_2_BYTE_PC); > +} > + > +static v

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-22 Thread Philippe Mathieu-Daudé
On 11/22/19 11:54 AM, Michael Rolnik wrote: Hi all. Once implemented, how to invoke this function? I'm testing your series with: qemu-system-avr -kernel ~/Downloads/ATmegaBOOT.elf -d in_asm,unimp The '-d in_asm' enable dumping the assembler instructions translated. Sent from my cell phone,

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-22 Thread Aleksandar Markovic
On Friday, November 22, 2019, Philippe Mathieu-Daudé wrote: > On 11/21/19 9:55 PM, Aleksandar Markovic wrote: > >> Why not implement the dump_ASM code? This is very useful... >>> >>> >> ... and time-consuming to implement, unless Michael have some >> ready off-shelf code. >> >> It is great that y

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-22 Thread Michael Rolnik
Hi all. Once implemented, how to invoke this function? Sent from my cell phone, please ignore typos On Fri, Nov 22, 2019, 12:46 PM Philippe Mathieu-Daudé wrote: > Hi Michael, > > On 11/22/19 9:43 AM, Aleksandar Markovic wrote: > > On Friday, November 22, 2019, Richard Henderson > > mailto:rich

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-22 Thread Philippe Mathieu-Daudé
Hi Michael, On 11/22/19 9:43 AM, Aleksandar Markovic wrote: On Friday, November 22, 2019, Richard Henderson mailto:richard.hender...@linaro.org>> wrote: On 11/21/19 8:53 PM, Michael Rolnik wrote: > It seems to be a huge investment. this function should parse the > binary data as

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-22 Thread Philippe Mathieu-Daudé
On 11/21/19 9:55 PM, Aleksandar Markovic wrote: Why not implement the dump_ASM code? This is very useful... ... and time-consuming to implement, unless Michael have some ready off-shelf code. It is great that you have lots of ideas, Philippe, however I think that it is counterproductive to su

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-22 Thread Aleksandar Markovic
On Friday, November 22, 2019, Richard Henderson < richard.hender...@linaro.org> wrote: > On 11/21/19 8:53 PM, Michael Rolnik wrote: > > It seems to be a huge investment. this function should parse the > > binary data as `decode_insn` does, so I suggest to modify decodetree > > tool to make decodin

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-21 Thread Richard Henderson
On 11/22/19 6:33 AM, Pavel Dovgalyuk wrote: >> From: Aleksandar Markovic [mailto:aleksandar.m.m...@gmail.com] >>> Why not implement the dump_ASM code? This is very useful... >>> >> >> ... and time-consuming to implement, unless Michael have some >> ready off-shelf code. > > We already did this by

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-21 Thread Richard Henderson
On 11/21/19 8:53 PM, Michael Rolnik wrote: > It seems to be a huge investment. this function should parse the > binary data as `decode_insn` does, so I suggest to modify decodetree > tool to make decoding information available to the instruction print > function. > what do you think? See target/op

RE: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-21 Thread Pavel Dovgalyuk
> From: Aleksandar Markovic [mailto:aleksandar.m.m...@gmail.com] > > Why not implement the dump_ASM code? This is very useful... > > > > ... and time-consuming to implement, unless Michael have some > ready off-shelf code. We already did this by taking the disassembly code from binutils: https://

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-21 Thread Aleksandar Markovic
> Why not implement the dump_ASM code? This is very useful... > ... and time-consuming to implement, unless Michael have some ready off-shelf code. It is great that you have lots of ideas, Philippe, however I think that it is counterproductive to suggest Michael to work on this at this moment. Di

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-21 Thread Michael Rolnik
It seems to be a huge investment. this function should parse the binary data as `decode_insn` does, so I suggest to modify decodetree tool to make decoding information available to the instruction print function. what do you think? On Thu, Nov 21, 2019 at 9:44 PM Michael Rolnik wrote: > > On Thu,

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-21 Thread Michael Rolnik
On Thu, Nov 21, 2019 at 8:55 PM Philippe Mathieu-Daudé wrote: > > Hi Michael, > > On 10/29/19 10:24 PM, Michael Rolnik wrote: > > This includes: > > - CPU data structures > > - object model classes and functions > > - migration functions > > - GDB hooks > > > > Co-developed-by: Michael Rolnik > >

Re: [PATCH v35 01/13] target/avr: Add outward facing interfaces and core CPU logic

2019-11-21 Thread Philippe Mathieu-Daudé
Hi Michael, On 10/29/19 10:24 PM, Michael Rolnik wrote: This includes: - CPU data structures - object model classes and functions - migration functions - GDB hooks Co-developed-by: Michael Rolnik Co-developed-by: Sarah Harris Signed-off-by: Michael Rolnik Signed-off-by: Sarah Harris Signed-