CSR Bit Fields

RISC-V sctrdepth CSR Register

Address 0x15FPrivilege SupervisorAccess RW / 32Supervisor AIA, timer, and indirect interrupt CSRs

sctrdepth (0x15F) is the 32-bit Supervisor CTR depth CSR; its WARL DEPTH field selects the CTR buffer depth.

Field Map

Understand sctrdepth By Bit Fields

2 key fields
2:0

DEPTH

WARL

Selects CTR buffer depth: 000=16, 001=32, 010=64, 011=128, 100=256, 11x reserved; implementations may support only a subset.

DEPTH (bits 2:0) — Selects CTR buffer depth: 000=16, 001=32, 010=64, 011=128, 100=256, 11x reserved; implementations may support only a subset.

What This Field Controls

  • - Selects CTR buffer depth: 000=16, 001=32, 010=64, 011=128, 100=256, 11x reserved; implementations may support only a subset.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
31:3

WPRI

WPRI

Undefined bits are WPRI.

WPRI (bits 31:3) — Undefined bits are WPRI.

What This Field Controls

  • - Undefined bits are WPRI.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
Official Basis & Search Notes

sctrdepth determines the effective number of CTR buffer entries. Logical entries beyond the current depth read as zero and are read-only.

DEPTH is WARL; encodings 000..100 correspond to 16..256 entries.
When depth is increased, newly accessible entries contain unspecified but legal values.
The specification expects OSs to access it mostly at boot; frequent access can increase virtualization overhead.

What To Check First When Reading This CSR

  • - First confirm that the hart implements the extension containing sctrdepth; unimplemented or insufficiently privileged CSR accesses raise an illegal-instruction exception.
  • - Use address 0x15F, the lowest access privilege, and the official access class to decide whether software may access it directly.
  • - Do not assume fixed values for reserved, WPRI, WARL, or WLRL fields; interpret them according to the specification and implementation.

Risk Checks Before Writing

  • - Implementations may support only a subset of DEPTH encodings; read back after writing to confirm the actual value.
  • - VS/VU-mode accesses to sctrdepth raise a virtual-instruction exception unless state-enable access restrictions take precedence.

Put It Back Into A Real Flow

1

Choose the desired buffer depth during OS boot or CTR initialization.

2

After writing DEPTH, read it back to confirm the actual WARL value accepted.

3

Interpret logical CTR entries according to the actual depth; logical entries beyond the depth read as zero and are read-only.

FAQ

Does sctrdepth support every depth?

Not necessarily. DEPTH is WARL, and supported values are implementation-specific.