Nios® V Processor Software Developer Handbook

ID 743810
Date 4/07/2025
Public

Visible to Intel only — GUID: jpe1733388946461

Ixiasoft

Document Table of Contents

9.2.2.2.1. Trap Handling System Structure

The CLINT-Vectored processor logic takes up the role of dispatching handler (identifies the trap cause and dispatches the registered ISR). Thus, trap handling code and interrupt dispatcher is not required for this implementation, simplifying the trap handling system.
The simplified trap handling system consists of the following components:
  • ISR for timer interrupts
  • ISR for software interrupts
  • ISR for each peripheral that generates hardware interrupts
  • The exception dispatcher
    • Handler for instruction-related exception
With the CLINT-Vectored, each interrupt is directly dispatched to its respective ISR. Only exceptions start from the same exception dispatcher. The exception dispatcher and each ISR need to manage the processor context switch and RTOS overhead (if any), respectively.
The following files provides the HAL API for the trap handling system:
  • <Project directory>\software\bsp\HAL\src\intel_niosv_irq.c
  • <Project directory>\software\bsp\HAL\src\alt_vic_vector_table.S
  • <Project directory>\software\bsp\HAL\src\alt_vic_isr_wrapper.c
Figure 20. HAL Trap Handling System in CLINT-Vectored
Table 41.  CLINT-Vectored Trap Handling
Traps Address Computation Instruction Action Taken
All Exceptions pc <= Vector table jal zero, alt_vic_exception_handler Enters exception dispatcher
Machine software interrupt pc <= Vector table + 12 jal zero, alt_vic_msw_isr Enters machine software ISR
Machine timer interrupt pc <= Vector table + 28 jal zero, alt_vic_mtimer_isr Enters machine timer ISR
Platform interrupt 0 pc <= Vector table + 64 jal zero, alt_vic_platform_irq0 Enters platform ISR 0
Platform interrupt 16 pc <= Vector table + 128 jal zero, alt_vic_platform_irq15 Enters platform ISR 15