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

mcause

T1 riscv register register
Machine Cause
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRISC-V Privileged (Sm)
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
PrivilegeM
ExtensionsSm

Summary

Reports the cause of the latest exception.

Syntax / Encoding

CSR 0x342 (M-mode, RW)

Bitfields (2)

BitsFieldDescription
63INTWritten 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. [when,"TRAP_ON_ILLEGAL_WLRL == true"] If mcause is written with an undefined cause (combination of mcause.INT and mcause.CODE), an Illegal Instruction exception occurs.
62:0CODEWritten 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. [when,"TRAP_ON_ILLEGAL_WLRL == true"] If mcause is written with an undefined cause (combination of mcause.INT and mcause.CODE), an Illegal Instruction exception occurs. [when