Visible to Intel only — GUID: iga1457455599901
Ixiasoft
Visible to Intel only — GUID: iga1457455599901
Ixiasoft
38.8.2. Software Interrupt
Software can trigger any VIC interrupt by writing to the appropriate VIC control and status register (CSR). Software can trigger the interrupt connected to any hardware interrupt source, as well as interrupts that are not connected to hardware (software-only interrupts).
Triggering an interrupt from software is useful for debugging. Software can control exactly when an interrupt is triggered, and measure the system’s interrupt response.
You can use a software-only interrupt to re-prioritize an interrupt. An ISR that responds to a high-priority hardware interrupt can perform the minimum processing required by the hardware, and then trigger a software-only interrupt at a lower priority level to complete the interrupt processing.
The following functions are available for managing software interrupts:
- alt_vic_sw_interrupt_set()
- alt_vic_sw_interrupt_clear()
- alt_vic_sw_interrupt_status()
The implementations of these functions are in bsp/hal/drivers/src/altera_vic_sw_intr.c after you generate the BSP.
Registering a Software Interrupt
alt_ic_isr_register( VIC1_INTERRUPT_CONTROLLER_ID, SOFT_IRQ, soft_interrupt_latency_irq, NULL, NULL)
Registering a Timer Interrupt (for Comparison)
alt_ic_isr_register( LATENCY_TIMER_IRQ_INTERRUPT_CONTROLLER_ID, LATENCY_TIMER_IRQ, timer_interrupt_latency_irq, LATENCY_TIMER_BASE, NULL);
The following code generates a software interrupt:
alt_vic_sw_interrupt_set(VIC1_INTERRUPT_CONTROLLER_ID, SOFT_IRQ);