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

mtinst

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

Summary

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.

Syntax / Encoding

CSR 0x34a (M-mode, RW)

Bitfields (1)

BitsFieldDescription
63:0VALUEException-specific information for a trap into M-mode. [RV32: 31:0, RV64: 63:0]

Reference Notes

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.