Hey,
I'm currently working on my master thesis where I have to implement a domain specific DMA controller in VHDL.
Here everything's working fine. But I have a problem at handling interrupts coming from my custom DMAC IP. At the beginning I have to configure my DMAC via AXI Lite and have to give him a transaction table that it can process. Then I enable the DMAC. Before this all is done I want to setup the interrupt stuff, so that I get an interrupt as soon as all transfers are processed.
The problem is, that the assigned interrupt service routine is not executed if I do it in this order. Here the program simply stops if the interrupt occurs. Only if I setup the IRQ after the DMAC is enabled (and some extra delay between...), the ISR is called and the IRQ is acknowledged. Here is the code I want to be processed:
//SCUGIC interrupt controller Intialization
//Registration of the ISR
xStatus = initializeInterruptSystem(XPAR_PS7_SCUGIC_0_DEVICE_ID);
if(XST_SUCCESS != xStatus)
print(" :( SCUGIC INIT FAILED \n\r");
/* Here the configuration of the DMAC is done */
.....
/* End of the configuration */
// enabling the DMAC
Xil_Out32(DMA2_CONFIG_BASEADDR + 0 * 0x4, 1);
But it's only working if I do it like this:
/* Here the configuration of the DMAC is done */
.....
/* End of the configuration */
// enabling the DMAC
Xil_Out32(DMA2_CONFIG_BASEADDR + 0 * 0x4, 1);
// extra delay ...
int ctr = 0;
for (ctr = 0; ctr < 100; ++ctr);
//SCUGIC interrupt controller Intialization
//Registration of the ISR
xStatus = initializeInterruptSystem(XPAR_PS7_SCUGIC_0_DEVICE_ID);
if(XST_SUCCESS != xStatus)
print(" :( SCUGIC INIT FAILED \n\r");
The initializeInterruptSystem(...) routine is implemented like in http://www.xilinx.com/support/answers/50572.html.
I hope you have an idea of what's wrong here.
Pascal