Expand description
RISC-V CSR’s
The following registers are not available on 64-bit implementations.
- cycleh
- timeh
- instreth
- hpmcounter<3-31>h
- mcycleh
- minstreth
- mhpmcounter<3-31>h
- mstatush
§On Floating-Point CSRs
We are deliberately not providing instructions that could change the floating-point rounding
mode or exception behavior or read the accrued exceptions flags: frcsr
, fscsr
, fsrm
,
frflags
, fsflags
.
Rust makes no guarantees whatsoever about the contents of the accrued exceptions register: Rust floating-point operations may or may not result in this register getting updated with exception state, and the register can change between two invocations of this function even when no floating-point operations appear in the source code (since floating-point operations appearing earlier or later can be reordered).
Modifying the rounding mode leads to immediate Undefined Behavior: Rust assumes that the default rounding mode is always set and will optimize accordingly. This even applies when the rounding mode is altered and later reset to its original value without any floating-point operations appearing in the source code between those operations (since floating-point operations appearing earlier or later can be reordered).
If you need to perform some floating-point operations and check whether they raised an exception, use a single inline assembly block for the entire sequence of operations.
If you need to perform some floating-point operations under a different rounding mode, use a single inline assembly block and make sure to restore the original rounding mode before the end of the block.
Modules§
- cycle register
- cycleh register
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- Performance-monitoring counter
- Upper 32 bits of performance-monitoring counter (RV32I only)
- instret register
- instreth register
- marchid register
- mcause register
- mcounteren register
- mcycle register
- mcycleh register
- medeleg register
- mepc register
- mhartid register
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring counter
- Upper 32 bits of machine performance-monitoring counter (RV32I only)
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- Machine performance-monitoring event selector
- mideleg register
- mie register
- mimpid register
- minstret register
- minstreth register
- mip register
- misa register
- mscratch register
- mstatus register
- mstatush register (RISCV-32 only)
- mtval register
- mtvec register
- mvendorid register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection address register
- Physical memory protection configuration pmpcfg0 struct contains pmp0cfg - pmp3cfg for RV32, and pmp0cfg - pmp7cfg for RV64
- Physical memory protection configuration pmpcfg1 struct contains pmp4cfg - pmp7cfg for RV32 only
- Physical memory protection configuration pmpcfg2 struct contains pmp8cfg - pmp11cfg for RV32, or pmp8cfg - pmp15cfg for RV64
- Physical memory protection configuration pmpcfg3 struct contains pmp12cfg - pmp15cfg for RV32 only
- satp register
- scause register
- scounteren register
- sepc register
- sie register
- sip register
- sscratch register
- sstatus register
- stval register
- stvec register
- time register
- timeh register
Structs§
- Pmp struct holds a high-level representation of a single pmp configuration
Enums§
- Permission enum contains all possible permission modes for pmp registers
- Range enum contains all possible addressing modes for pmp registers