1 |
62 |
zero_gravi |
# Simulation Source Folder
|
2 |
40 |
zero_gravi |
|
3 |
|
|
|
4 |
62 |
zero_gravi |
## [`neorv32_tb.simple.vhd`](neorv32_tb.simple.vhd) and [`ghdl_sim.sh`](ghdl_sim)
|
5 |
40 |
zero_gravi |
|
6 |
62 |
zero_gravi |
Simple testbench for the NEORV32 Processor and script for simulation using GHDL.
|
7 |
40 |
zero_gravi |
|
8 |
62 |
zero_gravi |
|
9 |
|
|
## [`rtl_modules`](rtl_modules)
|
10 |
|
|
|
11 |
42 |
zero_gravi |
This folder provides additional/alternative simulation components (mainly optimized memory components yet). See the comments in the according files for more information.
|
12 |
40 |
zero_gravi |
|
13 |
|
|
|
14 |
62 |
zero_gravi |
## [`neorv32_tb.vhd`](neorv32_tb.vhd) and [`run.py`](run.py)
|
15 |
40 |
zero_gravi |
|
16 |
62 |
zero_gravi |
VUnit testbench and run script for the NEORV32 Processor.
|
17 |
40 |
zero_gravi |
|
18 |
62 |
zero_gravi |
|
19 |
|
|
## [`run_riscv_arch_test.sh`](run_riscv_arch_test.sh): NEORV32 RISC-V Architecture Test Framework
|
20 |
|
|
|
21 |
|
|
This script tests the NEORV32 Processor for RISC-V compatibility using the
|
22 |
|
|
[official RISC-V architecture test suite v2+](https://github.com/riscv/riscv-arch-test).
|
23 |
|
|
The core's HDL sources are *simulated* using `GHDL` to provide a virtual execution platform for the test framework:
|
24 |
|
|
|
25 |
|
|
* `rv32i_m/C` - compressed instructions
|
26 |
|
|
* `rv32i_m/I` - base ISA
|
27 |
|
|
* `rv32i_m/M` - hardware integer multiplication and division
|
28 |
|
|
* `rv32i_m/privilege` - privileged architecture
|
29 |
|
|
* `rv32i_m/Zifencei` - instruction stream synchronization (for example for self-modifying code)
|
30 |
|
|
|
31 |
|
|
:warning: The RISC-V GCC toolchain (`riscv{32|64}-unknown-elf`) is required for program compilation, and the simulation
|
32 |
|
|
depends on `ghdl_sim.sh`.
|
33 |
|
|
|
34 |
|
|
To execute all the supported tests open a terminal and run [`./sim/run_riscv_arch_test.sh`](run_riscv_arch_test.sh),
|
35 |
|
|
which does the following:
|
36 |
|
|
|
37 |
|
|
* Make local copies of the NEORV32 `rtl`, `sim` and `sw` folders in `work/`, to keep the project's core files clean.
|
38 |
|
|
* Clone (as `git submodule`) the [riscv-arch-test repository](https://github.com/riscv/riscv-arch-test) into `sw/isa-test/riscv-arch-test`.
|
39 |
|
|
* Install (copy) the custom `neorv32` test target from `sw/isa-test/port-neorv32` to the
|
40 |
|
|
test suite's target folder `work/riscv-arch-test/riscv-target/neorv32`
|
41 |
|
|
* Make a copy of the original IMEM VHDL source file of the processor (`cp work/neorv32/rtl/core/neorv32_imem.vhd work/neorv32/rtl/core/neorv32_imem.ORIGINAL`);
|
42 |
|
|
since the IMEM will be overriden by the device makefiles with a simulation-optimized one (`neorv32/sim/rtl_modules/neorv32_imem.vhd`).
|
43 |
|
|
Still, the original IMEM is required for certain tests that use self-modifying code.
|
44 |
|
|
* Run the actual tests.
|
45 |
|
|
|
46 |
|
|
:warning: Simulating all the test cases takes quite some time.
|
47 |
|
|
|
48 |
|
|
:warning: If the simulation of a test does not generate any signature output at all or if the signature is truncated,
|
49 |
|
|
try increasing the simulation time by modiying the `SIM_TIME` variable when calling the test makefiles in `run_riscv_arch_test.sh`.
|
50 |
|
|
|
51 |
|
|
More datails regarding the actual simulation process can be found in the
|
52 |
|
|
[target's `README`](../sw/riscv-arch-test/port-neorv32/framework_v2.0/riscv-target/neorv32/README.md).
|