CSR Bit Fields

RISC-V dscratch0 CSR Register

Address 0x7B2Privilege Debug mode onlyAccess RW / XLENDebug, trace, and trigger CSRs

dscratch0 at 0x7B2 is Debug scratch register 0 for temporary debug-mode context.

Field Map

Understand dscratch0 By Bit Fields

1 key fields
XLEN-1:0

VALUE

RW

Full register value of dscratch0; bits not split out here follow the relevant extension or privileged specification, and reserved or WPRI fields should be preserved when writing other fields and ignored on reads.

VALUE (bits XLEN-1:0) — Full register value of dscratch0; bits not split out here follow the relevant extension or privileged specification, and reserved or WPRI fields should be preserved when writing other fields and ignored on reads.

What This Field Controls

  • - Full register value of dscratch0; bits not split out here follow the relevant extension or privileged specification, and reserved or WPRI fields should be preserved when writing other fields and ignored on reads.

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 and debug implementation provide dscratch0.
  • - dscratch0 is in the 0x7B0-0x7BF Debug-mode-only CSR range; ordinary M-mode software must not treat it as a directly accessible Machine CSR.
  • - Access it only in Debug mode or in a context defined by the Debug Specification, and interpret fields according to the debug spec 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

After entering Debug mode, read dscratch0 according to the Debug Specification.

2

Modify only target debug fields and preserve unchanged or implementation-defined fields.

3

Validate the setting through resume, single-step, or debug-module behavior.