Formal semanticsmodels RISC-V
riscv-coq (MIT RISC-V specification in Rocq)
Also known as riscv-coq, coq-riscv
A RISC-V model in Rocq (formerly Coq) from MIT, written for proofs rather than as a full reference. It is the target machine of the bedrock2 verified compiler and of MIT's end-to-end verified embedded system.
What it covers
- Models
- RISC-V, No ISA manual version is stated.
- Fragment
- RV32I and RV64I with the M extension and part of Zicsr (CSR instructions). A and F instructions are decoded, but the main execute function treats them as unsupported. No compressed (C), vector or floating-point execution. Address translation is left abstract.
- Written in
- Rocq
- Usable in
- Rocq
- Validation
- Most of the definitions were generated with hs-to-coq from MIT's Haskell riscv-semantics, which the paper reports running on parts of riscv-tests (rv64ui, rv64ua, rv64si, rv64mi) and booting Linux, without pass counts. We found no published conformance results for the Rocq version itself. Its main check is use in proofs: the bedrock2 compiler targets it, and the paper describes a processor proved correct against it (the PLDI 2021 lightbulb system).
- Maintained by
- MIT Programming Languages and Verification group (mit-plv)
- 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: Can be executed or tested The step function (run1) is an ordinary computable Rocq definition. We found no packaged simulator for running test binaries. evidence
- Not met: Published results against conformance tests or real implementations No published conformance or differential-testing results for the Rocq model. The paper says the Haskell model it came from ran parts of riscv-tests, without pass counts.
- Not met: Adopted by the language or ISA owner, or covers the full current version and tracks new ones Adopted by the owner: no; full coverage: no; tracks new versions: no. We found no statement from RISC-V International about this model. Only I, M and part of Zicsr are executed. No stated policy for following new ISA versions.
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.I (32 and 64 bit) and M are executed. A is defined in ExecuteA.v but the main execute function (Execute.v) treats A as unsupported. No C (compressed) or B instructions. Source | I (32 and 64 bit) and M are executed. A is defined in ExecuteA.v but the main execute function (Execute.v) treats A as unsupported. No C (compressed) or B instructions. source |
| Floating-point instructions Scalar floating-point instructions. | Not supportedNot supported.F and D instructions are decoded but not executed. Source | F and D instructions are decoded but not executed. source |
| Vector / SIMD instructions Vector and SIMD extensions. | Not supportedNot supported.No vector (V) extension. Source | No vector (V) extension. source |
| Privileged mode Privilege levels, control registers, traps and exceptions. | PartialPartial.CSR instructions and exceptions are modeled in part; the paper marks Zicsr as partly supported in the Rocq version. Source | CSR instructions and exceptions are modeled in part; the paper marks Zicsr as partly supported in the Rocq version. source |
| Virtual memory Page tables and address translation. | Not supportedNot supported.Address translation is an abstract machine operation (translate); no page-table walk. Source | Address translation is an abstract machine operation (translate); no page-table walk. source |
| Concurrency memory model The multiprocessor memory model (for example x86-TSO, Arm, RVWMO). | Not supportedNot supported.The machine is a single hart; no RVWMO multiprocessor memory model. Source | The machine is a single hart; no RVWMO multiprocessor memory model. source |
Used by
Toolchains in this index whose proofs are about this model.
No toolchain in the index refers to it yet.
Sources
- riscv-coq README · accessed 26 Nov 2026
- Commits (latest 03881b2, 2026-11-13) · accessed 26 Nov 2026
- Flexible Instruction-Set Semantics via Type Classes (formerly: A Multipurpose Formal RISC-V Specification) · accessed 26 Nov 2026
- bedrock2 depends on riscv-coq · accessed 26 Nov 2026
- Integration Verification across Software and Hardware for a Simple Embedded System (PLDI 2021) · accessed 26 Nov 2026
- Haskell riscv-semantics (source of the generated definitions) · accessed 26 Nov 2026