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 build by following these instructions. The pre-built binaries of sail-riscv is available in
bin
directory. -
riscv-arch-tests - Compliance tests are added as a submodule in
$SERV/verif
. Run the following commands from the$SERV
.$ git submodule init $ git submodule update
This will clone the arch-tests repository into the
$SERV/verif/riscv-arch-tests
. -
RISCOF - If you have installed Python, run the folllowing command to install RISCOF.
pip3 install git+https://github.com/riscv/riscof.git
⚠️ Make sure to export the root directory as$WORKSPACE
and also make sure to have the directory structure that looks like this.
.
$WORKSPACE
|
├── build
│ └── ...
├── fusesoc.conf
└── fusesoc_libraries
├── fusesoc_cores
│ └── ...
├── mdu
│ └── ...
└── serv
├── ...
├── verif
| ├── bin
| | └── ...
| ├── config.ini
| ├── plugin-sail_cSim
| | └── ...
| ├── plugin-serv
| | └── ...
| ├── Readme.md
| ├── riscv-arch-test
| | └── ...
| └── sim
| └── ...
└── ...
After completing all the steps in Getting started followed by the Prerequisites, we are all set to run the complaince tests.
⭕ All the RISCOF commands will be run from $SERV/verif
riscof run --config=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 inside $SERV/verif/
which contains all the log files, signatures, executeables for Reference model and/or DUT.