{
  "id": "riscv-coq",
  "name": "riscv-coq (MIT RISC-V specification in Rocq)",
  "aka": [
    "riscv-coq",
    "coq-riscv"
  ],
  "summary": "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.",
  "target": "riscv",
  "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.",
  "version": "No ISA manual version is stated.",
  "framework": "Rocq",
  "provers": [
    "rocq"
  ],
  "open": "open-source",
  "license": "BSD-3-Clause",
  "maintainers": [
    "MIT Programming Languages and Verification group (mit-plv)"
  ],
  "links": {
    "repo": "https://github.com/mit-plv/riscv-coq",
    "paper": "https://arxiv.org/abs/2104.00762"
  },
  "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).",
  "stage_evidence": {
    "mechanized": {
      "met": true,
      "evidence": "https://github.com/mit-plv/riscv-coq/tree/master/src/riscv/Spec"
    },
    "scope_stated": {
      "met": true,
      "evidence": "https://github.com/mit-plv/riscv-coq#risc-v-specification-in-coq",
      "note": "The README states the fragment (RV32I/RV64I with M and A), but not an ISA manual version. The code treats A as unsupported in the main execute function."
    },
    "executable": {
      "met": true,
      "evidence": "https://github.com/mit-plv/riscv-coq/blob/master/src/riscv/Platform/Run.v",
      "note": "The step function (run1) is an ordinary computable Rocq definition. We found no packaged simulator for running test binaries."
    },
    "validated": {
      "met": false,
      "note": "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."
    },
    "adopted_by_owner": {
      "met": false,
      "note": "We found no statement from RISC-V International about this model."
    },
    "full_coverage": {
      "met": false,
      "note": "Only I, M and part of Zicsr are executed."
    },
    "tracks_versions": {
      "met": false,
      "note": "No stated policy for following new ISA versions."
    }
  },
  "features": {
    "isa.user": {
      "status": "partial",
      "note": "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": "https://github.com/mit-plv/riscv-coq/blob/master/src/riscv/Spec/Execute.v"
    },
    "isa.fp": {
      "status": "none",
      "note": "F and D instructions are decoded but not executed.",
      "source": "https://github.com/mit-plv/riscv-coq/blob/master/src/riscv/Spec/Execute.v"
    },
    "isa.simd": {
      "status": "none",
      "note": "No vector (V) extension.",
      "source": "https://github.com/mit-plv/riscv-coq/blob/master/src/riscv/Spec/Decode.v"
    },
    "isa.privileged": {
      "status": "partial",
      "note": "CSR instructions and exceptions are modeled in part; the paper marks Zicsr as partly supported in the Rocq version.",
      "source": "https://arxiv.org/abs/2104.00762"
    },
    "isa.mmu": {
      "status": "none",
      "note": "Address translation is an abstract machine operation (translate); no page-table walk.",
      "source": "https://github.com/mit-plv/riscv-coq/blob/master/src/riscv/Spec/VirtualMemory.v"
    },
    "isa.memory-model": {
      "status": "none",
      "note": "The machine is a single hart; no RVWMO multiprocessor memory model.",
      "source": "https://github.com/mit-plv/riscv-coq/blob/master/src/riscv/Platform/RiscvMachine.v"
    }
  },
  "last_release": {
    "version": "v0.0.6",
    "date": "2025-10-06",
    "source": "https://github.com/mit-plv/riscv-coq/releases/tag/v0.0.6"
  },
  "last_commit": {
    "date": "2026-11-13",
    "source": "https://github.com/mit-plv/riscv-coq/commits/master"
  },
  "last_checked": "2026-11-26",
  "attestation": "maintainer",
  "claimed_by_authors": false,
  "sources": [
    {
      "url": "https://github.com/mit-plv/riscv-coq",
      "title": "riscv-coq README",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://github.com/mit-plv/riscv-coq/commits/master",
      "title": "Commits (latest 03881b2, 2026-11-13)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://arxiv.org/abs/2104.00762",
      "title": "Flexible Instruction-Set Semantics via Type Classes (formerly: A Multipurpose Formal RISC-V Specification)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://github.com/mit-plv/bedrock2/tree/master/deps",
      "title": "bedrock2 depends on riscv-coq",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://adam.chlipala.net/papers/LightbulbPLDI21/",
      "title": "Integration Verification across Software and Hardware for a Simple Embedded System (PLDI 2021)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://github.com/mit-plv/riscv-semantics",
      "title": "Haskell riscv-semantics (source of the generated definitions)",
      "accessed": "2026-11-26"
    }
  ],
  "computed": {
    "kind": "semantics",
    "methodology_version": "0.1",
    "built": "2026-11-26",
    "links": {
      "html": "/semantics/riscv-coq/",
      "json": "/semantics/riscv-coq.json",
      "markdown": "/semantics/riscv-coq.md"
    },
    "stage": {
      "stage": 0,
      "name": "Mechanized",
      "criteria": [
        {
          "key": "mechanized",
          "stage": 0,
          "label": "Machine-checked or machine-readable definition",
          "met": true,
          "evidence": "https://github.com/mit-plv/riscv-coq/tree/master/src/riscv/Spec",
          "computed": false
        },
        {
          "key": "scope_stated",
          "stage": 0,
          "label": "Fragment and version are stated",
          "met": true,
          "evidence": "https://github.com/mit-plv/riscv-coq#risc-v-specification-in-coq",
          "note": "The README states the fragment (RV32I/RV64I with M and A), but not an ISA manual version. The code treats A as unsupported in the main execute function.",
          "computed": false
        },
        {
          "key": "executable",
          "stage": 1,
          "label": "Can be executed or tested",
          "met": true,
          "evidence": "https://github.com/mit-plv/riscv-coq/blob/master/src/riscv/Platform/Run.v",
          "note": "The step function (run1) is an ordinary computable Rocq definition. We found no packaged simulator for running test binaries.",
          "computed": false
        },
        {
          "key": "validated",
          "stage": 1,
          "label": "Published results against conformance tests or real implementations",
          "met": false,
          "note": "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.",
          "computed": false
        },
        {
          "key": "authoritative",
          "stage": 2,
          "label": "Adopted by the language or ISA owner, or covers the full current version and tracks new ones",
          "met": false,
          "note": "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.",
          "computed": true
        }
      ],
      "missing_for_next": [
        "validated"
      ]
    },
    "used_by": []
  }
}