CSR Bit Fields

RISC-V sctrctl CSR Register

Address 0x14EPrivilege SupervisorAccess RW / 64-bit; RV32 explicit access reaches only bits 31:0, with no sctrctlhSupervisor AIA, timer, and indirect interrupt CSRs

sctrctl (0x14E) is the Supervisor Control Transfer Records control CSR, providing S-mode access to a subset of the 64-bit mctrctl; RV32 cannot access xctrctl[63:32].

Field Map

Understand sctrctl By Bit Fields

27 key fields
0

U

RW

Selects transfer recording in U-mode. This field is accessible through sctrctl and is mandatory writable.

U (bit 0) — Selects transfer recording in U-mode. This field is accessible through sctrctl and is mandatory writable.

What This Field Controls

  • - Selects transfer recording in U-mode. This field is accessible through sctrctl and is mandatory writable.

Common Values

00

U-mode recording is not selected.

11

U-mode recording is selected.

Open Official Manual
1

S

RW

Selects transfer recording in S/HS-mode. This field is accessible through sctrctl and is mandatory writable.

S (bit 1) — Selects transfer recording in S/HS-mode. This field is accessible through sctrctl and is mandatory writable.

What This Field Controls

  • - Selects transfer recording in S/HS-mode. This field is accessible through sctrctl and is mandatory writable.

Common Values

00

S/HS-mode recording is not selected.

11

S/HS-mode recording is selected.

Open Official Manual
2

M

RO0

mctrctl.M is not accessible through sctrctl; sctrctl bit 2 is fixed at zero.

M (bit 2) — mctrctl.M is not accessible through sctrctl; sctrctl bit 2 is fixed at zero.

What This Field Controls

  • - mctrctl.M is not accessible through sctrctl; sctrctl bit 2 is fixed at zero.

Common Values

00

This bit is fixed at zero; the corresponding mctrctl field is not accessible through sctrctl.

Open Official Manual
6:3

WPRI

WPRI / RO0

Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

WPRI (bits 6:3) — Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

What This Field Controls

  • - Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

Common Values

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

Open Official Manual
7

RASEMU

RW if implemented; otherwise RO0

Enables Return Address Stack (RAS) emulation mode; when set, calls are recorded, returns pop entries, co-routine swaps act as a return plus call, other transfer types are inhibited, and bits 47:32 plus xTE are ignored.

RASEMU (bit 7) — Enables Return Address Stack (RAS) emulation mode; when set, calls are recorded, returns pop entries, co-routine swaps act as a return plus call, other transfer types are inhibited, and bits 47:32 plus xTE are ignored.

What This Field Controls

  • - Enables Return Address Stack (RAS) emulation mode; when set, calls are recorded, returns pop entries, co-routine swaps act as a return plus call, other transfer types are inhibited, and bits 47:32 plus xTE are ignored.

Common Values

00

Use normal CTR recording behavior.

11

Enable RAS-emulation recording behavior and ignore the transfer filters and external-trap enable bits.

Open Official Manual
8

STE

RW if implemented; otherwise RO0

When S=0, allows recording external traps to S-mode.

STE (bit 8) — When S=0, allows recording external traps to S-mode.

What This Field Controls

  • - When S=0, allows recording external traps to S-mode.

Common Values

00

Do not additionally permit recording external traps to S-mode.

11

Permit recording external traps to S-mode.

Open Official Manual
9

MTE

RO0

mctrctl.MTE is not accessible through sctrctl; sctrctl bit 9 is fixed at zero.

MTE (bit 9) — mctrctl.MTE is not accessible through sctrctl; sctrctl bit 9 is fixed at zero.

What This Field Controls

  • - mctrctl.MTE is not accessible through sctrctl; sctrctl bit 9 is fixed at zero.

Common Values

00

This bit is fixed at zero; the corresponding mctrctl field is not accessible through sctrctl.

Open Official Manual
10

WPRI

WPRI / RO0

Reserved. Software ignores reads and preserves this bit on writes; an undefined implementation is read-only zero.

WPRI (bit 10) — Reserved. Software ignores reads and preserves this bit on writes; an undefined implementation is read-only zero.

What This Field Controls

  • - Reserved. Software ignores reads and preserves this bit on writes; an undefined implementation is read-only zero.

Common Values

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

Open Official Manual
11

BPFRZ

RW

Sets sctrstatus.FROZEN when a breakpoint exception traps to M-mode or S-mode. This field is accessible through sctrctl and is mandatory writable.

BPFRZ (bit 11) — Sets sctrstatus.FROZEN when a breakpoint exception traps to M-mode or S-mode. This field is accessible through sctrctl and is mandatory writable.

