← Home

stvec

Supervisor Trap Vector

Address: 0x105 (261) · Privilege: S · Length: SXLEN · Writable · Defined by: S

Controls where traps jump.

Fields

RV32

31:2423:1615:87:0
BASEMODE

RV64

63:5655:4847:4039:3231:2423:1615:87:0
BASEMODE
BitsFieldAliasDescriptionTypeReset
RV32 [31:2]
RV64 [63:2]
BASE Bits [SXLEN-1:2] of the virtual address of the exception vector for any trap taken into S-mode. If the base address is written with a non-canonical address (_i.e._, bits [SXLEN-1:] do not match bit ), the write should be ignored. When `stvec.MODE` is Vectored, the address must be aligned to `STVEC_BASE_ALIGNMENT_VECTORED` bytes. A misaligned write leaves an unspecified legal value in the field.RW-RUNDEFINED_LEGAL
[1:0]MODEVectoring mode for asynchronous interrupts. 0 - Direct, 1 - Vectored When Direct, all synchronous exceptions and asynchronous interrupts jump to (`stvec.BASE` << 2). When Vectored, asynchronous interrupts jump to (`stvec.BASE` << 2 + `scause.CODE`*4) while synchronous exceptions continue to jump to (`stvec.BASE` << 2).
return ($array_size(STVEC_MODES) == 1) ? CsrFieldType::RO : CsrFieldType::RWR;
return ($array_size(STVEC_MODES) == 1) ? STVEC_MODES[0] : UNDEFINED_LEGAL;

Version af3eaf9+cheriot.f635218

Data from the RISC-V Unified Database, copyright RISC-V International and contributors.

CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.

This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.