Overview
The BSV-RVFI-DII Library is the RVFI-DII library/repository cited by the TestRIG paper, which gives the repository URL as https://github.com/CTSRD-CHERI/BSV-RVFI-DII. In the paper’s terminology, RVFI-DII combines Direct Instruction Injection (DII) for instruction input with RVFI for trace output, enabling full interactive verification.
Role in RVFI-DII
The TestRIG paper states that its authors distribute data structures and libraries in several languages to make RVFI-DII connections over TCP ports easier to develop. It also describes a more capable DII unit as being available in the RVFI-DII libraries.
RVFI-DII is designed around a one-to-one relationship between injected DII instructions and RVFI trace entries. This matters for pipelined implementations because canceled or redirected instructions can otherwise desynchronize the input instruction stream from the output trace. The mature strategy described in the paper attaches a sequence ID to each RVFI instruction and carries it through the pipeline; instruction fetch requests each instruction ID from the DII sequence, allowing redirects to work naturally.
Bluespec interface context
The paper includes a Bluespec implementation sketch of the DII interface. In that sketch, a DII interface receives a reset command followed by a sequence of instructions, represented with fields such as whether the command is an instruction or reset, the time to inject the instruction, and the instruction word. For emulators, the paper describes this as replacing each fetched instruction with an encoding from the DII queue; for RTL designs, it notes that DII support is more complex.
Use in TestRIG-style verification
In the TestRIG workflow, instruction sequences can be sent over DII sockets and RVFI traces collected back for comparison. The paper’s QCVEngine uses QuickCheck to generate, compare, and shrink instruction sequences because DII decouples the instruction stream from control flow and does not associate injected instructions with memory addresses.