CSR Bit Fields

RISC-V tcontrol CSR Register

Address 0x7A5Privilege Machine/DebugAccess RW / XLENDebug, trace, and trigger CSRs

tcontrol at 0x7A5 is an optional trigger-control CSR holding the M-mode trigger enable and its saved pre-M-mode-trap value.

Field Map

Understand tcontrol By Bit Fields

3 key fields
XLEN-1:8, 6:4, 2:0

Reserved

RO zero

Reserved bits that read as zero.

Reserved (bits XLEN-1:8, 6:4, 2:0) — Reserved bits that read as zero.

What This Field Controls

  • - Reserved bits that read as zero.

Common Values

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

Open Official Manual
7

mpte

WARL

M-mode previous trigger enable; every trap into M-mode sets it to the previous value of mte.

mpte (bit 7) — M-mode previous trigger enable; every trap into M-mode sets it to the previous value of mte.

What This Field Controls

  • - M-mode previous trigger enable; every trap into M-mode sets it to the previous value of mte.

Common Values

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

Open Official Manual
3

mte

WARL

M-mode trigger enable: 0 prevents action=0 triggers from matching/firing, and 1 allows them. It clears on a trap into M-mode and is restored from mpte on MRET.

mte (bit 3) — M-mode trigger enable: 0 prevents action=0 triggers from matching/firing, and 1 allows them. It clears on a trap into M-mode and is restored from mpte on MRET.

What This Field Controls

  • - M-mode trigger enable: 0 prevents action=0 triggers from matching/firing, and 1 allows them. It clears on a trap into M-mode and is restored from mpte on MRET.

Common Values

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

Open Official Manual

What To Check First When Reading This CSR

  • - First confirm that the current hart implements tcontrol; unimplemented or insufficiently privileged accesses raise an illegal-instruction exception.
  • - Use address 0x7A5 and the lowest access privilege (Machine/Debug) to decide whether software may read it directly.
  • - Do not assume fixed values for reserved, WARL, or WLRL bits; interpret the value according to the specification and implementation.

Risk Checks Before Writing

  • - Preserve bits that are not being changed so reserved or implementation-defined fields are not written with invalid values.
  • - Prefer CSRRS/CSRRC for local set/clear operations to avoid CSRRW overwriting concurrently updated status bits.

Put It Back Into A Real Flow

1

During initialization or the relevant privileged flow, software reads tcontrol to observe the current state.

2

Modify only the target fields while preserving all other bits.

3

Read back the CSR or validate through later trap, interrupt, or context-switch behavior that the setting took effect.