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

mncause

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

Summary

The mncause CSR holds the reason for the NMI. If the reason is an interrupt, bit MXLEN-1 is set to 1, and the NMI cause is encoded in the least-significant bits. If the reason is an interrupt and NMI causes are not supported, bit MXLEN-1 is set to 1, and zero is written to the least-significant bits. If the reason is an exception within M-mode that results in a double trap as specified in the Smdbltrp extension, bit…

Syntax / Encoding

CSR 0x742 (M-mode, RW)

Bitfields (2)

BitsFieldDescription
63INTWritten by hardware when a resumable NMI is taken into M-mode. When set, the last non-maskable exception was caused by an asynchronous Interrupt. [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. [w
62:0CODETODO [RV32: 30:0, RV64: 62:0]

Reference Notes

The mncause CSR holds the reason for the NMI.
If the reason is an interrupt, bit MXLEN-1 is set to 1, and the NMI cause is encoded in
the least-significant bits.
If the reason is an interrupt and NMI causes are not supported,
bit MXLEN-1 is set to 1, and zero is written to the least-significant bits.
If the reason is an exception within M-mode that results in a double trap as
specified in the Smdbltrp extension, bit MXLEN-1 is set to 0 and the least-significant
bits are set to the cause code corresponding to the exception that precipitated the
double trap.