Specifications
Related Information
Managing Pre-Emption on page 8-12
Locate ISR Body in Vector Table
If you are using a vectored EIC, and you have a critical ISR of small size, you might achieve a performance
improvement by positioning the ISR code directly in the vector table. In this way, you eliminate the
overhead of branching from the vector table through the HAL funnel to your ISR.
The EIC’s driver provides a default vector table entry size. For example, with the Altera VIC, the default
size is 16 bytes. To accommodate your ISR, adjust the entry size with a driver setting when you create the
BSP.
Note: Positioning an ISR in a vector table is an advanced and error-prone technique, not directly
supported by the HAL. You must exercise great caution to ensure that the ISR code fits in the
vector table entry. If your ISR overflows the vector table entry, it corrupts other entries in the
vector table, and your entire interrupt handling system. When your ISR is located in the vector
table, it does not need to be registered. Do not call alt_ic_isr_register(), because it overwrites
the contents of the vector table. The HAL does not provide funnel code. Therefore, your code must
manage all funnel code functions.
For more information about locating an ISR in a vector table, refer to AN595: Vectored Interrupt
Controller Usage and Applications.
Related Information
AN595: Vectored Interrupt Controller Usage and Applications
Use Compiler Optimization
For the best performance both in exception context and application context, use compiler optimization
level -O3. Level -O2 also produces good results. Removing optimization altogether significantly increases
exception response time.
For more information about compiler optimizations, refer to “Reducing Code Footprint in Embedded
Systems” in the "Developing Programs Using the Hardware Abstraction Layer chapter".
Related Information
Developing Programs Using the Hardware Abstraction Layer on page 6-1
Hardware Performance Improvements
Several simple hardware changes can provide a substantial improvement in ISR performance. These
changes involve editing and regenerating the hardware component, and recompiling the Quartus II
design.
In some cases, these changes also require changes in the software architecture or implementation.
For more information about these and other software optimizations, refer to the “Software Performance
Improvements” chapter.
The following sections describe changes you can make in the hardware design to improve ISR perform‐
ance.
Related Information
Software Performance Improvements on page 8-17
8-22
Locate ISR Body in Vector Table
NII5V2
2015.05.14
Altera Corporation
Exception Handling
Send Feedback