mtinst
Machine trap instruction (transformed)
- Address
0x34A- 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 Trap Instruction Register
Privileged spec: Machine trap instruction (transformed)
Description
When a trap is taken into M-mode, mtinst is written with a value that, if nonzero, provides information about the instruction that trapped, to assist software in handling the trap. The values that may be written to mtinst on a trap are documented in TODO.
mtinst is a WARL register that need only be able to hold the values that the implementation may automatically write to it on a trap.
From riscv-unified-db, reformatted.
Fields
| Field | Bits | Type | Description |
|---|---|---|---|
VALUE | RV32 31-0 / RV64 63-0 | Exception-specific information for a trap into M-mode. |
Fields from riscv-unified-db; field types computed by IDL functions there are not shown.
Specification and related pages
- The RISC-V Instruction Set Manual, Volume II: CSR listing (src/priv/csrs.adoc)
- riscv-opcodes csrs.csv
- riscv-unified-db: spec/std/isa/csr/H/mtinst.yaml
- csrrw, csrrs, csrrc (Zicsr instructions that access CSRs)