Overview
The Sail RISC-V Model is referenced as an architectural model for RISC-V used in model-based and randomized CPU testing. In the cited TestRIG work, the model is used as the object whose instruction and register coverage is measured for different RISC-V architecture configurations.
Coverage use in testing
The model is used to measure coverage for at least two RISC-V architecture strings:
- RV32IMC: coverage includes the Sail RISC-V model coverage of the I, M, and C extension instructions, as well as general-purpose registers.
- RV64IMAFDCZicsr: coverage includes I, M, A, F, D, C, and CSR instructions, as well as general-purpose and floating-point registers.
The evidence describes multiple ways of feeding tests or traces into this coverage workflow:
- For riscv-tests, coverage is measured by running the test binaries on the Sail RISC-V model.
- For RISCV-DV, traces are produced from the Spike simulator executing the tests, then replayed through RVFI-DII while measuring coverage of the Sail RISC-V model.
- For QCVEngine, the cited experiment configures the tool with the two architecture strings and runs 500 sequences of each generator.
Role in TestRIG-oriented model-based testing
The TestRIG paper frames its testing as model-based testing and describes shrinking and simplification of instruction traces: changes are safe to try because any changed trace that still diverges is kept. The same section discusses collecting human-readable traces as regression tests for previous counterexamples.
The Sail RISC-V Model also appears in the paper's discussion of future TestRIG directions. The authors report that Brian Campbell had begun work on a Sail-OCaml VEngine with direct access to the data structures of the Sail RISC-V model. The stated benefit is eliminating independent encodings in the VEngine. The authors also expected this approach to support automated generation of templates targeting deep architectural-model states using constraint solving.
Related tooling and interfaces
- RVFI-DII is used in the RISCV-DV coverage workflow: Spike-generated traces are replayed through RVFI-DII while Sail RISC-V model coverage is measured.
- sailcov is referenced by the paper in the coverage discussion via a repository link.
- TestRIG is the surrounding randomized, model-based testing context in which the Sail RISC-V Model is used for coverage and future VEngine integration discussions.