RISC-V Instruction Set Manual - with Sail code!
June 30, 2026 ยท View on GitHub
This is a modified version of the RISC-V ISA manual that has been updated to include Sail code from the official riscv-sail model. It is kept up-to-date with the upstream ISA manual by automatically pulling main every night.
To help adding more Sail snippets:
- Find a place in the manual to add a Sail snippet or replace a hard-coded one.
- Delete the hard-coded version e.g.
Operation::
[source,sail]
--
function clause execute (SM3P0(rs1, rd)) = {
let r1 : bits(32) = X(rs1)[31..0];
let result : bits(32) = r1 ^ rol32(r1, 9) ^ rol32(r1, 17);
X(rd) = EXTS(result);
RETIRE_SUCCESS
}
--
- Change it to something like this:
Operation::
+
sail::execute[clause="SM3P0(_, _)",part=body,unindent]
-
Build the manual
make build-htmland check it looks good. -
Make a merge request to this repo (not the upstream one!) targetting the
sailbranch.
Original README follows.
RISC-V Instruction Set Manual
This repository contains the source files for the RISC-V Instruction Set Manual.
This work is licensed under a Creative Commons Attribution 4.0 International License. See the LICENSE file for details.
The RISC-V Instruction Set Manual is organized into the following volumes:
- Volume I: Unprivileged Architecture
- Volume II: Privileged Architecture
- Volume III: Profiles
The preface of each volume indicates the version of each standard that has been formally ratified by RISC-V International.
Official and Draft Versions
- Official versions of the specifications are available at the RISC-V International website.
- Compiled versions of the most recent drafts of the specifications can be found on the GitHub releases page.
- HTML snapshots of the latest commit can be viewed at the following locations:
- Older official versions of the specifications are archived at the GitHub releases archive.
The canonical list of open-source RISC-V implementations' marchid CSR values is available in the marchid.md file.
Contributing
See CONTRIBUTING.md for setup, build instructions, and contribution guidelines. If you would like to contribute to this documentation, please refer to the Documentation Developer's Guide.
The recommended method for building the PDF files is to use the Docker Image, as described in the RISC-V Docs Base Container Image repository.
Alternative build methods, such as local builds and GitHub Action builds, are also available and described in the Documentation Developer's Guide.
Images not rendered for EPUB files
If the eBook reader does not support embedded images, uncomment :data-uri: line in src/riscv-spec.adoc.
Known devices that cannot handle embedded images
- PocketBook InkPad 3