Machine Trap Value Register (mtval) - 2025.2 English - UG1629

MicroBlaze V Processor Reference Guide (UG1629)

Document ID
UG1629
Release Date
2025-11-20
Version
2025.2 English

The mtval register is a read/write register. When a trap is taken into M-mode, mtval is either set to zero or written with exception-specific information to assist software in handling the trap.

Table 1. Machine Trap Value Register Exception-Specific Information
Code Exception Description
0 Instruction address misaligned Set to the program counter of the misaligned access
1 Instruction access fault Set to the faulting virtual address

Exists when supervisor mode is enabled (C_USE_MMU > 1)

2 Illegal instruction Set to the instruction causing the exception
3 Breakpoint trap Set to the program counter of the breakpoint
4 Load address misaligned Set to the misaligned load address
5 Load access fault Set to the address causing the access fault
6 Store/AMO address misaligned Set to the misaligned store address
7 Store/AMO access fault Set to the address causing the access fault
12 Instruction page fault Set to the faulting virtual address

Exists when supervisor mode is enabled (C_USE_MMU > 1)

13 Load page fault Set to the faulting virtual address

Exists when supervisor mode is enabled (C_USE_MMU > 1)

15 Store/AMO page fault Set to the faulting virtual address

Exists when supervisor mode is enabled (C_USE_MMU > 1)

Other Other events Set to 0x00000000