Specifications

Cache and Tightly-Coupled Memory
Use a Separate Exception Stack
The HAL implements two types of separate exception stack. Their availability depends on the interrupt
controller, as described in this section. The "Separate Exception Stack Usage" table (Table 8-3) outlines
the availability of separate exception stacks, and how they can be used with each type of interrupt
controller.
Note: Using a separate exception stack entails a slight additional overhead. When processing a software
exception or hardware interrupt, the processor must execute an additional instruction on entry and
exit, to change the stack pointer. Take this additional processing time into account if your interrupt
response requirements are extremely strict.
Separate General Exception Stack
The separate general exception stack is available with either the internal or the external interrupt
controller.
Use the hal.linker.enable_exception_stack BSP setting to enable a separate general exception stack.
The HAL general exception funnel code takes care of correctly changing the stack pointer on entry to and
exit from an exception handler.
Separate Hardware Interrupt Stack
The separate hardware interrupt stack is available with the EIC interface. The separate hardware interrupt
stack is not applicable to the IIC. With the IIC, hardware interrupts and software exceptions use the same
stack.The following BSP settings enable you to control the separate hardware interrupt stack:
hal.linker.enable_interrupt_stack enables a separate hardware interrupt stack.
hal.linker.interrupt_stack_size controls the size of the hardware interrupt stack.
hal.linker.interrupt_stack_memory_region_name enables you to control where the hardware
interrupt stack is positioned in memory.
The HAL funnel code takes care of correctly changing the stack pointer on entry to and exit from an ISR.
NII5V2
2015.05.14
Use a Separate Exception Stack
8-19
Exception Handling
Altera Corporation
Send Feedback