qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v4 0/9] 8bit AVR cores
@ 2016-06-06 10:37 Michael Rolnik
  2016-06-06 10:37 ` [Qemu-devel] [PATCH v4 1/9] target-avr: AVR cores support is added. 1. basic CPU structure 2. registers 3. no instructions Michael Rolnik
                   ` (9 more replies)
  0 siblings, 10 replies; 36+ messages in thread
From: Michael Rolnik @ 2016-06-06 10:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: rth, Michael Rolnik

This series of patches adds 8bit AVR cores to QEMU.
All instruction, except BREAK/DES/SPM/SPMX, are implemented. Not fully tested yet.
However I was able to execute simple code with functions. e.g fibonacci calculation.
This series of patches include a non real, sample board.
No fuses support yet. PC is set to 0 at reset.

the patches include the following
1. just a basic 8bit AVR CPU, without instruction decoding or translation
2. CPU features which allow define the following 8bit AVR cores
     avr1
     avr2 avr25
     avr3 avr31 avr35
     avr4
     avr5 avr51
     avr6
     xmega2 xmega4 xmega5 xmega6 xmega7
3. a definition of sample machine with SRAM, FLASH and CPU which allows to execute simple code
4. encoding for all AVR instructions
5. interrupt handling
6. helpers for IN, OUT, SLEEP, WBR & unsupported instructions
7. a decoder which given an opcode decides what istruction it is
8. translation of AVR instruction into TCG
9. all features together 

changes since v3
1. rampD/X/Y/Z registers are encoded as 0x00ff0000 and not 0x000000ff for faster address manipulaton
2. ffs changed to ctz32
3. duplicate code removed at avr_cpu_do_interrupt  
4. using andc instead of not + and
5. fixing V flag calculation in varios instructions
6. freeing local variables in PUSH
7. tcg_const_local_i32 -> tcg_const_i32
8. using sextract32 instead of my implementation
9. fixing BLD instruction
10.xor(r) instead of 0xff - r at COM
11.fixing MULS/MULSU not to modify inputs' content
12.using SUB for NEG
13.fixing tcg_gen_qemu_ld/st call in XCH

A big thanks to Richard Henderson for the review.

Michael Rolnik (9):
  target-avr:     AVR cores support is added.         1. basic CPU
    structure         2. registers         3. no instructions
  target-avr: adding AVR CPU features/flavors
  target-avr: adding a sample AVR board
  target-avr: adding instructions encodings
  target-avr: adding AVR interrupt handling
  target-avr: adding helpers for IN, OUT, SLEEP, WBR & unsupported
    instructions
  target-avr: adding instruction decoder
  target-avr: adding instruction translation
  target-avr: updating translate.c to use instructions translation

 arch_init.c                     |    2 +
 configure                       |    5 +
 default-configs/avr-softmmu.mak |    1 +
 disas/Makefile.objs             |    1 +
 disas/avr.c                     |   10 +
 hw/Makefile.objs                |    1 +
 hw/avr/Makefile.objs            |    1 +
 hw/avr/sample-io.c              |  217 ++++
 hw/avr/sample.c                 |  118 ++
 include/disas/bfd.h             |    7 +
 include/sysemu/arch_init.h      |    1 +
 target-avr/Makefile.objs        |    5 +
 target-avr/cpu-qom.h            |   80 ++
 target-avr/cpu.c                |  595 ++++++++++
 target-avr/cpu.h                |  193 +++
 target-avr/decode.c             |  724 ++++++++++++
 target-avr/gdbstub.c            |   99 ++
 target-avr/helper.c             |  273 +++++
 target-avr/helper.h             |   26 +
 target-avr/machine.c            |   54 +
 target-avr/machine.h            |   21 +
 target-avr/translate-inst.c     | 2499 +++++++++++++++++++++++++++++++++++++++
 target-avr/translate-inst.h     |  730 ++++++++++++
 target-avr/translate.c          |  268 +++++
 target-avr/translate.h          |  120 ++
 25 files changed, 6051 insertions(+)
 create mode 100644 default-configs/avr-softmmu.mak
 create mode 100644 disas/avr.c
 create mode 100644 hw/avr/Makefile.objs
 create mode 100644 hw/avr/sample-io.c
 create mode 100644 hw/avr/sample.c
 create mode 100644 target-avr/Makefile.objs
 create mode 100644 target-avr/cpu-qom.h
 create mode 100644 target-avr/cpu.c
 create mode 100644 target-avr/cpu.h
 create mode 100644 target-avr/decode.c
 create mode 100644 target-avr/gdbstub.c
 create mode 100644 target-avr/helper.c
 create mode 100644 target-avr/helper.h
 create mode 100644 target-avr/machine.c
 create mode 100644 target-avr/machine.h
 create mode 100644 target-avr/translate-inst.c
 create mode 100644 target-avr/translate-inst.h
 create mode 100644 target-avr/translate.c
 create mode 100644 target-avr/translate.h

