SERV uses the RISCOF which is python-based standard RISC-V Architectural Compliance Test Framework. This framework runs the Compliance tests in real-time on DUT and Reference and compare the signature results generated by both to decide if the tests are passed. In our case, DUT is SERV core and reference is the sail-riscv, which is the golden model for the formal specification of RISC-V architecture.
⚠️ Make sure to complete all the steps described in Getting Started. Once it's done, start setting up the following tools.
-
RISC-V GCC Toolchain - Install toolchain by running following command.
sudo apt-get install -y gcc-riscv64-unknown-elf
💡 By default, RISCOF plugins uses RV32 toolchain for compiling native
rv32
code. For SERV, this dependency has been removed from the plugin as RV64 is sufficient for 32-bit systems as well.
-
SAIL-RISCV - The reference model can be built by following these instructions. The pre-built binaries of sail-riscv is available in
bin
directory. Extract the tarball somewhere and add the directory containingriscv_sim_RV32
to your PATH -
RISCOF - If you have installed Python, run the following command to install RISCOF.
pip3 install riscof
-
riscv-arch-tests - Compliance tests are installed into the workspace by running:
$ riscof arch-test --clone
or alternatively
$ riscof arch-test --update
if the tests are already installed and just needs to be updated.
Make sure to have the directory structure that looks like this.
.
|
├── fusesoc.conf
├── fusesoc_libraries
| ├── fusesoc_cores
| │ └── ...
| ├── mdu
| │ └── ...
| └── serv
| ├── ...
| ├── verif
| | ├── bin
| | | └── ...
| | ├── config.ini
| | ├── plugin-sail_cSim
| | | └── ...
| | ├── plugin-serv
| | | └── ...
| └── ...
├── riscv-arch-test
└── ...
After completing all the steps in Getting started followed by the Prerequisites, we are all set to run the compliance tests.
⭕ All the RISCOF commands will be run from the workspace
riscof run --config=$SERV/verif/config.ini \
--suite=riscv-arch-test/riscv-test-suite/rv32i_m/I \
--env=riscv-arch-test/riscv-test-suite/env
--config
- Configuration file is passed using this flag which contains the paths and the names of DUT and Reference plugins.--suite
- The arch-tests are passed to RISCOF using this flag. In the above command, it pointsI
test directory. We can change path toM
,C
,privilege
orZifencei
directories to run the respective tests.--env
- The header files of test framework are passed using this flag.
💡 Other optional arguments of RISCOF command can be found here
When RISCOF run command successfully executed: an html
report is generated which depicts the results of the tests. And a directory named riscof_work
is created in the workspace which contains all the log files, signatures, executables for Reference model and/or DUT.