vstimecmp

Virtual supervisor timer compare

Virtual supervisor timer compare register.

When menvcfg.STCE and henvcfg.STCE are set, vstimecmp is operational and provides VS-mode with a CSR-based timer interrupt facility.

Attributes

CSR Address

0x24d

Virtual CSR Address

0x14d

Defining extension

(H && Sstc)

Length

64-bit

Privilege Mode

VS

Format

vstimecmp format
Figure 1. vstimecmp format

Field Summary

Name Location Type Reset Value

TIME

63:0

RW

UNDEFINED_LEGAL

Fields

TIME

Location

vstimecmp[63:0]

Description

Time compare value for virtual supervisor timer interrupts.

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.

if (true) {
  raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
} else if (true) {
  raise(ExceptionCode::VirtualInstruction, mode(), $encoding);
}
return csr_value.TIME;

Software read

This CSR may return a value that is different from what is stored in hardware.

  • Pruned

  • Original

if (true) {
  raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
} else if (true) {
  raise(ExceptionCode::VirtualInstruction, mode(), $encoding);
}
return CSR[vstimecmp].TIME;
if (CSR[menvcfg].STCE == 1'b0 || CSR[mcounteren].TM == 1'b0) {
  raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
} else if (CSR[henvcfg].STCE == 1'b0 || CSR[hcounteren].TM == 1'b0) {
  raise(ExceptionCode::VirtualInstruction, mode(), $encoding);
}
return CSR[vstimecmp].TIME;