IDT MIPS32 4Kc Processor Core
Exceptions
79RC32438 User Reference Manual
2 - 44
November 4, 2002
Notes
Watch Exception — Instruction Fetch or Data Access
The Watch facility provides a software debugging vehicle by initiating a watch exception when an
instruction or data reference matches the address information stored in the WatchHi and WatchLo registers.
A Watch exception is taken immediately if the EXL and ERL bits of the Status register are both zero and the
DM bit of the Debug is also zero. If any of those bits is a one at the time that a watch exception would
normally be taken, the WP bit in the Cause register is set, and the exception is deferred until both all three
bits are zero. Software may use the WP bit in the Cause register to determine if the EPC register points at
the instruction that caused the watch exception, or if the exception actually occurred while in kernel mode.
The Watch exception can occur on either an instruction fetch or a data access. Watch exceptions that
occur on an instruction fetch have a higher priority than watch exceptions that occur on a data access.
Register ExcCode Value:
WATCH
Additional State Saved:
Entry Vector Used:
General exception vector (offset 0x180)
Address Error Exception — Instruction Fetch/Data Access
An address error exception occurs on an instruction or data access when an attempt is made to execute
one of the following:
Fetch an instruction, load a word, or store a word that is not aligned on a word boundary
Load or store a halfword that is not aligned on a halfword boundary
Reference the kernel address space from user mode.
Note that in the case of an instruction fetch that is not aligned on a word boundary, PC is updated before
the condition is detected. Therefore, both EPC and BadVAddr point to the unaligned instruction address. In
the case of a data access the exception is taken if either an unaligned address or an address that was inac-
cessible in the current processor mode was referenced by a load or store instruction.
Cause Register ExcCode Value:
ADEL: Reference was a load or an instruction fetch
ADES: Reference was a store
Additional State Saved:
Register State
Value
Cause
WP
Indicates that the watch exception was deferred until after
Status
EXL
, Status
ERL
, and Debug
DM
were zero. This bit
directly causes a watch exception, so software must clear
this bit as part of the exception handler to prevent a watch
exception loop at the end of the current handler execution.
Table 2.20 Register States on a Watch Exception
Register State
Value
BadVAddr
Failing address
Context
VPN2
UNPREDICTABLE
Table 2.21 CP0 Register States on an Address Exception Error (Part 1 of 2)