This repository is a port of the "RISCOF RISC-V Architectural Test Framework" to test the CELLRV32 RISC-V Processor for compatibility to the RISC-V user and privileged ISA specifications. Sail RISC-V is used as reference model. Currently, the following tests are supported:
-
rv32i_m\B- bit-manipulation (Zba,Zbb,Zbc,Zbs) -
rv32i_m\C- compressed instructions -
rv32i_m\I- base integer ISA -
rv32i_m\M- hardware multiplication and division -
rv32i_m\privilege- privileged machine architecture -
rv32i_m\Zifencei- instruction stream synchronization
💡 The general structure of this repository was setup according to the RISCOF installation guide.
Several tools and submodules are required to run this port of the architecture test framework. The repository's GitHub Actions workflow takes care of installing all the required packages.
- cellrv32 submodule - the device under test (DUT)
- riscv-arch-test submodule - architecture test cases
- RISC-V GCC toolchain - for compiling native
rv32code - Sail RISC-V - the reference model (pre-built binary in the
binfolder) - RISCOF - the architecture test framework
- QUESTASIM - the awesome SystemVerilog simulator for simulating the DUT
The framework (running all tests) is invoked via a single shell script
run.sh that returns 0 if all tests were executed
successfully or 1 if there were any errors. The exit code of this script is used to determine the overall success
of the GitHub Actions workflow.
The RISCOF config.ini is used to configure
the plugins to be used: the device-under-test ("DUT") and the reference model ("REF").
The ISA, debug and platform specifications, which define target-specific configurations like available ISA
extensions, ISA spec. versions and platform modules (like MTIME), are defined by YAML files in the according
plugin folder.
- DUT:
cellrv32inplugin-cellrv32 - REF:
sail_cSiminplugin-sail_cSim
Each plugin folder also provides low-level environment files like linker scripts (to generate an executable matching the target's memory layout) and platform-specific code (for example to initialize the target and to dump the final test signatures/results).
The official RISC-V architecture tests repository provides test cases for all (ratified) RISC-V ISA extensions (user and privilege ISA). Each test case checks a single instruction or core feature and is compiled into a plugin-specific executable using a prebuilt RISC-V GCC toolchain.
The "golden" reference data is generated by the Sail RISC-V Model. This data is compared against the results of the DUT. The final test report is made available as CSS-flavored HTML file.
💡 Prebuilt sail-riscv binaries for 64-bit Linux are available in the
bin folder.
The sim folder provides a simple VHDL testbench
and shell scripts to simulate the CELLRV32 processor using QUESTASIM. The testbench provides generics to configure the
DUT's RISC-V ISA extensions and also to pass a plain ASCII HEX file, which represents the actual executable
to be executed ("memory initialization file"). This file generated from a test-specific ELF file that is compiled
by the folder's makefile. The makefile uses the default software framework from the CELLRV32 submodule (more
specific: the image generator) to generate a memory initialization file from a compiled ELF file.
📚 The "simulation mode" feature of the processor's UART0 module is used to dump the test result data (= the test signature) to a file. More information regarding the UART simulation mode can be found in the CELLRV32 documentation.
The testbench also provides a "trigger mechanism" to quit the current simulation using VHDL08's finish
statement. Quitting the simulation is triggered by writing 0xCAFECAFE to address 0xF0000000, which
is implemented (software) by the DUT-specific plugin environment module.
The simulation scripts and the makefile for generating the memory initialization file are invoked from a DUT-
specific Python script in the DUT's plugin folder
(-> plugin-cellrv32/riscof_cellrv32.py).
This Python script makes extensive use of shell commands to move and execute files and scripts.