UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
4,915 Views
Registered: ‎06-04-2012

How to connect a user-defined interrupt signal(generated by fabric logic) to GIC(Global Interrupt Controller) in ZYNQ?

Hi, all.
 
I am doing some experiments on ZYNQ-7000 about interrupt from PL to PS.
 
I found that only a device is able to be an interrupt source of PS, such as AXI GPIO core, AXI INTC core, IIC, UART and so on.
 
But in my project, it requires a fabric logic designed by user to generate a single plus as an interrupt signal and transfer it to GIC(Global Interrupt Controller) in PS.
 
Well, I find that there is no ports to be the role.
 
Do I misunderstand the interrupt in zynq? Or anything else wrong?
 
Anyone help me out? Thanks very much.
 
BTW: I use XPS(EDK) 14.2
0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
4,906 Views
Registered: ‎02-01-2008

Re: How to connect a user-defined interrupt signal(generated by fabric logic) to GIC(Global Interrupt Controller) in ZYNQ?

In order for an output from a custom core to show up as an interrupt source, the mpd for the core needs the INTERRUPT tag added to the port. Refer to UG642 for details.

 

Here is an example of what the output port should look like in the pcore's mpd file.

 

PORT MY_IRQ = "", DIR=O, SENSITIVITY=LEVEL_HIGH, SIGIS=INTERRUPT

 

0 Kudos
Explorer
Explorer
4,764 Views
Registered: ‎02-17-2013

Re: How to connect a user-defined interrupt signal(generated by fabric logic) to GIC(Global Interrupt Controller) in ZYNQ?

Hey

I search a example of application in c language who use the interruption GIC I added my own ip now I want test my ip in interruption I add the instruction PORT MY_INTERRUPT = "", DIR=O, SENSITIVITY=LEVEL_HIGH, SIGIS=INTERRUPTin the file interrupt_v2_1_0.mpd, then I generate the file system.bit. I find example of application in c language unfortunately this application use function of gpio. In my case I want application adapted for a project use custom peripheral.

Best regards.

 

#include "xparameters.h"
#include "xscugic.h"
#include "xil_exception.h"
#include "interrupt.h"
#include "xgpiops.h"

#define INTC_DEVICE_ID XPAR_PS7_SCUGIC_0_DEVICE_ID
#define INTC_GPIO_INTERRUPT_ID XPAR_FABRIC_GPIO_0_VEC_ID
#define INTC XScuGic
#define INTC_HANDLER XScuGic_InterruptHandler
#define BUTTON_INTERRUPT 0x1

static INTC Intc;

void my_interrupt_handler() {
xil_printf(" Fonction d'interruption déclenchée \n\r");
}
int SetupInterruptSystem();
INTC InterruptController; /* Instance of the Interrupt Controller */

int main() {
void *data = NULL;
/*int Status;
Status = SetupInterruptSystem();
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
SetupInterruptSystem();*/
while (1) {
//xil_printf("boucle infinie\n\r");
}
return XST_SUCCESS;;
}

int SetupInterruptSystem() {
int Result;
INTC *IntcInstancePtr = &Intc;

#ifdef XPAR_INTC_0_DEVICE_ID
/*
* Initialize the interrupt controller driver so that it's ready to use.
* specify the device ID that was generated in xparameters.h
*/
Result = XIntc_Initialize(IntcInstancePtr, XPAR_INTC_SINGLE_DEVICE_ID);
if (Result != XST_SUCCESS) {
return Result;
}

/* Hook up interrupt service routine */
XIntc_Connect(IntcInstancePtr, XPAR_AXI_INTC_0_DEVICE_ID,
(Xil_ExceptionHandler)my_interrupt_handler, &InterruptController);

/* Enable the interrupt vector at the interrupt controller */

XIntc_Enable(IntcInstancePtr, XPAR_AXI_INTC_0_DEVICE_ID);

/*
* Start the interrupt controller such that interrupts are recognized
* and handled by the processor
*/
Result = XIntc_Start(IntcInstancePtr, XIN_REAL_MODE);
if (Result != XST_SUCCESS) {
return Result;
}

#else
XScuGic_Config *IntcConfig;

/*
* Initialize the interrupt controller driver so that it is ready to
* use.
*/
IntcConfig = XScuGic_LookupConfig(INTC_DEVICE_ID);
if (NULL == IntcConfig) {
return XST_FAILURE;
}

Result = XScuGic_CfgInitialize(IntcInstancePtr, IntcConfig,
IntcConfig->CpuBaseAddress);
if (Result != XST_SUCCESS) {
return XST_FAILURE;
}

XScuGic_SetPriorityTriggerType(IntcInstancePtr, XPAR_SCUGIC_0_DEVICE_ID,
0xA0, 0x3);

/*
* Connect the interrupt handler that will be called when an
* interrupt occurs for the device.
*/
Result = XScuGic_Connect(IntcInstancePtr, XPAR_SCUGIC_0_DEVICE_ID,
(Xil_ExceptionHandler) my_interrupt_handler, &InterruptController);
if (Result != XST_SUCCESS) {
return Result;
}

/*
* Enable the interrupt for the GPIO device.
*/
XScuGic_Enable(IntcInstancePtr, XPAR_SCUGIC_0_DEVICE_ID);
#endif

/*
* Enable the GPIO channel interrupts so that push button can be
* detected and enable interrupts for the GPIO device
*/
//XGpio_InterruptEnable(&Gpio, BUTTON_INTERRUPT);
//XGpio_InterruptGlobalEnable(&Gpio);

/*
* Initialize the exception table and register the interrupt
* controller handler with the exception table
*/
Xil_ExceptionInit();

Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
(Xil_ExceptionHandler) XScuGic_InterruptHandler, IntcInstancePtr);
/* Enable non-critical exceptions */Xil_ExceptionEnable();
return XST_SUCCESS;
}

 

0 Kudos
Explorer
Explorer
4,760 Views
Registered: ‎02-17-2013

Re: How to connect a user-defined interrupt signal(generated by fabric logic) to GIC(Global Interrupt Controller) in ZYNQ?

I search example of application in c language who work a custom peripheral IP, the examples found use the Axi gpio there is already function written for example for enable the interrupt of the gpio. 

XGpio_InterruptEnable(&Gpio, BUTTON_INTERRUPT);
XGpio_InterruptGlobalEnable(&Gpio);

I want example who use a custom peripheral IP and not a catalog ip available in the IP catalog of the Xilinx Platform Studio.

Best ergards. 

0 Kudos