vsireg2

Virtual Supervisor Indirect Register Alias 2

The vsireg2 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 vsireg2 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 vsireg2, or from VU-mode to access siselect or siregX.

The behavior of accesses to vsireg2 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 vsireg2.

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

Attributes

CSR Address

0x252

Virtual CSR Address

0x252

Defining extension

Length

64-bit

Privilege Mode

VS

Format

vsireg2 format
Figure 1. vsireg2 format

Field Summary

Name Location Type Reset Value

VALUE

63:0

RW

UNDEFINED_LEGAL

Fields

VALUE

Location

vsireg2[63:0]

Description

Data read or written based on the currently selected vsiselect 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::VS, CSR[vsiselect].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::VS, CSR[vsiselect].VALUE, 2);
if (!handle.valid) {
  unimplemented_csr($encoding);
}
return csr_sw_read(handle);
Csr handle = indirect_csr_lookup(PrivilegeMode::VS, CSR[vsiselect].VALUE, 2);
if (!handle.valid) {
  unimplemented_csr($encoding);
}
return csr_sw_read(handle);