What This Field Controls

  • - Sets sctrstatus.FROZEN when a breakpoint exception traps to M-mode or S-mode. This field is accessible through sctrctl and is mandatory writable.

Common Values

00

Breakpoint traps do not trigger this automatic freeze.

11

A qualifying breakpoint trap sets FROZEN.

Open Official Manual
12

LCOFIFRZ

RW if implemented; otherwise RO0

Sets sctrstatus.FROZEN when an LCOFI traps to M-mode or S-mode; it must be writable when Sscofpmf is implemented.

LCOFIFRZ (bit 12) — Sets sctrstatus.FROZEN when an LCOFI traps to M-mode or S-mode; it must be writable when Sscofpmf is implemented.

What This Field Controls

  • - Sets sctrstatus.FROZEN when an LCOFI traps to M-mode or S-mode; it must be writable when Sscofpmf is implemented.

Common Values

00

LCOFI traps do not trigger this automatic freeze.

11

A qualifying LCOFI trap sets FROZEN.

Open Official Manual
32:13

WPRI

WPRI / RO0

Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

WPRI (bits 32:13) — Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

What This Field Controls

  • - Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

Common Values

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

Open Official Manual
33

EXCINH

RW if implemented; otherwise RO0

Inhibits recording exceptions, except that it does not affect external-trap recording enabled through xTE.

EXCINH (bit 33) — Inhibits recording exceptions, except that it does not affect external-trap recording enabled through xTE.

What This Field Controls

  • - Inhibits recording exceptions, except that it does not affect external-trap recording enabled through xTE.

Common Values

00

Do not inhibit exception recording through this bit.

11

Inhibit exception recording; external traps enabled through xTE are unaffected by this bit.

Open Official Manual
34

INTRINH

RW if implemented; otherwise RO0

Inhibits recording interrupts, except that it does not affect external-trap recording enabled through xTE.

INTRINH (bit 34) — Inhibits recording interrupts, except that it does not affect external-trap recording enabled through xTE.

What This Field Controls

  • - Inhibits recording interrupts, except that it does not affect external-trap recording enabled through xTE.

Common Values

00

Do not inhibit interrupt recording through this bit.

11

Inhibit interrupt recording; external traps enabled through xTE are unaffected by this bit.

Open Official Manual
35

TRETINH

RW if implemented; otherwise RO0

Inhibits recording trap returns.

TRETINH (bit 35) — Inhibits recording trap returns.

What This Field Controls

  • - Inhibits recording trap returns.

Common Values

00

Do not inhibit trap-return recording through this bit.

11

Inhibit trap-return recording.

Open Official Manual
36

NTBREN

RW if implemented; otherwise RO0

Enables recording not-taken branches; this is an enable bit rather than an inhibit bit.

NTBREN (bit 36) — Enables recording not-taken branches; this is an enable bit rather than an inhibit bit.

What This Field Controls

  • - Enables recording not-taken branches; this is an enable bit rather than an inhibit bit.

Common Values

00

Do not record not-taken branches.

11

Record qualifying not-taken branches.

Open Official Manual
37

TKBRINH

RW if implemented; otherwise RO0

Inhibits recording taken branches.

TKBRINH (bit 37) — Inhibits recording taken branches.

What This Field Controls

  • - Inhibits recording taken branches.

Common Values

00

Do not inhibit taken-branch recording through this bit.

11

Inhibit taken-branch recording.

Open Official Manual
39:38

WPRI

WPRI / RO0

Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

WPRI (bits 39:38) — Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

What This Field Controls

  • - Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

Common Values

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

Open Official Manual
40

INDCALLINH

RW if implemented; otherwise RO0

Inhibits recording indirect calls.

INDCALLINH (bit 40) — Inhibits recording indirect calls.

What This Field Controls

  • - Inhibits recording indirect calls.

Common Values

00

Do not inhibit indirect-call recording through this bit.

11

Inhibit indirect-call recording.

Open Official Manual
41

DIRCALLINH

RW if implemented; otherwise RO0

Inhibits recording direct calls.

DIRCALLINH (bit 41) — Inhibits recording direct calls.

What This Field Controls

  • - Inhibits recording direct calls.

Common Values

00

Do not inhibit direct-call recording through this bit.

11

Inhibit direct-call recording.

Open Official Manual
42

INDJMPINH

RW if implemented; otherwise RO0

Inhibits recording indirect jumps without linkage.

INDJMPINH (bit 42) — Inhibits recording indirect jumps without linkage.

What This Field Controls

  • - Inhibits recording indirect jumps without linkage.

Common Values

00

Do not inhibit this jump class through this bit.

11

Inhibit indirect jumps without linkage.

Open Official Manual
43

DIRJMPINH

RW if implemented; otherwise RO0

