Overview
In the RISC-V CPU verification context shown by the Ibex testbench, co-simulation methodology refers to running a design under test, such as an RTL CPU core, together with a reference instruction-set simulator (ISS) and comparing their behavior. The Ibex UVM testbench uses this methodology to cross-check Ibex execution against the Spike ISS reference model. [C1]
How it is used in Ibex verification
The Ibex testbench stimulates the core to execute a program stored in memory. During execution, the core's trace log is compared with a golden-model ISS trace log from Spike; this cross-check is used to ensure correctness of execution. The testbench also collects coverage information about executed instructions and operands, with a test plan and coverage plan used to guide verification coverage. [C2]
A provided co-simulation system can run either in the Ibex UVM DV environment or with Simple System. In this system, a RISC-V ISS is run in lockstep with the Ibex core. All instructions executed by Ibex and memory transactions generated by Ibex are checked against the behavior of the ISS. [C3]
Synchronization and external events
The co-simulation system supports memory errors, interrupt requests, and debug requests. These events are observed in the RTL simulation and forwarded to the ISS so that the ISS and RTL model remain synchronized. [C4]
The RISC-V Formal Interface (RVFI) is used to provide information about retired instructions and instructions that produce synchronous traps for checking. [C5]
Tool and implementation notes
In the evidence, Spike is the currently supported ISS for the Ibex co-simulation system, and running the co-simulation system requires a particular version of Spike. The system is described as using a generic interface intended to allow support for multiple ISSes, although only Spike is currently supported. [C6]
The evidence also notes that only VCS is supported as a simulator for this co-simulation system, while adding support for another simulator should be straightforward because no VCS-specific functionality is required. [C7]
Role in verification closure
Within the Ibex verification flow, co-simulation is combined with randomized and directed testbench stimulus. The Ibex UVM environment runs binaries built from source produced by the RISC-DV random instruction generator, and the testbench can add randomized memory timings, memory errors, interrupts, and debug requests. A comprehensive test plan and coverage plan are implemented around this flow. [C8]