Home /Modules/cpu/SPECIFICATION.md

SPECIFICATION.md

lib/cpu/riscv/SPECIFICATION.md · 39 line(s) · markdown

RISC-V Specification

Base state

ResourceRV32IRV64I
Integer registers3232
Register width3264
x0constant zeroconstant zero
PCXLENXLEN

The base ISA does not require dedicated hardware registers for stack pointer or return address; software conventionally uses x2 as SP and x1 as the return-address register. citeturn0search0

Base encoding

RISC-V keeps rs1, rs2, and rd fields in consistent positions. Base RV32I uses R/I/S/U formats with B/J immediate variants; base instructions are 32 bits. Optional extensions can introduce 16-bit instructions. citeturn0search0

Extensions

The standard G profile combines IMAFD with Zicsr and Zifencei. citeturn0search3

Privilege

Machine, supervisor, and user execution are modeled where implemented; hypervisor and other privileged extensions remain profile-specific.

Virtual memory

RV64 profiles may select Sv39, Sv48, Sv57, or another defined translation scheme. Sv39 provides a 39-bit virtual address space. citeturn0search24