Formal semanticsmodels RISC-V
Sail RISC-V model
Also known as sail-riscv, RISC-V golden model, RISC-V formal specification
The official formal model of the RISC-V instruction set, written in Sail and adopted by RISC-V International. From it you can build a RISC-V emulator and definitions for several proof assistants.
What it covers
- Models
- RISC-V, Per-extension versions are listed in the README (for example RV32I/RV64I v2.1, V v1.0, supervisor ISA 1.12 and 1.13). Latest release 0.16.
- Fragment
- Unprivileged and privileged RISC-V: the RV32/RV64 I and E base ISAs, most ratified extensions (M, A, F, D, C, B, V, scalar and vector crypto, H and many others), machine, supervisor and user modes, Sv32 to Sv57 virtual memory and PMP. Some extensions are not modeled yet (see the Extension Roadmap). The model itself is sequential; multiprocessor behavior comes from separate tools.
- Written in
- Sail
- Usable in
- Rocq, Lean 4, Isabelle/HOL, HOL4
- Validation
- Every CI run (each pull request and each push to master) runs the emulator built from the model on riscv-tests, the official RISC-V architectural certification tests (riscv-arch-test), the DAMO hypervisor tests, some vector test configurations and a Linux boot; a weekly job runs more vector configurations. The README says the emulator can boot Linux, FreeBSD and seL4. A 2026 study by JKU Linz compared the vector extension against the Spike simulator: 0.23% of positive tests and 3.73% of negative (invalid-instruction) tests differed, and at least one difference was confirmed as a bug in the Sail model.
- Maintained by
- RISC-V International community (riscv GitHub organization, golden model group), Originally SRI International and the University of Cambridge
- Per instruction
- Instruction-by-instruction readiness
Stage
Computed from the evidence below; see the criteria. MechanizedMechanized. Written in a form a computer can check, rather than on paper. means a computer can check the definition.
- Met: Machine-checked or machine-readable definition Written in Sail. Rocq and Lean definitions are generated and built in CI on every change. Isabelle and HOL4 definitions (generated through Lem) are build targets but are not built in CI. evidence
- Met: Fragment and version are stated The README lists every supported extension with its version. evidence
- Met: Can be executed or tested Sail compiles the model to a C++ emulator (sail_riscv_sim); binary releases exist. evidence
- Met: Published results against conformance tests or real implementations riscv-tests, riscv-arch-test, hypervisor and vector suites run in public CI on every change (test suites described in test/README.md). Independent differential testing against Spike for the vector extension was published in 2026. evidence
- Met: Adopted by the language or ISA owner, or covers the full current version and tracks new ones Adopted by the owner: yes; full coverage: no; tracks new versions: no. The README in RISC-V International's GitHub organization says the model "has been adopted by RISC-V International". The official ISA manual embeds Sail code from the model in instruction descriptions (for example Zicond). The Extension Roadmap lists extensions that are not supported yet (for example Ztso, Smaia, Ssaia) and others still in review (for example Q, Zcmp, Zcmt, Zilsd/Zclsd, Smrnmi, Sdext). New extensions are added continuously and there are regular releases, but we found no stated time within which new ratified versions are added. evidence
Coverage
Which parts of RISC-V the model defines.
ISA-level features
| Feature | Support | Notes |
|---|---|---|
| User-level instructions The ordinary integer, memory and branch instructions programs use. | PartialPartial.Base ISAs and most ratified unprivileged extensions are modeled. The Extension Roadmap lists some as not done yet, for example Ztso, Zcmp, Zcmt and Zilsd/Zclsd. Source | Base ISAs and most ratified unprivileged extensions are modeled. The Extension Roadmap lists some as not done yet, for example Ztso, Zcmp, Zcmt and Zilsd/Zclsd. source |
| Floating-point instructions Scalar floating-point instructions. | PartialPartial.F, D, Zfh, Zfa, Zfinx and related extensions are modeled; Q (quad precision) is still in review. Source | F, D, Zfh, Zfa, Zfinx and related extensions are modeled; Q (quad precision) is still in review. source |
| Vector / SIMD instructions Vector and SIMD extensions. | SupportedSupported.V 1.0, the embedded Zve* subsets and the vector crypto extensions are modeled. A 2026 differential test against Spike found some deviations in invalid-instruction checks. Source | V 1.0, the embedded Zve* subsets and the vector crypto extensions are modeled. A 2026 differential test against Spike found some deviations in invalid-instruction checks. source |
| Privileged mode Privilege levels, control registers, traps and exceptions. | PartialPartial.Machine, supervisor and user modes, the H (hypervisor) extension and many Sm*/Ss* extensions are modeled. Missing or in review per the roadmap include Smaia/Ssaia (advanced interrupts), Smrnmi, Smepmp and Sdext (debug). Source | Machine, supervisor and user modes, the H (hypervisor) extension and many Sm*/Ss* extensions are modeled. Missing or in review per the roadmap include Smaia/Ssaia (advanced interrupts), Smrnmi, Smepmp and Sdext (debug). source |
| Virtual memory Page tables and address translation. | SupportedSupported.Sv32, Sv39, Sv48 and Sv57 page tables, Svnapot, Svpbmt, Svadu, and two-stage translation for H. Source | Sv32, Sv39, Sv48 and Sv57 page tables, Svnapot, Svpbmt, Svadu, and two-stage translation for H. source |
| Concurrency memory model The multiprocessor memory model (for example x86-TSO, Arm, RVWMO). | PartialPartial.The emulator and the prover definitions are sequential. The RVWMO memory model is available by combining the model with separate tools (the RMEM operational model and isla-axiomatic). Source | The emulator and the prover definitions are sequential. The RVWMO memory model is available by combining the model with separate tools (the RMEM operational model and isla-axiomatic). source |
Used by
Toolchains in this index whose proofs are about this model.
- Islaris Prove Arm or RISC-V machine code correct in Rocq, against the full official Sail ISA models, using Isla symbolic execution and an Iris separation logic.
Sources
- sail-riscv README · accessed 26 Nov 2026
- Extension Roadmap (edited 2026-11-12) · accessed 26 Nov 2026
- Prover output build targets (Rocq, Lean, Lem/Isabelle, HOL4) · accessed 26 Nov 2026
- CI job building the Lean definitions · accessed 26 Nov 2026
- CI job building the Rocq definitions · accessed 26 Nov 2026
- Main CI workflow (test suites and Linux boot) · accessed 26 Nov 2026
- Weekly full test-suite CI job · accessed 26 Nov 2026
- Test suites used by the model · accessed 26 Nov 2026
- ISA manual section embedding Sail code · accessed 26 Nov 2026
- Sail-RISC-V and Spike for RISC-V Vector (RISC-V Summit Europe 2026) · accessed 26 Nov 2026
- ISA Semantics for ARMv8-A, RISC-V, and CHERI-MIPS (POPL 2019) · accessed 26 Nov 2026