From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Aleksandar Markovic" <aleksandar.m.mail@gmail.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Richard Henderson" <richard.henderson@linaro.org>
Cc: "Sarah Harris" <S.E.Harris@kent.ac.uk>,
"Michael Rolnik" <mrolnik@gmail.com>,
"Thomas Huth" <huth@tuxfamily.org>,
"Joaquin de Andres" <me@xcancerberox.com.ar>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Pavel Dovgalyuk" <dovgaluk@ispras.ru>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>
Subject: Re: [RFC PATCH 06/10] hw/avr: Add ATmega microcontrollers
Date: Thu, 28 Nov 2019 12:36:20 +0100 [thread overview]
Message-ID: <d9590609-9bcb-41da-cb2d-a7e373ca3909@redhat.com> (raw)
In-Reply-To: <CAL1e-=i=1zhx3q4xzh7oPzXLWAHwtEkUVTSHKqv5yy9BBRrVKw@mail.gmail.com>
Hi Aleksandar, Richard.
On 11/28/19 10:28 AM, Aleksandar Markovic wrote:
> On Thursday, November 28, 2019, Philippe Mathieu-Daudé <f4bug@amsat.org
> <mailto:f4bug@amsat.org>> wrote:
>
> Add famous ATmega MCUs:
>
> - middle range: ATmega168 and ATmega328
> - high range: ATmega1280 and ATmega2560
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org
> <mailto:f4bug@amsat.org>>
> ---
>
>
> Philippe, hi.
>
> Thank you for the impetus you give us all.
>
> However, is this the right direction?
I am not the maintainer who will merge the AVR port, so I'm not an
authoritative figure. I simply wanted to help Michael and Joaquin, so
spent 6h of my personal time here.
> Let's analyse some bits and pieces.
>
> Starting from the commit message, the word "famous" is used, but I
> really don't see enumerated CPUs/MCUs are any special in Atmel lineup.
> Other than we often used the doc describing them (cited several times in
> our discussions) as our reference, but that doesn't make them "famous".
> Ofcourse, there other docs for other Atmel CPUs/MCUs, of at lest
> equivalent significance. For example, "tiny" ones are at least as famous
> as "mega" ones.
As noted in the cover, this is sent as RFC and I was quite tired when
posting so the documentation is rather scarce, but the patches were
targeted at Michael/Joaquin as example how they could properly add AVR
machines.
> Then, you introduce the term MCU, without proper discussion with others
> on terminology. In parlance of QEMU, ATmega168 at al. are CPUs (we all
> know and assume that that are some peripherals in it). I am not against
> using the term MCU, but let's first sync up on that.
>
> The added terminology trouble is that MCUs, as you defined them, have in
> array atmega_mcu[] a field called "cpu_type" - why is that field not
> called "mcu_type"? *Very* confusing for any future reader. And then,
> similar terminology conundrum continues with macro AVR_CPU_TYPE_NAME().
>
> All of the above is far less important than this question: What are we
> achieving with proposed CPU/MCU definitions? I certainly see the value
> of fitting the complex variety of AVR CPUs/MCUs into QEMU object model.
> No question about that. However, is this the right moment to do it?
> There are still some unresolved architectural problems with peripheral
> definitions, as I noted in yhe comment to Michael's last cover letter.
> This patch does not solve them. It just assumes everything is ready with
> peripherals, let's build CPUs/MCUs. The machines based on proposed
> CPUs/MCUs are not more real that machine based on Michael's "sample"
> machine. At least Michal says "this is not a real machine". If we used
> proposed CPUs/MCUs from this patch, the resulting machine is as "paper"
> machine as yhe "sample" machine. We would just live in a la-la lend of
> thinking: "wow, we model real hardware now".
>
> I would rather accept into QEMU a series admitting we are still far from
> modelling real machine or CPU/MCU, than a series that gives an illusion
> that we are modelling real machine or CPU/MCU.
These patches try to do the same as the 'sample' machine modeled by
Michael, but reordered in a different way.
The only documentation was "The CPU is an approximation of an
ATmega2560" so I assumed he could be using the Arduino MEGA2560 board
which matches. I used the same peripherals that Michael used, simply
presented a more QEMU-up-to-date way.
> As far as utility of this patch for Michael's series, it looks to me
> they add more headake than help (not saying that the help is not
> present) to Michael. He would have anotter abstraction layer to think
> of, at the moment he desperately needs (in my opinion) to focus on
> providing the as solid as possible, and as complete as possinle
> foundations. This patch looks like building castles in the air. Again, I
> am not claiming that the patch is not helpful at all.
>
> In summary, I think that this patch is premature.
If we merge the 'sample' board, the deprecation process will take at
least 8 months, hoping no-one start to hack it.
So to save time, we can merge the architectural part (target/avr) of
Michael work, without the hardware part (hw/avr).
Michael/Sarah can still test their 'instruction-tests' [*] suite using
the 'none' machine.
See this example which creates a testing machine with a AVR3 core and
1MB of RAM mapped at 0x0000:
$ avr-softmmu/qemu-system-avr -M none -cpu avr3-avr-cpu -m 1 -S -monitor
stdio
QEMU 4.1.93 monitor - type 'help' for more information
(qemu) info mtree
address-space: cpu-memory-0
0000000000000000-ffffffffffffffff (prio 0, i/o): system
0000000000000000-00000000000fffff (prio 0, ram): ram
(qemu) info qom-tree
/machine (none-machine)
/unattached (container)
/ram[0] (qemu:memory-region)
/sysbus (System)
/system[0] (qemu:memory-region)
/io[0] (qemu:memory-region)
/device[0] (avr3-avr-cpu)
[...]
They won't be able to run the FreeRTOS test suite [*] until we find a
consensus with the AVR hardware/boards.
This seems the clever outcome, so the AVR architectural part get merged
as soon as 5.0 opens, and we have time to improve the hardware part.
And Michael won't have to repost his series until v42 :)
Richard, you seem to be the de-facto maintainer, is that correct?
If you agree with my suggestion, I can prepare a v38 based on Michael's
last series, sanitized and without the HW part, so it you can queue it
for avr-next.
[*] https://github.com/seharris/qemu-avr-tests
next prev parent reply other threads:[~2019-11-28 12:04 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-28 1:50 [RFC PATCH 00/10] hw/avr: Introduce the Arduino board Philippe Mathieu-Daudé
2019-11-28 1:50 ` [NOTFORMERGE PATCH 01/10] hw/avr: Kludge to fix build failure Philippe Mathieu-Daudé
2019-11-28 1:50 ` [PATCH 02/10] target/avr: Remove unused include Philippe Mathieu-Daudé
2019-11-28 1:50 ` [PATCH 03/10] target/avr: Add missing definitions Philippe Mathieu-Daudé
2019-11-28 1:50 ` [NOTFORMERGE PATCH 04/10] target/avr: Fix IRQ count Philippe Mathieu-Daudé
2019-11-28 1:50 ` [RFC PATCH 05/10] hw/char/avr: Reduce USART I/O size Philippe Mathieu-Daudé
2019-11-28 1:50 ` [RFC PATCH 06/10] hw/avr: Add ATmega microcontrollers Philippe Mathieu-Daudé
2019-11-28 1:55 ` Philippe Mathieu-Daudé
2019-11-28 9:28 ` Aleksandar Markovic
2019-11-28 9:48 ` dovgaluk
2019-11-28 10:20 ` Aleksandar Markovic
2019-11-28 11:08 ` dovgaluk
2019-11-28 11:25 ` Aleksandar Markovic
2019-11-28 11:12 ` Philippe Mathieu-Daudé
2019-11-28 11:36 ` Philippe Mathieu-Daudé [this message]
2019-12-20 10:09 ` Igor Mammedov
2019-12-20 12:58 ` Philippe Mathieu-Daudé
2019-12-20 15:03 ` Igor Mammedov
2019-11-28 1:50 ` [RFC PATCH 07/10] hw/avr: Add few Arduino boards Philippe Mathieu-Daudé
2019-12-20 10:01 ` Igor Mammedov
2019-11-28 1:50 ` [PATCH 08/10] tests/acceptance: Keep multilines comment consistent with other tests Philippe Mathieu-Daudé
2019-11-28 1:50 ` [RFC PATCH 09/10] tests/acceptance: Use the ATmega2560 board Philippe Mathieu-Daudé
2019-11-28 1:50 ` [NOTFORMERGE PATCH 10/10] hw/avr: Remove the 'sample' board Philippe Mathieu-Daudé
2019-11-28 10:30 ` [RFC PATCH 00/10] hw/avr: Introduce the Arduino board Michael Rolnik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d9590609-9bcb-41da-cb2d-a7e373ca3909@redhat.com \
--to=philmd@redhat.com \
--cc=S.E.Harris@kent.ac.uk \
--cc=aleksandar.m.mail@gmail.com \
--cc=dovgaluk@ispras.ru \
--cc=f4bug@amsat.org \
--cc=huth@tuxfamily.org \
--cc=imammedo@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=me@xcancerberox.com.ar \
--cc=mrolnik@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).