CSR Bit Fields

RISC-V sctrstatus CSR Register

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

sctrstatus (0x14F) is the 32-bit Supervisor CTR status CSR, holding CTR write-pointer and freeze state and updated by hardware when CTR is active.

Field Map

Understand sctrstatus By Bit Fields

1 key fields
31:0

CTR_STATUS

RW / hardware-updated

Contains CTR status fields such as WRPTR and FROZEN; undefined bits are WPRI. Interpret concrete positions from the Smctr register figure.

CTR_STATUS (bits 31:0) — Contains CTR status fields such as WRPTR and FROZEN; undefined bits are WPRI. Interpret concrete positions from the Smctr register figure.

What This Field Controls

  • - Contains CTR status fields such as WRPTR and FROZEN; undefined bits are WPRI. Interpret concrete positions from the Smctr register figure.

Common Values

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

Open Official Manual
Official Basis & Search Notes

sctrstatus is the runtime-status entry point for the CTR buffer. It is hardware-updated, so writes are riskier than ordinary configuration CSR writes.

WRPTR indicates the physical CTR buffer entry to be written next and changes as records are made.
FROZEN inhibits transfer recording.
Logical entry 0 corresponds to the physical entry preceding WRPTR; logical/physical mapping depends on sctrdepth.

What To Check First When Reading This CSR

  • - First confirm that the hart implements the extension containing sctrstatus; unimplemented or insufficiently privileged CSR accesses raise an illegal-instruction exception.
  • - Use address 0x14F, 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

  • - Hardware updates sctrstatus while CTR is active; multi-instruction read-modify-write can lose a hardware update.
  • - Before modifying sctrstatus, software should normally ensure CTR is inactive, for example FROZEN=1 or current privilege mode not enabled for recording.
  • - When restoring CTR state, write sctrstatus before restoring CTR entry state.

Put It Back Into A Real Flow

1

Read sctrstatus before reading CTR entries to determine buffer state such as WRPTR/FROZEN.

2

Make CTR inactive before modifying sctrstatus so hardware-updated state is not overwritten.

3

When saving/restoring CTR, restore sctrstatus before restoring concrete CTR entry state.

FAQ

Why stop CTR before writing sctrstatus?

Because hardware may update WRPTR/FROZEN while CTR is active, and a multi-instruction RMW can overwrite a hardware update.