Webcentive RISC-V Reference

mireg

Machine indirect register alias

Address
0x351
Group
Machine-level CSRs
Privilege
MRW (privileged spec CSR listing, Machine Indirect)
Access
read/write; lowest privilege M (machine)
Address range
Standard read/write
Name in riscv-unified-db
Machine Indirect Register Alias

Privileged spec: Machine indirect register alias

Description

The mireg machine indirect alias CSR is used to access another CSR's state indirectly upon a read or write, as determined by the value of miselect.

The behavior upon accessing mireg from M-mode, while miselect holds a value that is not implemented, is UNSPECIFIED.

It is expected that implementations will typically raise an illegal instruction exception for such accesses, so that, for example, they can be identified as software bugs. Platform specs, profile specs, and/or the Privileged ISA spec may place more restrictions on behavior for such accesses.

Attempts to access mireg while miselect holds a number in an allocated and implemented range results in a specific behavior that, for each combination of miselect and mireg, is defined by the extension to which the miselect value is allocated.

Ordinarily, mireg will access register state, access read-only 0 state, or raise an illegal instruction exception.

For RV32, if an extension defines an indirectly accessed register as 64 bits wide, it is recommended that the lower 32 bits of the register are accessed through mireg, while the upper 32 bits are accessed through mireg4.

From riscv-unified-db, reformatted.

Fields

FieldBitsTypeDescription
VALUERV32 31-0 / RV64 63-0RWIndirectly Selected Register Value.

Register state of the CSR selected by the current miselect value

Fields from riscv-unified-db; field types computed by IDL functions there are not shown.

Specification and related pages