Randomized Testing of RISC-V CPUs Using Direct Instruction Injection
Paper
A peer-reviewed paper, published in IEEE Design & Test of Computers, 41(1):40–49 in February 2024 (DOI 10.1109/MDAT.2023.3262741), that introduces TestRIG, a randomized RISC-V CPU verification ecosystem built around Direct Instruction Injection, RVFI-DII instrumentation, and QCVEngine-generated test sequences. The paper describes smart shrinking of failing instruction sequences, non-shrinkable initialization, sequence-level assertions, and a Sail-model architectural coverage comparison against riscv-tests and RISCV-DV. The work has been independently cited in follow-on research on large-scale RISC-V processor verification.
First seen5/27/2026
Last seen6/10/2026
Evidence18 chunks
Wikiv3
01
WIKI
Publication
Randomized Testing of RISC-V CPUs Using Direct Instruction Injection was authored by Alexandre Joannou, Peter Rugg, Jonathan Woodruff, Franz A. Fuchs, Marno van der Maas, Matthew Naylor, Michael Roe, Robert N. M. Watson, Peter G. Neumann, and Simon W. Moore, and published in IEEE Design & Test of Computers, volume 41, issue 1, pages 40–49, in February 2024. [IEEE Design & Test of Computers] [DOI 10.1109/MDAT.2023.3262741] [1]
[3]Direct Instruction Injection injects instruction-level packets into implementations, which makes shrinking of instruction sequences with branches straightforward and was used to replace instruction-level unit tests for the CHERI extension.Randomized Testing of RISC-V CPUs Using Direct Instruction Injection
[5]TestRIG baseline expectations include 8 MiB of memory at address 0x80000000, access faults for all other addresses, and reset to a known state with zeroed registers, known default CSR values, and zeroed memory after a reset DII packet.Randomized Testing of RISC-V CPUs Using Direct Instruction Injection
[6]Implementation choices for instruction injection include removing the instruction cache while preserving PC translation, or exercising the cache and replacing instruction bytes after fetch; for compressed instructions, either substituting picked instructions before decode or injecting 16-bit fragments.Randomized Testing of RISC-V CPUs Using Direct Instruction Injection
[7]Smart shrinking uses QuickCheck's built-in list shrinking and additional transformations such as propagating output registers into later input operands, plus a simplification library to replace esoteric instructions with simpler equivalents.Randomized Testing of RISC-V CPUs Using Direct Instruction Injection
[8]Sequences can be annotated as non-shrinkable to force initialization that avoids trivial counterexamples, e.g., from uninitialized floating-point registers, allowing testing of more interesting exception and rounding-mode behavior.Randomized Testing of RISC-V CPUs Using Direct Instruction Injection
[9]TestRIG sequences may include assertions (e.g., asserting that a previous instruction wrote a non-zero value), enabling failures without tandem verification, and were used to test limits of implementation-defined behavior.Randomized Testing of RISC-V CPUs Using Direct Instruction Injection
[10]Architectural coverage is measured using sailcov on the RISC-V Sail model, comparing QCVEngine against riscv-tests and RISCV-DV across RV32IMC and RV64IMAFDCZicsr, with RV32IMC coverage measured for the I, M, and C extension instructions and general-purpose registers.Randomized Testing of RISC-V CPUs Using Direct Instruction Injection
[12]Applying RVFI-DII to the Ibex core has been reported in follow-on work to require more than 450 lines of code, and the paper is cited as the Joannou2024 RVFI-DII reference in large-scale RISC-V verification research.Large-Scale RISC-V Processor Verification Using Automated ...