mbox series

[00/14] *** ARC port for review ***

Message ID 20200930204604.20663-1-cupertinomiranda@gmail.com
Headers show
Series *** ARC port for review *** | expand

Message

Cupertino Miranda Sept. 30, 2020, 8:45 p.m. UTC
From: Cupertino Miranda <cmiranda@synopsys.com>

Hello everyone,

It is with utmost pleasure that on behalf of Synopsys I initiate the
upstream process for our ARCv2 architecture QEMU port.

I am one of the main contributors to this port and member of the
Synopsys GNU toolchain team, together with Claudiu Zissulescu and 
Shahab Vahedi.

ARCv2 processors use RISC, and employ the 16-/32-bit instruction set
architecture (ISA).
ARC processors are configurable and extensible for a wide range of uses
in system on a chip (SoC) devices.
It is a common processor in deeply embedded systems, used in storage,
digital home, mobile, automotive, and Internet of Things (IoT) 
applications.

To facilitate reviewing, we split the files through several commits,
attempting to keep file size to reviewable chunks.

The port as presented implements the system softmmu hardware emulation,
capable to boot and run Linux kernel.
It has also been integrated as a patch in Zephyr project, where it is
being used.
To validate and guarantee correctness of the port through development, 
we have created TCG tests from the very beggining, covering the most 
fundamental CPU features.
For the remaining instructions we validate the port through compiler 
testsuites, like DejaGNU, comparing results with real hardware 
executions.

Would like also to thank our colleagues Vineet Gupta and Alexey Broadkin
for their contributions, which due to the collapse of the development
commits, got their contributions overcast by major ones.

Link for Synopsys ARC processor page:
 - https://www.synopsys.com/designware-ip/processor-solutions.html

ARC PRM for both HS and EM processors can be found in:
 - https://www.synopsys.com/dw/doc.php/ds/cc/programmers-reference-manual-ARC-EM.pdf
 - https://www.synopsys.com/dw/doc.php/ds/cc/programmers-reference-manual-ARC-HS.pdf.

Looking forward to your comments and suggestions.

Best regards,
Cupertino Miranda

*** BLURB HERE ***

Claudiu Zissulescu (5):
  arc: Decoder code
  arc: Opcode definitions table
  arc: Add IRQ and timer subsystem support
  arc: Add Synopsys ARC emulation boards
  tests/tcg: ARC: Add TCG instruction definition tests

Cupertino Miranda (5):
  arc: Add initial core cpu files
  arc: TCG and decoder glue code and helpers
  arc: TCG instruction definitions
  arc: Add BCR and AUX registers implementation
  arc: Add memory management unit (MMU) support