-- 
2.4.9 (Apple Git-60)

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2016-07-05 22:31 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-06 10:37 [Qemu-devel] [PATCH v4 0/9] 8bit AVR cores Michael Rolnik
2016-06-06 10:37 ` [Qemu-devel] [PATCH v4 1/9] target-avr: AVR cores support is added. 1. basic CPU structure 2. registers 3. no instructions Michael Rolnik
2016-06-06 20:15   ` Richard Henderson
2016-06-07  6:32     ` Michael Rolnik
2016-06-07 14:28       ` Richard Henderson
2016-06-08 19:49         ` Michael Rolnik
2016-06-09  4:43           ` Richard Henderson
2016-06-06 22:27   ` Peter Maydell
2016-06-06 10:37 ` [Qemu-devel] [PATCH v4 2/9] target-avr: adding AVR CPU features/flavors Michael Rolnik
2016-06-06 20:25   ` Richard Henderson
2016-06-08 20:53     ` Michael Rolnik
2016-06-09  4:48       ` Richard Henderson
2016-06-06 10:37 ` [Qemu-devel] [PATCH v4 3/9] target-avr: adding a sample AVR board Michael Rolnik
2016-06-06 20:49   ` Richard Henderson
2016-06-06 21:55   ` Peter Maydell
2016-07-05 22:22     ` Michael Rolnik
2016-07-05 22:31       ` Peter Maydell
2016-06-06 10:37 ` [Qemu-devel] [PATCH v4 4/9] target-avr: adding instructions encodings Michael Rolnik
2016-06-06 21:38   ` Richard Henderson
2016-06-06 22:06     ` Peter Maydell
2016-06-08 21:15       ` Michael Rolnik
2016-06-09  4:53         ` Richard Henderson
2016-06-06 10:37 ` [Qemu-devel] [PATCH v4 5/9] target-avr: adding AVR interrupt handling Michael Rolnik
2016-06-06 21:44   ` Richard Henderson
2016-06-06 22:17     ` Peter Maydell
2016-06-06 10:37 ` [Qemu-devel] [PATCH v4 7/9] target-avr: adding instruction decoder Michael Rolnik
2016-06-06 22:06   ` Richard Henderson
2016-06-06 10:37 ` [Qemu-devel] [PATCH v4 8/9] target-avr: adding instruction translation Michael Rolnik
2016-06-06 23:05   ` Richard Henderson
2016-06-06 10:38 ` [Qemu-devel] [PATCH v4 9/9] target-avr: updating translate.c to use instructions translation Michael Rolnik
2016-06-06 19:40 ` [Qemu-devel] [PATCH v4 0/9] 8bit AVR cores Richard Henderson
2016-06-06 19:49   ` Michael Rolnik
2016-06-06 19:53     ` Michael Rolnik
2016-06-06 20:16       ` Richard Henderson
2016-06-06 20:21     ` Richard Henderson
     [not found] ` <1465209480-71364-7-git-send-email-rolnik@amazon.com>
2016-06-06 21:58   ` [Qemu-devel] [PATCH v4 6/9] target-avr: adding helpers for IN, OUT, SLEEP, WBR & unsupported instructions Richard Henderson

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).