sireg3
Supervisor Indirect Register Alias 3
Access to sireg3 from M-mode or S-mode while siselect holds a number in a standard-defined and implemented range results in specific behavior that, for each combination of siselect and sireg3, is defined by the extension to which the siselect value is allocated.
Ordinarily, sireg3 will access register state, access read-only 0 state, or, unless executing in a virtual machine (covered in the next section), raise an illegal instruction exception.
Note that the widths of siselect and sireg3 are always the current XLEN rather than SXLEN. Hence, for example, if MXLEN = 64 and SXLEN = 32, then this register is 64 bits when the current privilege mode is M (running RV64 code) but 32 bits when the privilege mode is S (RV32 code).
The behavior upon accessing sireg3 from M-mode or S-mode, while siselect holds a value that is not implemented at supervisor level, is UNSPECIFIED.
It is recommended that implementations raise an illegal instruction exception for such accesses, to facilitate possible emulation (by M-mode) of these accesses.
An extension is considered not to be implemented at supervisor level if machine level has disabled the extension for S-mode, such as by the settings of certain fields in CSR menvcfg, for example.
Attributes
Defining Extension |
|
---|---|
CSR Address |
0x153 |
Length |
32 when CSR[mstatus].SXL == 0 64 when CSR[mstatus].SXL == 1 |
Privilege Mode |
S |
Format
This CSR format changes dynamically.
Field Summary
Name | Location | Type | Reset Value |
---|---|---|---|
* 31:0 when CSR[mstatus].SXL == 0 * 63:0 when CSR[mstatus].SXL == 1 |
RW |
UNDEFINED_LEGAL |
Software write
This CSR may store a value that is different from what software attempts to write.
When a software write occurs (e.g., through csrrw), the following determines the written value:
VALUE = Csr handle = indirect_csr_lookup(CSR[siselect].VALUE, 3); if (!handle.valid) { unimplemented_csr($encoding); } if (!handle.writable) { raise (ExceptionCode::IllegalInstruction, mode(), $encoding); } csr_sw_write(handle, csr_value.VALUE); return csr_hw_read(handle);
Software read
This CSR may return a value that is different from what is stored in hardware.
Csr handle = indirect_csr_lookup(siselect.VALUE, 3);
if (!handle.valid) {
unimplemented_csr($encoding);
}
return csr_sw_read(handle);