Webcentive RISC-V Reference

mcause

Machine trap cause

Address
0x342
Group
Machine-level CSRs
Privilege
MRW (privileged spec CSR listing, Machine Trap Handling)
Access
read/write; lowest privilege M (machine)
Address range
Standard read/write
Name in riscv-unified-db
Machine Cause

Privileged spec: Machine trap cause

Description

Reports the cause of the latest exception.

From riscv-unified-db, reformatted.

Fields

FieldBitsTypeDescription
INTRV32 31 / RV64 63RW-RH

Written 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.

CODERV32 30-0 / RV64 62-0RW-RH

Fields from riscv-unified-db; field types computed by IDL functions there are not shown.

Specification and related pages