Machine Trap Vector Control
Controls where traps jump.
| 31:24 | 23:16 | 15:8 | 7:0 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| BASE | MODE | ||||||||||||||||||||||||||||||
| 63:56 | 55:48 | 47:40 | 39:32 | 31:24 | 23:16 | 15:8 | 7:0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| BASE | MODE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bits | Field | Alias | Description | Type | Reset |
|---|---|---|---|---|---|
| RV32 [31:2] RV64 [63:2] | BASE | Bits [MXLEN-1:2] of the exception vector physical address for any trap taken in M-mode. The implementation physical memory map may resitrict which values are legal in this field. The address must be aligned to `MTVEC_BASE_ALIGNMENT_DIRECT` bytes when `mtvec.MODE` is Direct, and to `MTVEC_BASE_ALIGNMENT_VECTORED` bytes when `mtvec.MODE` is Vectored. A write that does not meet the alignment for the new mode is illegal, and follows `MTVEC_ILLEGAL_WRITE_BEHAVIOR`. | return MTVEC_ACCESS == "ro" ? CsrFieldType::RO : CsrFieldType::RWR; | 0 | |
| [1:0] | MODE | Vectoring mode for asynchronous interrupts. 0 - Direct, 1 - Vectored When Direct, all synchronous exceptions and asynchronous interrupts jump to (`mtvec.BASE` << 2). When Vectored, asynchronous interrupts jump to (`mtvec.BASE` << 2 + `mcause.CODE`*4) while synchronous exceptions continue to jump to (`mtvec.BASE` << 2). | if (MTVEC_ACCESS == "ro") {
return CsrFieldType::RO;
}
return ($array_size(MTVEC_MODES) == 1) ? CsrFieldType::RO : CsrFieldType::RWR; | return ($array_size(MTVEC_MODES) == 1) ? MTVEC_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.