forked from chipsalliance/Cores-VeeR-EL2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added README.md for RISCV-DV and RISCOF tests
Signed-off-by: Maciej Kurc <[email protected]>
- Loading branch information
Showing
1 changed file
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# RISCV-DV for VeeR | ||
|
||
This folder contains utilities necessary for running [RISCV-DV](https://htmlpreview.github.io/?https://github.com/google/riscv-dv/blob/master/docs/build/singlehtml/index.html#) tests with VeeR as well as the master Makefile which facilitates the process. | ||
|
||
## Setup | ||
|
||
1. Clone VeeR repository with submodules and set `RV_ROOT` to the repository path: | ||
|
||
``` | ||
git clone --recurse-submodules [email protected]:chipsalliance/Cores-VeeR-EL2.git | ||
cd Cores-Veer-EL2 | ||
export RV_ROOT=$(pwd) | ||
``` | ||
|
||
2. Setup the RISCV-DV framework | ||
|
||
The framework should be already cloned in `Cores-Veer-EL2/third_party/riscv-dv`. Install its dependencies, best using a Python virtual environment: | ||
|
||
``` | ||
python3 -m venv env | ||
source env/bin/activate | ||
pip install -r ${RV_ROOT}/third_party/riscv-dv/requirements.txt | ||
``` | ||
|
||
3. Setup Verilator | ||
|
||
Installation instructions are available in the [Verilator's User Guide](https://veripool.org/guide/latest/install.html). Make sure that the verilator executable is available (eg. by setting `PATH`). | ||
|
||
4. Setup instruction set simulator (ISS) | ||
|
||
RISCV-DV tests require a reference RISC-V program executor in a form of instruction set simulator. The RISCV-DV flow for VeeR supports three of them: | ||
|
||
- Spike | ||
|
||
Follow the instruction from the [documentation](https://github.com/riscv-software-src/riscv-isa-sim#build-steps). After installation make sure that the spike binary is visible in the current path. | ||
|
||
- VeeR ISS (a.k.a. "whisper") | ||
|
||
VeeR ISS (previously known as "whisper") is a simulator designed specifically for VeeR. Nontheless, it is still a valid RV32IMC instruction set simulator. To build and install VeeR ISS follow the instructions in its [documentation](https://github.com/chipsalliance/VeeR-ISS#compiling-whisper). | ||
|
||
- Renode | ||
|
||
[Renode](www.renode.io) is a full-fledged embedded system simulator developed at Antmicro. Its capabilities go beyond simulating a RISC-V core which does not prevent it from being used as a reference ISS in RISCV-DV. | ||
|
||
Renode can be downloaded as a pre-built binary. Download the latest "linux-portable" release from https://github.com/renode/renode/releases and unpack it. For example: | ||
``` | ||
wget https://github.com/renode/renode/releases/download/v1.13.3/renode-1.13.3.linux-portable.tar.gz | ||
tar -zxf renode-1.13.3.linux-portable.tar.gz | ||
export PATH=${PATH}:`realpath renode_1.13.3_portable` | ||
``` | ||
|
||
## Running tests | ||
|
||
To run the tests using the default setup do the following: | ||
``` | ||
cd ${RV_ROOT}/tools/riscv-dv | ||
make run | ||
``` | ||
|
||
To alter the settings set relevant variables. Either in environment or in the make call commandline: | ||
|
||
- `RISCV_DV_ISS` | ||
|
||
Controls which ISS is used as the reference. Valid values are `spike`, `whisper` and `renode`. | ||
|
||
- `RISCV_DV_TEST` | ||
|
||
RISCV-DV test name. Defaults to `riscv_arithmetic_basic_test`. A complete list of tests can be found in [RISCV-DV documentation](https://github.com/chipsalliance/riscv-dv/tree/master/pygen/pygen_src) | ||
|
||
- `RISCV_DV_ITER` | ||
|
||
Test iteration count, default 1. | ||
|
||
- `RISCV_DV_BATCH` | ||
|
||
Test batch count, default 1. | ||
|
||
- `RISCV_DV_SEED` | ||
|
||
Random generator seed for RISCV-DV instruction randomizer | ||
|
||
- `COVERAGE` | ||
|
||
Enables coverage data collection in Verilator. Valid values are `branch`, `toggle` and `functional`. More information about coverage in Verilator can be found in its [documentation](https://veripool.org/guide/latest/simulating.html#coverage-analysis). | ||
|
||
## CI | ||
|
||
RISCV-DV tests are run in GitHub actions CI. The workflow responsible for them can be found at `.github/workflows/test-riscv-dv.yml` |