Measures the IPC impact of the RAS depth in CVA6
(cv64a6_imafdc_sv39) on Verilator. RAS depth is the only variable: the sweep edits
one localparam (CVA6ConfigRASDepth), logs the exact config line per build, and
rebuilds from clean. Everything is counted in hardware, not estimated: retired
instructions/cycles from the RVFI commit ports, RAS mispredictions from resolved
mispredicted Return control flows in the frontend (patches/0003).
| benchmark | kernel IPC gain vs depth-2 | saturates at | RAS misses, 2 → 16 |
|---|---|---|---|
| dhrystone | +1.58% | depth 4 | 717 → 210 (−71%) |
| callheavy (recursive fib + ackermann) | +0.44% @16, still rising | — | 44,852 → 34,079 (−24%) |
| coremark (10 iter) | +0.02% | depth 4 | 2,476 → 2,388 (−3.6%) |
Depth 4 captures essentially all return history for conventional call trees —
dhrystone and coremark are bit-identical at depths 4/8/16. Beyond 4 only deep
recursion pays, and little: the measured return-mispredict penalty is ≈6–7 cycles
(derived independently from both dhrystone and callheavy deltas). Each RAS entry
costs 65 flops (64-bit RA + valid; shift-register stack in core/frontend/ras.sv).
Sweet spot: depth 4 (+130 flops).
Full data: out/results.csv (whole-run counters) · per-run logs in out/ ·
rendered report in report.html.
Prereqs: Docker, git, ~8 GB free. Everything RISC-V (toolchain, spike, Verilator v5.008) lives in the container image.
./build.sh # pinned clone -> image -> verilate -> smoke-run
docker/dock.sh 'cd /bench && bash build_benches.sh' # dhrystone, callheavy, coremark
mkdir -p out && cp run_sweep.sh out/ && docker/dock.sh 'cd /tmp && bash /out/run_sweep.sh'out/results.csv appears with (ras_depth, benchmark, instrs, cycles, ipc, ras_mispredicts).
build.sh— one-command bring-up, fail-fast at every stagesetup_cva6.sh— CVA6 @ed2efa5+ exact submodules + tracked patches, idempotentpatches/0001,0002— build fixes this CVA6 commit needs (elfloader link + missing DPI fns)patches/0003— instrumentation: RAS-miss/instr/cycle counters,top->final(), RVFI trace gated behind+rvfi_tracedocker/— Ubuntu 24.04 image (riscv gcc + picolibc, spike, Verilator v5.008+patch),dock.shmount wrapperbench/— callheavy source + build script; riscv-tests / riscv-coremark cloned pinned bybuild.shrun_sweep.sh— the sweep: edit depth → verilate → run set → append CSV; resumable, retries flaky sim-startup segfaults
- Verilator
finalblocks (the counter dumps) only run if the C++ harness callstop->final(). rvfi_tracerwrites GB-scale.dasmtraces; unconditional writes onto a virtiofs mount segfault the sim — run sims from container-local/tmp, traces now opt-in via+rvfi_trace.- CoreMark's bundled bare-metal runtime faults CVA6's AXI; it's linked against the riscv-tests runtime instead. Its "Errors detected" output is only the ≥10-wall-clock-seconds official-reporting rule (all algorithm CRCs validate).