vsscratch
Virtual supervisor scratch register
- Address
0x240- Group
- Hypervisor and VS CSRs
- Privilege
HRW(privileged spec CSR listing, Virtual Supervisor Registers)- Access
- read/write; lowest privilege H (hypervisor, including VS CSRs)
- Address range
- Standard read/write
- Name in riscv-unified-db
- Virtual Supervisor Scratch Register
Privileged spec: Virtual supervisor scratch register
Description
The vsscratch register is a VSXLEN-bit read/write register that is VS-mode’s version of supervisor register sscratch. When V=1, vsscratch substitutes for the usual sscratch, so instructions that normally read or modify sscratch actually access vsscratch instead. The contents of vsscratch never directly affect the behavior of the machine.
From riscv-unified-db, reformatted.
Fields
| Field | Bits | Type | Description |
|---|---|---|---|
SCRATCH | RV32 31-0 / RV64 63-0 | RW | Virtual supervisor scratch register. |
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/H/vsscratch.yaml
- csrrw, csrrs, csrrc (Zicsr instructions that access CSRs)