Specifications

Table Of Contents
3–12 Altera Corporation
Nios II Processor Reference Handbook October 2007
Exception Processing
Determining the Cause of Interrupt and Instruction-Related
Exceptions
The general exception handler must determine the cause of each
exception and then transfer control to an appropriate exception routine.
Figure 3–2 shows an example of the process used to determine the
exception source.
Figure 3–2. Process to Determine the Cause of an Exception
If the EPIE bit of the estatus register is one and the value of the
ipending register is non-zero, an external hardware interrupt caused
the exception. Otherwise, an instruction-related exception occurred. To
distinguish between software traps and unimplemented instructions,
read the instruction at address ea–4 (the Nios II data master must have
Enter
Exception Handler
(EPIE == 1)&(ipending != 0)?
Is Instruction at (ea-4) trap?
Is instruction at (ea-4)
div, mul, mulxuu, etc.?
Ye s
Ye s
Ye s
No
Process hardware
interrupt
Process
software trap
Process
unimplemented
instuction
No
Other exception
No