Shahab Vahedi (4):
  arc: TCG instruction generator and hand-definitions
  arc: Add memory protection unit (MPU) support
  arc: Add gdbstub and XML for debugging support
  arc: Add support for ARCv2

 configure                             |     5 +
 default-configs/arc-softmmu.mak       |     5 +
 disas.c                               |     2 +
 disas/arc.c                           |   460 +
 disas/meson.build                     |     1 +
 gdb-xml/arc-aux-minimal.xml           |    32 +
 gdb-xml/arc-aux-other.xml             |   235 +
 gdb-xml/arc-core-v2.xml               |    45 +
 hw/arc/Makefile.objs                  |    21 +
 hw/arc/arc_sim.c                      |   143 +
 hw/arc/arc_uart.c                     |   267 +
 hw/arc/board-hsdk.c                   |   107 +
 hw/arc/boot.c                         |    95 +
 hw/arc/boot.h                         |    21 +
 hw/arc/meson.build                    |    13 +
 hw/arc/nsim.c                         |    86 +
 hw/arc/pic_cpu.c                      |   111 +
 hw/arc/sample.c                       |    77 +
 hw/arc/sim-hs.c                       |   107 +
 hw/meson.build                        |     1 +
 include/disas/dis-asm.h               |    10 +-
 include/elf.h                         |     3 +
 include/exec/poison.h                 |     2 +
 include/hw/arc/arc_uart.h             |    43 +
 include/hw/arc/cpudevs.h              |    10 +
 include/sysemu/arch_init.h            |     1 +
 meson.build                           |     3 +-
 softmmu/arch_init.c                   |     2 +
 target/arc/Makefile.objs              |    34 +
 target/arc/arc-common.h               |    55 +
 target/arc/cache.c                    |   180 +
 target/arc/cache.h                    |    42 +
 target/arc/cpu-param.h                |    20 +
 target/arc/cpu-qom.h                  |    53 +
 target/arc/cpu.c                      |   468 +
 target/arc/cpu.h                      |   532 +
 target/arc/decoder.c                  |  1276 ++
 target/arc/decoder.h                  |   350 +
 target/arc/extra_mapping.def          |    40 +
 target/arc/flags.def                  |    85 +
 target/arc/gdbstub.c                  |   421 +
 target/arc/helper.c                   |   293 +
 target/arc/helper.h                   |    46 +
 target/arc/internals.h                |    37 +
 target/arc/irq.c                      |   658 +
 target/arc/irq.h                      |    37 +
 target/arc/meson.build                |    20 +
 target/arc/mmu.c                      |   775 +
 target/arc/mmu.h                      |   165 +
 target/arc/mpu.c                      |   653 +
 target/arc/mpu.h                      |   140 +
 target/arc/op_helper.c                |   749 +
 target/arc/opcodes.def                | 19976 ++++++++++++++++++++++++
 target/arc/operands.def               |   123 +
 target/arc/regs-detail.def            |   542 +
 target/arc/regs.c                     |   139 +
 target/arc/regs.def                   |   399 +
 target/arc/regs.h                     |   118 +
 target/arc/semfunc-helper.c           |   492 +
 target/arc/semfunc-helper.h           |   280 +
 target/arc/semfunc.c                  |  8474 ++++++++++
 target/arc/semfunc.h                  |    61 +
 target/arc/semfunc_mapping.def        |   329 +
 target/arc/timer.c                    |   456 +
 target/arc/timer.h                    |    32 +
 target/arc/translate.c                |  1344 ++
 target/arc/translate.h                |   202 +
 target/meson.build                    |     1 +
 tests/Makefile.include                |     1 +
 tests/tcg/Makefile.qemu               |    16 +-
 tests/tcg/Makefile.target             |     9 +-
 tests/tcg/arc/Makefile                |   112 +
 tests/tcg/arc/Makefile.softmmu-target |    36 +
 tests/tcg/arc/Makefile.target         |   101 +
 tests/tcg/arc/check_add.S             |    11 +
 tests/tcg/arc/check_addx.S            |    71 +
 tests/tcg/arc/check_andx.S            |    36 +
 tests/tcg/arc/check_aslx.S            |    57 +
 tests/tcg/arc/check_asrx.S            |    86 +
 tests/tcg/arc/check_basic1.S          |    30 +
 tests/tcg/arc/check_basic2.S          |    26 +
 tests/tcg/arc/check_beq.S             |    14 +
 tests/tcg/arc/check_beqx.S            |    26 +
 tests/tcg/arc/check_big_tb.S          |   173 +
 tests/tcg/arc/check_bnex.S            |    26 +
 tests/tcg/arc/check_breqx.S           |    26 +
 tests/tcg/arc/check_brgex.S           |    26 +
 tests/tcg/arc/check_brhsx.S           |    27 +
 tests/tcg/arc/check_brlox.S           |    26 +
 tests/tcg/arc/check_brltx.S           |    26 +
 tests/tcg/arc/check_brnex.S           |    26 +
 tests/tcg/arc/check_bta.S             |   294 +
 tests/tcg/arc/check_carry.S           |    15 +
 tests/tcg/arc/check_enter_leave.S     |   715 +
 tests/tcg/arc/check_excp.S            |    17 +
 tests/tcg/arc/check_excp_1.c          |    15 +
 tests/tcg/arc/check_excp_jumpdl_mmu.S |    44 +
 tests/tcg/arc/check_excp_mmu.S        |    69 +
 tests/tcg/arc/check_flags.S           |    23 +
 tests/tcg/arc/check_ldaw_mmu.S        |    71 +
 tests/tcg/arc/check_ldstx.S           |    37 +
 tests/tcg/arc/check_lp.S              |    12 +
 tests/tcg/arc/check_lp02.S            |    72 +
 tests/tcg/arc/check_lp03.S            |    49 +
 tests/tcg/arc/check_lp04.S            |    48 +
 tests/tcg/arc/check_lp05.S            |    23 +
 tests/tcg/arc/check_lp06.S            |   163 +
 tests/tcg/arc/check_lsrx.S            |    33 +
 tests/tcg/arc/check_mac.S             |   228 +
 tests/tcg/arc/check_manip_10_mmu.S    |   173 +
 tests/tcg/arc/check_manip_4_mmu.S     |   158 +
 tests/tcg/arc/check_manip_5_mmu.S     |   166 +
 tests/tcg/arc/check_manip_mmu.S       |   565 +
 tests/tcg/arc/check_mmu.S             |    59 +
 tests/tcg/arc/check_mpu.S             |   703 +
 tests/tcg/arc/check_mpyd.S            |   543 +
 tests/tcg/arc/check_mpyw.S            |    41 +
 tests/tcg/arc/check_norm.S            |    40 +
 tests/tcg/arc/check_orx.S             |    34 +
 tests/tcg/arc/check_prefetch.S        |    37 +
 tests/tcg/arc/check_rolx.S            |    47 +
 tests/tcg/arc/check_rorx.S            |    64 +
 tests/tcg/arc/check_rtc.S             |    29 +
 tests/tcg/arc/check_rtie_user.S       |    30 +
 tests/tcg/arc/check_stld.S            |    10 +
 tests/tcg/arc/check_subf.S            |    67 +
 tests/tcg/arc/check_subx.S            |    43 +
 tests/tcg/arc/check_swi.S             |   115 +
 tests/tcg/arc/check_swirq.S           |    27 +
 tests/tcg/arc/check_swirq1.S          |    31 +
 tests/tcg/arc/check_swirq3.S          |    49 +
 tests/tcg/arc/check_t01.S             |    12 +
 tests/tcg/arc/check_t02.S             |     9 +
 tests/tcg/arc/check_timer0.S          |    36 +
 tests/tcg/arc/check_timer0_loop.S     |    34 +
 tests/tcg/arc/check_timer0_loop3.S    |    46 +
 tests/tcg/arc/check_timer0_retrig.S   |    29 +
 tests/tcg/arc/check_timer0_sleep.S    |    33 +
 tests/tcg/arc/check_timerX_freq.S     |    87 +
 tests/tcg/arc/check_vadd.S            |   510 +
 tests/tcg/arc/check_vsub.S            |   510 +
 tests/tcg/arc/check_xorx.S            |    32 +
 tests/tcg/arc/ivt.S                   |    38 +
 tests/tcg/arc/macros.inc              |   261 +
 tests/tcg/arc/memory.x                |    12 +
 tests/tcg/arc/mmu.inc                 |   132 +
 tests/tcg/arc/mpu.inc                 |   269 +
 tests/tcg/arc/tarc.ld                 |    15 +
 tests/tcg/arc/tarc_mmu.ld             |    15 +
 tests/tcg/arc/test_macros.h           |   257 +
 tests/tcg/configure.sh                |     3 +-
 151 files changed, 50283 insertions(+), 9 deletions(-)
 create mode 100644 default-configs/arc-softmmu.mak
 create mode 100644 disas/arc.c
 create mode 100644 gdb-xml/arc-aux-minimal.xml
 create mode 100644 gdb-xml/arc-aux-other.xml
 create mode 100644 gdb-xml/arc-core-v2.xml
 create mode 100644 hw/arc/Makefile.objs
 create mode 100644 hw/arc/arc_sim.c
 create mode 100644 hw/arc/arc_uart.c
 create mode 100644 hw/arc/board-hsdk.c
 create mode 100644 hw/arc/boot.c
 create mode 100644 hw/arc/boot.h
 create mode 100644 hw/arc/meson.build
 create mode 100644 hw/arc/nsim.c
 create mode 100644 hw/arc/pic_cpu.c
 create mode 100644 hw/arc/sample.c
 create mode 100644 hw/arc/sim-hs.c
 create mode 100644 include/hw/arc/arc_uart.h
 create mode 100644 include/hw/arc/cpudevs.h
 create mode 100644 target/arc/Makefile.objs
 create mode 100644 target/arc/arc-common.h
 create mode 100644 target/arc/cache.c
 create mode 100644 target/arc/cache.h
 create mode 100644 target/arc/cpu-param.h
 create mode 100644 target/arc/cpu-qom.h
 create mode 100644 target/arc/cpu.c
 create mode 100644 target/arc/cpu.h
 create mode 100644 target/arc/decoder.c
 create mode 100644 target/arc/decoder.h
 create mode 100644 target/arc/extra_mapping.def
 create mode 100644 target/arc/flags.def
 create mode 100644 target/arc/gdbstub.c
 create mode 100644 target/arc/helper.c
 create mode 100644 target/arc/helper.h
 create mode 100644 target/arc/internals.h
 create mode 100644 target/arc/irq.c
 create mode 100644 target/arc/irq.h
 create mode 100644 target/arc/meson.build
 create mode 100644 target/arc/mmu.c
 create mode 100644 target/arc/mmu.h
 create mode 100644 target/arc/mpu.c
 create mode 100644 target/arc/mpu.h
 create mode 100644 target/arc/op_helper.c
 create mode 100644 target/arc/opcodes.def
 create mode 100644 target/arc/operands.def
 create mode 100644 target/arc/regs-detail.def
 create mode 100644 target/arc/regs.c
 create mode 100644 target/arc/regs.def
 create mode 100644 target/arc/regs.h
 create mode 100644 target/arc/semfunc-helper.c
 create mode 100644 target/arc/semfunc-helper.h
 create mode 100644 target/arc/semfunc.c
 create mode 100644 target/arc/semfunc.h
 create mode 100644 target/arc/semfunc_mapping.def
 create mode 100644 target/arc/timer.c
 create mode 100644 target/arc/timer.h
 create mode 100644 target/arc/translate.c
 create mode 100644 target/arc/translate.h
 create mode 100644 tests/tcg/arc/Makefile
 create mode 100644 tests/tcg/arc/Makefile.softmmu-target
 create mode 100644 tests/tcg/arc/Makefile.target
 create mode 100644 tests/tcg/arc/check_add.S
 create mode 100644 tests/tcg/arc/check_addx.S
 create mode 100644 tests/tcg/arc/check_andx.S
 create mode 100644 tests/tcg/arc/check_aslx.S
 create mode 100644 tests/tcg/arc/check_asrx.S
 create mode 100644 tests/tcg/arc/check_basic1.S
 create mode 100644 tests/tcg/arc/check_basic2.S
 create mode 100644 tests/tcg/arc/check_beq.S
 create mode 100644 tests/tcg/arc/check_beqx.S
 create mode 100644 tests/tcg/arc/check_big_tb.S
 create mode 100644 tests/tcg/arc/check_bnex.S
 create mode 100644 tests/tcg/arc/check_breqx.S
 create mode 100644 tests/tcg/arc/check_brgex.S
 create mode 100644 tests/tcg/arc/check_brhsx.S
 create mode 100644 tests/tcg/arc/check_brlox.S
 create mode 100644 tests/tcg/arc/check_brltx.S
 create mode 100644 tests/tcg/arc/check_brnex.S
 create mode 100644 tests/tcg/arc/check_bta.S
 create mode 100644 tests/tcg/arc/check_carry.S
 create mode 100644 tests/tcg/arc/check_enter_leave.S
 create mode 100644 tests/tcg/arc/check_excp.S
 create mode 100644 tests/tcg/arc/check_excp_1.c
 create mode 100644 tests/tcg/arc/check_excp_jumpdl_mmu.S
 create mode 100644 tests/tcg/arc/check_excp_mmu.S
 create mode 100644 tests/tcg/arc/check_flags.S
 create mode 100644 tests/tcg/arc/check_ldaw_mmu.S
 create mode 100644 tests/tcg/arc/check_ldstx.S
 create mode 100644 tests/tcg/arc/check_lp.S
 create mode 100644 tests/tcg/arc/check_lp02.S
 create mode 100644 tests/tcg/arc/check_lp03.S
 create mode 100644 tests/tcg/arc/check_lp04.S
 create mode 100644 tests/tcg/arc/check_lp05.S
 create mode 100644 tests/tcg/arc/check_lp06.S
 create mode 100644 tests/tcg/arc/check_lsrx.S
 create mode 100644 tests/tcg/arc/check_mac.S
 create mode 100644 tests/tcg/arc/check_manip_10_mmu.S
 create mode 100644 tests/tcg/arc/check_manip_4_mmu.S
 create mode 100644 tests/tcg/arc/check_manip_5_mmu.S
 create mode 100644 tests/tcg/arc/check_manip_mmu.S
 create mode 100644 tests/tcg/arc/check_mmu.S
 create mode 100644 tests/tcg/arc/check_mpu.S
 create mode 100644 tests/tcg/arc/check_mpyd.S
 create mode 100644 tests/tcg/arc/check_mpyw.S
 create mode 100644 tests/tcg/arc/check_norm.S
 create mode 100644 tests/tcg/arc/check_orx.S
 create mode 100644 tests/tcg/arc/check_prefetch.S
 create mode 100644 tests/tcg/arc/check_rolx.S
 create mode 100644 tests/tcg/arc/check_rorx.S
 create mode 100644 tests/tcg/arc/check_rtc.S
 create mode 100644 tests/tcg/arc/check_rtie_user.S
 create mode 100644 tests/tcg/arc/check_stld.S
 create mode 100644 tests/tcg/arc/check_subf.S
 create mode 100644 tests/tcg/arc/check_subx.S
 create mode 100644 tests/tcg/arc/check_swi.S
 create mode 100644 tests/tcg/arc/check_swirq.S
 create mode 100644 tests/tcg/arc/check_swirq1.S
 create mode 100644 tests/tcg/arc/check_swirq3.S
 create mode 100644 tests/tcg/arc/check_t01.S
 create mode 100644 tests/tcg/arc/check_t02.S
 create mode 100644 tests/tcg/arc/check_timer0.S
 create mode 100644 tests/tcg/arc/check_timer0_loop.S
 create mode 100644 tests/tcg/arc/check_timer0_loop3.S
 create mode 100644 tests/tcg/arc/check_timer0_retrig.S
 create mode 100644 tests/tcg/arc/check_timer0_sleep.S
 create mode 100644 tests/tcg/arc/check_timerX_freq.S
 create mode 100644 tests/tcg/arc/check_vadd.S
 create mode 100644 tests/tcg/arc/check_vsub.S
 create mode 100644 tests/tcg/arc/check_xorx.S
 create mode 100644 tests/tcg/arc/ivt.S
 create mode 100644 tests/tcg/arc/macros.inc
 create mode 100644 tests/tcg/arc/memory.x
 create mode 100644 tests/tcg/arc/mmu.inc
 create mode 100644 tests/tcg/arc/mpu.inc
 create mode 100644 tests/tcg/arc/tarc.ld
 create mode 100644 tests/tcg/arc/tarc_mmu.ld
 create mode 100644 tests/tcg/arc/test_macros.h