Control and Status Registers (CSRs)
ConceptControl and Status Registers (CSRs) are processor registers defined as part of an ISA that hold the control and status state of the processor. In the RISC-V architecture, CSRs are special-purpose registers specified by the privileged architecture that enable trap handling, environment interaction, performance monitoring, and identification. They include identification registers (marchid, mvendorid, mhartid), trap delegation registers (medeleg, mideleg), the Machine Interrupt Register (mip), machine and unprivileged performance counters (mcycle, minstret, mcycleh, minstreth, cycle, cycleh, instret, instreth, time, timeh), and setup/enable registers (mhpmcounter3-31, mhpmcounter3-31h, mhpmevent3-31, mscratch, mcounteren). The article covers CSR-specific architectural rules (including mandatory illegal instruction exceptions on writes to read-only CSRs and on accesses to non-existent CSRs), CSR-aware test generation, CSR transitions as a fuzzing coverage signal in ProcessorFuzz, and CSR mismatches and bugs identified via symbolic co-simulation of MicroRV32.
WIKI
Definition
Control and Status Registers (CSRs) are processor registers defined as part of an ISA that hold the control and status state of the processor. In the RISC-V architecture, CSRs are special-purpose registers specified by the privileged architecture that enable trap handling, environment interaction, performance monitoring, and identification. The set of RISC-V CSRs discussed in this article includes:
- Identification (read-only):
marchid(Machine Architecture ID Register),mvendorid(Machine Vendor ID Register), andmhartid(Hart ID Register). - Trap delegation (read/write):
medeleg(Machine Exception Delegation Register) andmideleg(Machine Interrupt Delegation Register). - Interrupts:
mip(Machine Interrupt Register). - Machine-mode performance counters:
mcycle,minstret,mcycleh,minstreth, andmhpmcounter3-31/mhpmcounter3-31h. - Unprivileged counters:
cycle,cycleh,instret,instreth,time,timeh. - Counter setup/enable:
mhpmevent3-31(Machine Counter Setup CSR),mscratch(Machine Scratch CSR), andmcounteren(Machine Counter-Enable Register).
NEIGHBORHOOD
No graph connections found for this entity yet. It may appear in future ingestion runs.
explore full graph →