ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

vsepc

T1 riscv register register
Virtual Supervisor Exception Program Counter
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRISC-V Privileged (H)
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
PrivilegeVS
ExtensionsH

Summary

Written with the PC of an instruction on an exception or interrupt taken in VS-mode.

Syntax / Encoding

CSR 0x241 (VS-mode, RW)

Bitfields (1)

BitsFieldDescription
63:0PCWhen a trap is taken into VS-mode, vsepc.PC is written with the virtual address of the instruction that was interrupted or that encountered the exception. Otherwise, vsepc.PC is never written by the implementation, though it may be explicitly written by software. On an exception return from VS-mode (from the SRET inst