Abstract
As RISC-V processors evolve from simple scalar pipelines to complex superscalar architectures, the verification burden increases exponentially. This paper presents SupeRFIVe (Superscalar RISC-V Functional ISS-driven Verification), a methodology that bridges the gap between hardware description languages (HDL) and fast instruction set simulators (ISS). By synchronizing a hardware testbench with the Spike RISC-V simulator in lockstep, SupeRFIVe provides a time-efficient environment for functional validation and performance profiling. Evaluation on a dual-issue RV32IMF core using the Mälardalen benchmark suite demonstrates the framework's ability to catch functional errors and measure instruction-level parallelism (ILP) efficiency.
1. Introduction
The transition from scalar to superscalar execution is a critical step in enhancing the performance of RISC-V processors. However, executing multiple instructions simultaneously introduces significant complexity in the control logic, particularly regarding data hazards, resource contention, and precise exceptions. Ensuring that a superscalar implementation remains functionally identical to the sequential RISC-V ISA specification is a daunting task.
Traditional verification approaches often struggle with this complexity. Formal verification, while rigorous, is frequently limited to smaller ISA subsets and faces state-space explosion in superscalar designs. Conversely, cycle-accurate simulators like gem5 provide high detail but are often too slow for the extensive functional testing required during the RTL development phase. SupeRFIVe addresses this by providing a high-speed, "middle-ground" solution that leverages the speed of functional simulators without sacrificing the rigor of lockstep verification.
2. The SupeRFIVe Methodology
The core of SupeRFIVe is a lockstep synchronization mechanism between the Design Under Test (DUT) and a "Golden Model."
2.1 Synchronization Architecture
The framework utilizes Spike, the industry-standard RISC-V ISA simulator, as the golden reference. The connection between the SystemVerilog hardware testbench and the C++ based Spike simulator is established via the SystemVerilog Direct Programming Interface (DPI-C) and socket communication. This decoupled architecture allows the hardware simulator and the ISS to run as independent processes, minimizing the impact on simulation performance.
2.2 Commit-Driven Lockstep
The synchronization is driven by the CPU's "commit" stage. In a superscalar processor, the number of instructions retired per cycle can vary (e.g., 0, 1, or 2 in a dual-issue design). The SupeRFIVe logic follows a specific sequence:
- The RTL simulator executes for one clock cycle.
- The testbench monitors the commit stage to determine how many instructions ($N$) were successfully retired.
- The value $N$ is transmitted to Spike via the socket interface.
- Spike executes exactly $N$ instructions.
- The framework compares the architectural state—including the Program Counter (PC), general-purpose registers, and memory write operations—between the DUT and Spike.
Any discrepancy in the architectural state triggers an immediate error flag, allowing designers to pinpoint the exact cycle and instruction where the hardware deviated from the specification.
3. Experimental Evaluation
To validate the methodology, the authors applied SupeRFIVe to a dual-issue RV32IMF superscalar processor. This core supports integer operations, hardware multiplication, and single-precision floating-point extensions.
The verification suite consisted of 11 applications from the Mälardalen WCET benchmark suite. These benchmarks were selected for their diverse computational profiles:
- Arithmetic and Loops:
matmult(matrix multiplication) andprime(primality testing). - Control Flow and Memory:
bsort100(bubblesort) andjanne_complex. - Bitwise Logic:
crc(cyclic redundancy check).
4. Results and Analysis
The SupeRFIVe framework successfully verified the functional correctness of the dual-issue core across all tested benchmarks. Beyond simple "pass/fail" validation, the framework provided valuable insights into the processor's superscalar efficiency.
4.1 Instruction-Level Parallelism (ILP)
By tracking the number of instructions committed per cycle, the framework naturally acts as a performance profiler. The researchers measured the "double-commit ratio"—the percentage of cycles where the processor successfully retired two instructions simultaneously.
The average double-commit ratio across the benchmark suite was 34%. However, performance varied significantly based on the workload:
- High Efficiency:
matmultachieved a 57% double-commit ratio, indicating high instruction-level parallelism and effective utilization of the dual-issue pipeline. - Lower Efficiency: Branch-heavy or dependency-heavy programs, such as
janne_complex, showed lower utilization, highlighting the impact of control-flow bottlenecks on superscalar performance.
4.2 Computational Overhead
A key advantage of the SupeRFIVe approach is its efficiency. Because RTL simulation is inherently more computationally intensive than functional ISA simulation, the overhead of running Spike in the background and performing socket-based comparisons was found to be negligible.
5. Conclusion and Future Work
SupeRFIVe provides a robust and scalable solution for the functional verification of superscalar RISC-V processors. By using the commit count as a synchronization heartbeat, it effectively bridges the gap between cycle-based hardware and instruction-based software models.
Future work includes extending the framework to support out-of-order (OoO) execution. This will require more sophisticated commit logic to handle speculative execution and branch mispredictions. Additionally, the authors plan to incorporate support for the RISC-V Vector (V) extension, which will involve tracking and verifying a significantly larger architectural state.
Summary updated