mscratch
Machine scratch register
- Address
0x340- Group
- Machine-level CSRs
- Privilege
MRW(privileged spec CSR listing, Machine Trap Handling)- Access
- read/write; lowest privilege M (machine)
- Address range
- Standard read/write
- Name in riscv-unified-db
- Machine Scratch Register
Privileged spec: Machine scratch register
Description
Scratch register for software use. Bits are not interpreted by hardware.
From riscv-unified-db, reformatted.
Fields
| Field | Bits | Type | Description |
|---|---|---|---|
SCRATCH | RV32 31-0 / RV64 63-0 | RW | Scratch value |
Fields from riscv-unified-db; field types computed by IDL functions there are not shown.
Specification and related pages
- The RISC-V Instruction Set Manual, Volume II: CSR listing (src/priv/csrs.adoc)
- riscv-opcodes csrs.csv
- riscv-unified-db: spec/std/isa/csr/mscratch.yaml
- csrrw, csrrs, csrrc (Zicsr instructions that access CSRs)