Skip to content

Commit

Permalink
Update verification README
Browse files Browse the repository at this point in the history
  • Loading branch information
mczyz-antmicro committed Jun 26, 2023
1 parent e3ef883 commit 63b3c34
Showing 1 changed file with 6 additions and 27 deletions.
33 changes: 6 additions & 27 deletions verification/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Verification

The verification directory contains [cocotb](https://github.com/cocotb/cocotb) tests and [pyuvm](https://github.com/pyuvm/pyuvm) tests
The verification directory contains [pyuvm](https://github.com/pyuvm/pyuvm) tests, which rely on [cocotb](https://github.com/cocotb/cocotb) library.

## Setup

In order to run the tests, one must clone the repository, create a python virtual environment and patch cocotb's verilator support file. Verilator is used as a backend simulator and must be present in the system.
In order to run the tests, create a python virtual environment. Verilator is used as a backend simulator and must be present in the system.

### Clone repository

Remember to set the `RV_ROOT` environment variable, which is required to generate a VeeR-EL2 Core configuration files.
Remember to set the `RV_ROOT` environment variable, which is required to generate VeeR-EL2 Core configuration files.

git clone [email protected]:chipsalliance/Cores-VeeR-EL2.git
git clone --recurse-submodules [email protected]:chipsalliance/Cores-VeeR-EL2.git
cd Cores-Veer-EL2
export RV_ROOT=$(pwd)

Expand All @@ -21,20 +21,9 @@ Remember to set the `RV_ROOT` environment variable, which is required to generat
source venv/bin/activate
pip install -r requirements.txt

### Patch cocotb

Due to issues with Verilator's `--timing` options, the `cocotb/share/lib/verilator.cpp` must be patched. The `--timing` option is only required if the HDL code contains timing structures.

TODO: update link to upstream when patch is merged

cd $RV_ROOT/third_party
git clone https://github.com/antmicro/cocotb
git checkout mczyz/verilator-patch-timing
pip install -e $RV_ROOT/third_party/cocotb

### Install Verilator

Verification tests were run with Verilator-5.0.10. Installation instruction is avaialable in the Verilator's User Guide:
Verification tests were run with Verilator-5.0.10. Installation instruction is available in the Verilator's User Guide:

https://veripool.org/guide/latest/install.html

Expand All @@ -44,13 +33,7 @@ All tests are wrapped in a pytest, which can be executed with:

python -m pytest -sv <test_name>

If you want to generate html reports, it is recommended to use:

python -m pytest -v <test_name> --html=index.html

If you want to generate a mardkown report, it is recommended to use:

python -m pytest -v <test_name> --md=test.md
Note that HTML report can be produced with flag `--html=index.html` and a markdown report with `--md=test.md`

### PyUVM

Expand All @@ -64,7 +47,3 @@ Also available targets are:
make clean
make verilator-pyuvm

Run all tests:

python -m pytest -sv test.py

0 comments on commit 63b3c34

Please sign in to comment.