NIOS handle IRQ from FPGA register
Hi,
I firstly created a new IP, and I add the interrupt sender FPGA_INTS. please see my picture below.
I then connect the FPGA_INTS to irq of NIOS. Please see my picture below.
The generated system.h file is shown in the following picture.
The questions:
1) I notice that a few xxxx_IRQ_INTERRUPT_CONTROLLER_ID are -1, and a few YYY_IRQ_INTERRUPT_CONTROLLER_ID are 0. No other value of XXX_IRQ_INTERRUPT_CONTROLLER_ID. is this correct?
2) the FPGA_INTS is assigned in my verilog code in the IP, and it is 32bit width which is 32 interrupt. how to write C code to accept each interrupt?
void HD_interrupt_handler(void * HD_irq_context)
{
log("in HD interrupt == 0x%x\n", *((unsigned int*)HD_irq_context));
printf("==============================\n");
return;
}
void HD_interrupt_setup( void )
{
void * pISR_contex = ( void *) &HD_irq_context;
alt_ic_isr_register(
BF5V_0_IRQ_INTERRUPT_CONTROLLER_ID,
BF5V_0_IRQ,
HD_interrupt_handler,
pISR_contex,
0x0);
}
see answer on the new case (with same related issue) you opened: https://community.intel.com/t5/Nios-V-II-Embedded-Design-Suite/NIOS-connected-to-IRQ-from-FPGA-but-not-PIO/m-p/1693761/highlight/true#M53832:~:text=NIOS%20connected%20to%20IRQ%20from%20FPGA%20but%20not%20PIO