Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

7.2.3.2. Accelerating the Interrupt Service Routine

The following techniques can increase interrupt handling efficiency when running your application:

  • General software performance enhancements—Apply the general techniques for improving your application's performance to the ISR and ISR handler. Place the .exception code section in a faster memory region, such as tightly coupled memory.
  • IRQ priority—Assign an appropriate priority to the hardware interrupt. The method for assigning interrupt priority depends on the type of interrupt controller.
    • With the internal interrupt controller, set the interrupt priority of your hardware device to the lowest number available. The HAL ISR service routine uses a priority based system in which the lowest number interrupt has the highest priority.
    • With an external interrupt controller (EIC), the method for priority configuration depends on the hardware. Refer to the EIC documentation for details.
  • Custom instruction and tightly coupled memories—Decrease the amount of time spent by the interrupt handler by using the interrupt-vector custom instruction and tightly coupled memory regions.
  • VIC block—The VIC offers high-performance, low-latency interrupt handling. The VIC prioritizes interrupts in hardware and outputs information about the highest-priority pending interrupt. When external interrupts occur in a system containing a VIC, the VIC determines the highest priority interrupt, determines the source that is requesting service, computes the requested handler address (RHA), and provides information, including the RHA, to the processor. For more information, refer to the "Vectored Interrupt Controller Core" chapter of the Embedded Peripheral IP User Guide.

For more information about how to improve the performance of the Nios II exception handler, refer to the Exception Handling chapter of the Nios® II Gen2 Software Developer's Handbook.