vsireg4

Virtual Supervisor Indirect Register Alias 4

The vsireg4 CSR is one of several alias registers used to indirectly access virtual supervisor-level CSRs in VS-mode or VU-mode.

The register addressed by vsireg4 is selected by the current value of the vsiselect CSR.

The alias mechanism allows indirect CSR access, which helps in virtualization and future extensibility.

A virtual instruction exception is raised for attempts from VS-mode or VU-mode to directly access vsiselect or vsireg4, or from VU-mode to access siselect or siregX.

The behavior of accesses to vsireg4 when vsiselect holds a value that is not implemented at the HS level is UNSPECIFIED.

Implementations are recommended to raise an illegal instruction exception for accesses to unimplemented targets via vsireg4.

The width of vsireg4 is always the current XLEN, not VSXLEN. For example, if HSXLEN = 64 and VSXLEN = 32, then vsireg4 is 64 bits wide when accessed from HS-mode (RV64), but 32 bits when accessed from VS-mode (RV32).

Attributes

Defining Extension

  • Smcsrind, version >= Smcsrind@1.0.0

CSR Address

0x255

Virtual CSR Address

0x255

Length

32 when CSR[hstatus].VSXL == 0 64 when CSR[hstatus].VSXL == 1

Privilege Mode

VS

Format

This CSR format changes dynamically.

vsireg4 Format when CSR[hstatus].VSXL == 0
Figure 1. vsireg4 Format when CSR[hstatus].VSXL == 0
vsireg4 Format when CSR[hstatus].VSXL == 1
Figure 2. vsireg4 Format when CSR[hstatus].VSXL == 1

Field Summary

Name Location Type Reset Value

vsireg4.VALUE

* 31:0 when CSR[hstatus].VSXL == 0 * 63:0 when CSR[hstatus].VSXL == 1

RW

UNDEFINED_LEGAL

Fields

VALUE

Location
  • 31:0 when CSR[hstatus].VSXL == 0

  • 63:0 when CSR[hstatus].VSXL == 1

Description

The data read or written based on the currently selected vsiselect value.

Type

RW

Reset value

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[vsiselect].VALUE, 4);
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(vsiselect.VALUE, 4);
if (!handle.valid) {
  unimplemented_csr($encoding);
}
return csr_sw_read(handle);