RISC-V Compliance Suite
The RISC-V Compliance Suite is a collection of compliance tests produced under the auspices of the RISC-V International Association. It is intended to address a specific challenge that arises from the openness of the RISC-V ISA: because RISC-V permits many configuration options and custom extensions, there is no single ISA owner with a unilateral interest in ensuring cross-implementation compatibility. Open ISAs such as RISC-V must therefore pioneer compliance collectively, in contrast to established ISAs that are controlled by single companies.
Role in Processor Design Verification
In RISC-V hardware design verification (DV) flows, the Compliance Suite is used as one class of stimulus input when comparing an RTL implementation against a golden reference model. Typical processor verification plans combine several types of stimulus:
- The RISC-V International Association Compliance suite
- Directed tests
- Constrained-random Instruction Stream Generator (ISG) tests, such as the Google open-source project Google RISC-V DV-ISG
The Imperas reference model and verification tools (riscvOVPsim), for example, are used in side-by-side configurations with target RTL to run step-and-compare analysis, either interactively or in automated regression tests for continuous integration. Organizations such as Imperas Software have contributed new tools and simulation reference models to the broader RISC-V compliance effort.
Combined Verification Flow
In a representative combined flow, the Compliance Suite is run as the first stimulus class before the ISG-generated tests are exercised. The flow proceeds as follows:
- Establish a remote shell on a verification platform (for example, the Metrics Cloud Platform).
- Clone tests from a public Git repository, e.g. the compliance suite. Running the RV32I compliance test suite is shown as the baseline compliance check.
- Run the cloned tests in the same shell environment as the local toolchain.
- Run an ISG (such as the Google RISC-V DV-ISG / UVM-based test generator) to generate additional tests. The number of tests generated per run is configurable, and the ISG emits
.Sfiles that are assembled into ELF binaries. - Compile to an
.elffile for execution on the target RTL (e.g., a SystemVerilog simulator running on the Metrics Cloud Platform) and on the reference model (riscvOVPsim). - Run riscvOVPsim to generate the reference (golden) trace.
- Run RTL simulation and record the RTL trace.
- Compare run logs in a post-processing step, report pass/fail, and show mismatching instructions.
On failure, the post-processor reports the mismatching instructions. Full traces and additional information are retained for review, a VCD file can be dumped for full waveform analysis, and functional coverage can be analyzed using the Metrics Cloud Platform.
RV32I Compliance Test Suite
The RV32I portion of the suite serves as a representative baseline. In one published run, the RV32I compliance test suite executed 55 individual checks covering the RV32I base integer instruction set, including load/store word/halfword/byte (I-LW-01, I-SW-01, I-LH-01, I-SH-01, I-LB-01, I-SB-01), register-immediate and register-register arithmetic and logical operations (I-ADD-01, I-SUB-01, I-AND-01, I-OR-01, I-XOR-01, I-SLL-01, I-SRL-01, I-SRA-01 and their immediate counterparts), compares (I-SLT-01, I-SLTI-01, I-SLTU-01, I-SLTIU-01), upper-immediate (I-LUI-01, I-AUIPC-01), branches and jumps (including I-MISALIGN_JMP-01, I-MISALIGN_LDST-01), and register-file architectural checks such as I-RF_size-01, I-RF_width-01, and I-RF_x0-01. A passing run reported OK: 55/55 checks, demonstrating that the suite provides per-instruction and per-architectural-feature pass/fail granularity rather than a single aggregate pass/fail.
Adoption
Mellanox Technologies publicly disclosed using Imperas RISC-V verification tools and reference models in its design verification flow, citing among other factors the quality of the models, ease of use of the Imperas environment, coverage of the complete RISC-V specification, the ability to add custom instructions, and experience with processor RTL DV flows. The RISC-V Compliance Suite is referenced in that context as one of the stimulus inputs used in step-and-compare verification.