hideleg

Hypervisor Interrupt Delegation Register

Register hideleg is an HSXLEN-bit read/write register. By default, all traps at any privilege level are handled in M-mode, though M-mode usually uses the medeleg and mideleg CSRs to delegate some traps to HS-mode. The hedeleg and hideleg CSRs allow these traps to be further delegated to a VS-mode guest; their layout is the same as medeleg and mideleg. An interrupt that has been delegated to HS-mode (using mideleg) is further delegated to VS-mode if the corresponding hideleg bit is set. Among bits 15:0 of hideleg, bits 10, 6, and 2 (corresponding to the standard VS-level interrupts) are writable, and bits 12, 9, 5, and 1 (corresponding to the standard S-level interrupts) are read-only zeros.

Attributes

CSR Address

0x603

Defining extension

H

Length

64-bit

Privilege Mode

S

Format

hideleg format
Figure 1. hideleg format

Field Summary

Name Location Type Reset Value

SSI

1

RO

0

VSSI

2

RW

UNDEFINED_LEGAL

STI

5

RO

0

VSTI

6

RW

UNDEFINED_LEGAL

SEI

9

RO

0

VSEI

10

RW

UNDEFINED_LEGAL

SGEI

12

RO

0

LCOFI

13

RW

UNDEFINED_LEGAL

Fields

SSI

Location

hideleg[1]

Description

Supervisor Software Interrupt

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

VSSI

Location

hideleg[2]

Description

Virtual Supervisor Software Interrupt

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 (csr_value.VSSI == 0) {
  CSR[vsip].SSIP = 0;
  CSR[vsie].SSIE = 0;
}
return csr_value.VSSI;

STI

Location

hideleg[5]

Description

Supervisor Timer Interrupt

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

VSTI

Location

hideleg[6]

Description

Virtual Supervisor Timer Interrupt

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 (csr_value.VSTI == 0) {
  CSR[vsip].STIP = 0;
  CSR[vsie].STIE = 0;
}
return csr_value.VSTI;

SEI

Location

hideleg[9]

Description

Supervisor External Interrupt

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

VSEI

Location

hideleg[10]

Description

Virtual Supervisor External Interrupt

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 (csr_value.VSEI == 0) {
  CSR[vsip].SEIP = 0;
  CSR[vsie].SEIE = 0;
}
return csr_value.VSEI;

SGEI

Location

hideleg[12]

Description

Supervisor Guest External Interrupt

Type

RO

Read-Only

Field has a hardwired value that does not change. Writes to an RO field are ignored.

Reset value

0

LCOFI

Location

hideleg[13]

Description

Local-Counter-Overfloat Interrupt

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 (CSR[mideleg].LCOFI == 0) {
  return 0;
}
if (csr_value.LCOFI == 0) {
  CSR[vsip].LCOFIP = 0;
  CSR[vsie].LCOFIE = 0;
}
return csr_value.LCOFI;

Software read

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

  • Pruned

  • Original

XReg mask = 1'1;
return $bits(CSR[CSR[hideleg]]) & 64'1;
XReg mask = CSR[mideleg].VSSI | CSR[mideleg].VSTI | CSR[mideleg].VSEI | CSR[mideleg].LCOFI;
return $bits(CSR[CSR[hideleg]]) & mask;