Specifications

With an EIC, the general exception funnel handles only software exceptions. An IRQ causes the processor
to transfer control to one of the interrupt funnels, which branches directly to the ISR.
Related Information
Hardware Interrupt Funnel on page 8-26
General Exception Funnel
The general exception funnel provided with the HAL is located at the Nios II processor’s exception
address. When a software exception or internal hardware interrupt occurs, and control transfers to the
general exception funnel, it does the following:
Switches to the separate exception stack (if enabled)
Stores register values onto the stack
Determines the type of exception, and passes control to the software exception funnel or the hardware
interrupt funnel
Hardware Interrupt Dispatch with the Internal Interrupt Controller
With the IIC, the general exception funnel dispatches hardware interrupts as well as software exceptions.
The general exception funnel looks at the estatus register to determine the interrupt enable status. If the
PIE bit is set, hardware interrupts were enabled at the time the exception happened. If so, the general
exception funnel transfers control to the hardware interrupt funnel. The hardware interrupt funnel looks
at the IRQ bits in ipending. If any IRQs are asserted, the interrupt funnel calls the appropriate hardware
interrupt handler.
If hardware interrupts are not enabled at the time of the exception, it is not necessary to look at ipending.
If no IRQs are active, there is no hardware interrupt, and the exception is a software exception. In this
case, the general exception funnel calls the software exception funnel.
All hardware interrupts are higher priority than software exceptions.
Note:
With an EIC, IRQs are dispatched by hardware. The HAL general exception funnel only handles
software exceptions.
For more information about the Nios II processor estatus and ipending registers, refer to the "Program‐
ming Model" chapter of the Nios II Processor Reference Handbook.
Related Information
Programming Model
Returning from Exceptions
After returning from the ISR or software exception handler, the general exception funnel performs the
following tasks:
Restores the stack pointer, if a separate exception stack is used
Restores the registers from the stack
Exits by issuing an eret (exception return) instruction
Hardware Interrupt Funnel
The configuration of the HAL hardware interrupt funnel depends on the interrupt controller
implemented in the Nios II processor core.
8-26
General Exception Funnel
NII5V2
2015.05.14
Altera Corporation
Exception Handling
Send Feedback