CSR Bit Fields

RISC-V vsscratch CSR Register

Address 0x240Privilege Hypervisor direct / VS aliasAccess HRW / VSXLENHypervisor and virtualization CSRs

vsscratch is the VSXLEN-bit virtual supervisor scratch CSR; when V=1 it substitutes for sscratch, and its contents never directly affect machine behavior.

Field Map

Understand vsscratch By Bit Fields

1 key fields
VSXLEN-1:0

SCRATCH

RW

Complete VSXLEN scratch value; the privileged architecture defines no internal bit fields, and the contents do not directly affect machine behavior.

SCRATCH (bits VSXLEN-1:0) — Complete VSXLEN scratch value; the privileged architecture defines no internal bit fields, and the contents do not directly affect machine behavior.

What This Field Controls

  • - Complete VSXLEN scratch value; the privileged architecture defines no internal bit fields, and the contents do not directly affect machine 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

vsscratch is the VS-mode copy of sscratch and stores a complete VSXLEN software scratch value; its contents do not directly affect machine behavior.

vsscratch address, access class, and width are checked against the local privileged manual: 0x240, HRW, VSXLEN.
When V=1, guest access to sscratch is substituted with vsscratch.
The privileged architecture defines no internal bit fields for vsscratch; software conventions interpret its contents.

What To Check First When Reading This CSR

  • - vsscratch is an H-extension VSXLEN-bit HRW CSR and is the VS copy of sscratch.
  • - Its contents do not directly affect machine behavior; interpretation is entirely software-defined.

Risk Checks Before Writing

  • - vsscratch has no WPRI/WARL subfields; read or write it as a complete VSXLEN scratch value.

Put It Back Into A Real Flow

1

M/HS software may access the VS copy through the separate CSR address.

2

When V=1, guest access to the corresponding supervisor CSR aliases to VS state; direct access to the separate VS CSR address raises a virtual-instruction exception.

3

Update only official fields and do not treat VS state as ordinary HS supervisor state.

FAQ

Can VS-mode directly access vsscratch's separate CSR address?

No. The H extension substitutes VS state for the corresponding supervisor CSR when V=1; direct access to the separate VS CSR address raises a virtual-instruction exception.

What does vsscratch mainly hold?

vsscratch holds a software scratch value for a guest trap handler; its contents do not directly affect machine behavior.