Skip to content

Commit d2fc73f

Browse files
[dv] Document llvm-snippy flow
Document the llvm-snippy flow from the core_ibex user-facing README, including the required tools, Make entry points, test selection knobs, and coverage targets.
1 parent 4e1c6cc commit d2fc73f

1 file changed

Lines changed: 109 additions & 0 deletions

File tree

dv/uvm/core_ibex/README.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,118 @@ export RISCV_GCC=riscv32-unknown-elf-gcc
2727
export RISCV_OBJCOPY=riscv32-unknown-elf-objcopy
2828
```
2929

30+
For the optional llvm-snippy flow, set `SC_SNIPPY_PATH` to the llvm-snippy
31+
installation directory:
32+
33+
```bash
34+
export SC_SNIPPY_PATH=/path/to/llvm-snippy
35+
```
36+
37+
The Snippy flow expects the executable at `$SC_SNIPPY_PATH/llvm-snippy`.
38+
More Snippy-specific setup notes are documented in `snippy_cmake/README.md`.
39+
3040
## Running tests
3141

3242
To run tests you can make variations of the following command, where you replace `$TEST_NAME` with the test (or a series of comma-separated tests) that you would like to run as specified in `dv/uvm/core_ibex/riscv_dv_extension/testlist.yaml`:
3343
```bash
3444
make --keep-going IBEX_CONFIG=opentitan SIMULATOR=xlm ISS=spike ITERATIONS=1 SEED=1 TEST=$TEST_NAME WAVES=0 COV=0
45+
```
46+
47+
## Running Snippy tests
48+
49+
The custom Snippy flow can be launched through the Ibex Makefile with
50+
`run_snippy`.
51+
52+
Example:
53+
54+
```bash
55+
make run_snippy \
56+
OUT=out \
57+
COV=1 \
58+
SIMULATOR=vcs \
59+
IBEX_CONFIG=opentitan \
60+
RV32ZC=ibex_pkg::RV32Zca \
61+
SNIPPY_ITERATIONS=3 \
62+
SNIPPY_TEST="layout_arith, jalr, rem_div" \
63+
SNIPPY_YAML_DIR=snippy/yaml_tests
64+
```
65+
66+
`SNIPPY_TEST` selects YAML files from `SNIPPY_YAML_DIR`.
67+
68+
`SNIPPY_TEST` is a comma-separated list of Snippy YAML layouts. The accepted
69+
forms include `layout_arith`, `arith`, and `layout_arith.yaml`.
70+
71+
`SNIPPY_ITERATIONS` controls the number of Snippy runs for each selected layout.
72+
73+
Snippy runtime results are written into the standard Ibex output tree:
74+
75+
```text
76+
out/run/tests/snippy_<layout>.<seed>/
77+
```
78+
79+
The CMake-side Snippy intermediate files and summary are written under:
80+
81+
```text
82+
out/snippy_cmake_build/
83+
```
84+
85+
## Collecting combined riscv-dv and Snippy coverage
86+
87+
To collect one combined coverage report from both riscv-dv and Snippy runs, use
88+
the same `OUT` directory and enable `COV=1` for both flows.
89+
90+
First, run riscv-dv only up to RTL simulation:
91+
92+
```bash
93+
make run \
94+
GOAL=rtl_sim_run \
95+
OUT=out \
96+
COV=1 \
97+
SIMULATOR=vcs \
98+
IBEX_CONFIG=opentitan \
99+
RV32ZC=ibex_pkg::RV32Zca \
100+
TEST=riscv_arithmetic_basic_test
101+
```
102+
103+
Using `GOAL=rtl_sim_run` avoids collecting an intermediate coverage report
104+
before the Snippy tests have been added.
105+
106+
Then run Snippy into the same `OUT` directory:
107+
108+
```bash
109+
make run_snippy \
110+
OUT=out \
111+
COV=1 \
112+
SIMULATOR=vcs \
113+
IBEX_CONFIG=opentitan \
114+
RV32ZC=ibex_pkg::RV32Zca \
115+
SNIPPY_ITERATIONS=3 \
116+
SNIPPY_TEST="layout_arith, jalr, rem_div"
117+
```
118+
119+
Finally, merge coverage once:
120+
121+
```bash
122+
make coverage_snippy OUT=out
123+
```
124+
125+
The final report is written to:
126+
127+
```text
128+
out/run/coverage/report/
129+
```
130+
131+
## Cleaning generated files
132+
133+
To remove generated outputs:
134+
135+
```bash
136+
make clean OUT=out
137+
```
138+
139+
This also removes the Snippy CMake build directory when it is located under
140+
`OUT`, for example:
141+
142+
```text
143+
out/snippy_cmake_build/
35144
```

0 commit comments

Comments
 (0)