Inhibits recording direct jumps without linkage.

DIRJMPINH (bit 43) — Inhibits recording direct jumps without linkage.

What This Field Controls

  • - Inhibits recording direct jumps without linkage.

Common Values

00

Do not inhibit this jump class through this bit.

11

Inhibit direct jumps without linkage.

Open Official Manual
44

CORSWAPINH

RW if implemented; otherwise RO0

Inhibits recording co-routine swaps.

CORSWAPINH (bit 44) — Inhibits recording co-routine swaps.

What This Field Controls

  • - Inhibits recording co-routine swaps.

Common Values

00

Do not inhibit co-routine-swap recording through this bit.

11

Inhibit co-routine-swap recording.

Open Official Manual
45

RETINH

RW if implemented; otherwise RO0

Inhibits recording function returns.

RETINH (bit 45) — Inhibits recording function returns.

What This Field Controls

  • - Inhibits recording function returns.

Common Values

00

Do not inhibit function-return recording through this bit.

11

Inhibit function-return recording.

Open Official Manual
46

INDLJMPINH

RW if implemented; otherwise RO0

Inhibits recording other indirect jumps with linkage.

INDLJMPINH (bit 46) — Inhibits recording other indirect jumps with linkage.

What This Field Controls

  • - Inhibits recording other indirect jumps with linkage.

Common Values

00

Do not inhibit this jump class through this bit.

11

Inhibit other indirect jumps with linkage.

Open Official Manual
47

DIRLJMPINH

RW if implemented; otherwise RO0

Inhibits recording other direct jumps with linkage.

DIRLJMPINH (bit 47) — Inhibits recording other direct jumps with linkage.

What This Field Controls

  • - Inhibits recording other direct jumps with linkage.

Common Values

00

Do not inhibit this jump class through this bit.

11

Inhibit other direct jumps with linkage.

Open Official Manual
59:48

WPRI

WPRI / RO0

Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

WPRI (bits 59:48) — Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

What This Field Controls

  • - Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

Common Values

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

Open Official Manual
63:60

Custom[3:0]

WARL; RO0 if unimplemented

WARL bits for custom use; value 0 must correspond to standard behavior.

Custom[3:0] (bits 63:60) — WARL bits for custom use; value 0 must correspond to standard behavior.

What This Field Controls

  • - WARL bits for custom use; value 0 must correspond to standard behavior.

Common Values

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

Open Official Manual
Official Basis & Search Notes

sctrctl is the S-mode view of the 64-bit CTR control register, but not a full mctrctl mirror: M and MTE are fixed read-only zero, and RV32 cannot explicitly access xctrctl[63:32].

Smctr/Ssctr depends on S-mode and Sscsrind and defines sctrctl as S-mode access to a subset of mctrctl.
Bits 2 and 9 are read-only zero, so M and MTE are not accessible through sctrctl.
S, U, and BPFRZ are mandatory; other accessible fields are optional and read-only zero when unimplemented.
Smctr explicitly says RV32 cannot access xctrctl[63:32]; a future extension may add sctrctlh.

What To Check First When Reading This CSR

  • - The official CSR table allocates sctrctl at 0x14E with SRW access.
  • - sctrctl provides S-mode access to a subset of the 64-bit mctrctl; bit 2 (M) and bit 9 (MTE) are fixed read-only zero.
  • - The register is 64-bit; RV32 explicit access reaches only the low 32 bits, and Smctr v1.0 defines no sctrctlh.
  • - Except for mandatory S, U, and BPFRZ, the accessible fields are optional; unimplemented fields are read-only zero.

Risk Checks Before Writing

  • - The M and MTE bits in sctrctl are read-only zero; do not use it to configure Machine-mode CTR enable or M-mode trap recording.
  • - Preserve every WPRI bit and modify only implemented fields that need to change.
  • - Any write to xctrctl resets the CTR cycle counter, so the next record has ctrdata.CCV=0.
  • - RV32 cannot explicitly modify bits 63:32; do not assume upper transfer filters or Custom fields are configurable.

Put It Back Into A Real Flow

1

Confirm Smctr/Ssctr is implemented and decide which control-transfer types should be recorded.

2

Use sctrctl to configure S/U-related recording, filtering, and freeze policy; do not try to access M, MTE, or RV32-inaccessible xctrctl[63:32] through it.

3

Use it together with sctrstatus and sctrdepth when reading or maintaining the CTR buffer.

FAQ

Is sctrctl an AIA interrupt CSR?

No. It belongs to Control Transfer Records (Smctr/Ssctr), controlling control-transfer recording.

Can RV32 access all 64 control bits through sctrctl?

No. Smctr explicitly says RV32 cannot access xctrctl[63:32]; there is currently no sctrctlh.