← Home

mcause

Machine Cause

Address: 0x342 (834) · Privilege: M · Length: MXLEN · Writable · Defined by: Sm

Reports the cause of the latest exception.

Fields

RV32

31:2423:1615:87:0
INTCODE

RV64

63:5655:4847:4039:3231:2423:1615:87:0
INTCODE
BitsFieldAliasDescriptionTypeReset
RV32 [31]
RV64 [63]
INTWritten by hardware when a trap is taken into M-mode. When set, the last exception was caused by an asynchronous Interrupt. `mcause.INT` is writable. If `mcause` is written with an undefined cause (combination of `mcause.INT` and `mcause.CODE`), an `Illegal Instruction` exception occurs. If `mcause` is written with an undefined cause (combination of `mcause.INT` and `mcause.CODE`), neither `mcause.INT` nor `mcause.CODE` are modified.RW-RH0
RV32 [30:0]
RV64 [62:0]
CODEWritten by hardware when a trap is taken into M-mode. Holds the interrupt or exception code for the last taken trap. `mcause.CODE` is writable. If `mcause` is written with an undefined cause (combination of `mcause.INT` and `mcause.CODE`), an `Illegal Instruction` exception occurs. If `mcause` is written with an undefined cause (combination of `mcause.INT` and `mcause.CODE`), neither `mcause.INT` nor `mcause.CODE` are modified. Valid interrupt codes are: ! ! Valid exception codes are: ! ! RW-RH0

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.