sireg2
Supervisor Indirect Register Alias 2
Access to sireg2 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 sireg2, is defined by the extension to which the siselect value is allocated.
Ordinarily, sireg2 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 sireg2 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 sireg2 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.
Fields
VALUE
- Location
-
sireg2[63:0] - Description
-
The data read from or written to the register selected by the current siselect value.
- Type
RW |
Read-Write Field is writable by software. Any value that fits in the field is acceptable and shall be retained for subsequent reads. |
- Reset value
-
UNDEFINED_LEGAL
- Software write
-
This field has special behavior when written by software (e.g., through csrrw).
When software tries to write
csr_value, the field will be written with the return value of the function below.Csr handle = indirect_csr_lookup(PrivilegeMode::S, CSR[siselect].VALUE, 2); 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.
-
Pruned
-
Original
Csr handle = indirect_csr_lookup(PrivilegeMode::S, CSR[siselect].VALUE, 2);
if (!handle.valid) {
unimplemented_csr($encoding);
}
return csr_sw_read(handle);
Csr handle = indirect_csr_lookup(PrivilegeMode::S, CSR[siselect].VALUE, 2);
if (!handle.valid) {
unimplemented_csr($encoding);
}
return csr_sw_read(handle);