A single-cycle RV32I core that runs all 37 base instructions. What I care about most is how it's checked: every instruction the core finishes is compared, in lockstep, against a separate Python instruction-set simulator. The two must agree on the PC, the register written and its value, and every store.
37RV32I instructions
25 × 400random programs × instructions per run
Every committests run in CI
Caughta deliberate bug, at the exact instruction
Datapath diagramPC → instruction memory → decoder → registers → ALU → data memory → write-back
qrv-datapath.pngTest-bench diagramCPU trace port ⇄ cocotb ⇄ Python reference model
qrv-testbench.pngWaveform screenshotA few instructions running, from
make WAVES=1qrv-waves.pngStatus
- DoneSingle-cycle core, all 37 RV32I instructions, RVFI-style trace port
- DoneLockstep testing against a Python model: directed tests + constrained-random programs, CI on every commit
- DoneMutation check: a broken arithmetic shift was caught at the exact failing instruction
- Next5-stage pipeline: I'm designing the forwarding and hazard units myself
- LaterOfficial
riscv-tests, then running it on an FPGA board
How this was built. I used Claude to get the first version running fast. I'm now rewriting each block myself and designing the pipeline's hazard logic, verified by the same test bench.