cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor
Visitor
11,908 Views
Registered: ‎04-01-2009

Custom IP, Interrupts, and Xilkernel

Jump to solution

Hi,

 

I'm new to Xilkernel, and I am having difficulty connecting an interrupt generated by my custom IP core to an interrupt handler.  In particular, I don't know what value to use for an interrupt ID, which is the first argument to register_int_handler(...).

 

I have Xilkernel running okay, using the example in ML403_PPC_XMK_10_1.zip, from the Xilinx web site.  I am trying to add custom IP to the FPGA that will issue an interrupt to software.  Starting from that project, I use the "Create or Import Peripheral" wizard to create a custom peripheral, following the example shown in Chapter 5 of the "EDK Concepts, Tools, and Techniques" paper, also from Xilinx.

 

Next, in the System Assembly View, in the Port tab, I expand the "test_ip" peripheral, and in the "Net" column I ask for a new connection, and then accept the default name.

 

Next I generate the netlist, launch SDK,and select Xilinx Tools->Generate Libraries and BSPs.

 

When I have done that, my xparameters.h file has entries for the the newly created test_ip, but I cannot find anything in there regarding an interrupt ID.

 

How do I discover the interrupt ID for my custom IP, so that I can pass it to register_int_handler(...)?

 

Thanks ahead of time!

 

Regards,

Chris

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
14,080 Views
Registered: ‎08-16-2007

Re: Custom IP, Interrupts, and Xilkernel

Jump to solution

In the System Assembly View ->Ports tab

1. Expand your peripheral and look for a port called IP2INTC_Irpt

If there is no connection here then click and assign a connection (I hope you know how to do that)

2. Then expand your interrupt controller (in the same view)

Double click on the Intr connection and assign your Interrupt signal (created in step 1)

Regenerate the bitstream and the libraries.

BR

Message Edited by benradu on 04-03-2009 08:39 AM
Message Edited by benradu on 04-03-2009 09:18 AM

View solution in original post

10 Replies
Highlighted
Explorer
Explorer
11,899 Views
Registered: ‎08-12-2007

Re: Custom IP, Interrupts, and Xilkernel

Jump to solution

XilKernel has its own interrupt handle procedure and API.

 

You can find more detailed description in oslib_rm.pdf --> XilKernel Chapter --> Interrupt Handling

It's on page105 on my 10.1.3 version.

0 Kudos
Highlighted
Visitor
Visitor
11,875 Views
Registered: ‎04-01-2009

Re: Custom IP, Interrupts, and Xilkernel

Jump to solution

rickysu,

 

Thanks for your reply.

 

register_int_handler(...) is part of the Xilkernel interrupt handling facilities, so I'm already trying to use the procedures described on Page 105 of oslib_rm.pdf.  That document describes register_int_handler(...), but it assumes I already know what I should use for the first argument.  I need to know what value to pass for that argument.

 

If I use one of the peripherals available in the BSB wizard, xparameters.h seems to include an interrupt ID for that peripheral.  However, when I create a custom peripheral using the "Create or Import Peripheral..." wizard and then include it in my project, I can't find its interrupt ID anywhere.

 

Am I misunderstanding something?

 

Regards,

Chris

0 Kudos
Highlighted
Adventurer
Adventurer
11,858 Views
Registered: ‎08-16-2007

Re: Custom IP, Interrupts, and Xilkernel

Jump to solution

This is how I do it:

 

register_int_handler( XPAR_XPS_INTC_0_MY_IP_IP2INTC_IRPT_INTR, \
                      MY_IP_Intr_Handler, \
                      (void *)XPAR_MY_IP_BASEADDR))

 

The first argument comes from xparameters.h

If your peripheral interrupt is connected to the interrupt controller then you should get this constant in the xparameters

0 Kudos
Highlighted
Visitor
Visitor
11,848 Views
Registered: ‎04-01-2009

Re: Custom IP, Interrupts, and Xilkernel

Jump to solution

benradu,

 

Thanks for your reply.  I think you have helped me identify some of my misunderstanding.

 

From what you said, I should look in xparameters.h for something like XPAR_XPS_INTC_0_TEST_IP_IP2INTC_IRPT_INTR.  I don't see anything like that in my xparameters.h file, so it would seem that my peripheral is not connected to the interrupt controller.  How do I connect it?

 

Thanks ahead of time!

 

Regards,

Chris

0 Kudos
Highlighted
Adventurer
Adventurer
14,081 Views
Registered: ‎08-16-2007

Re: Custom IP, Interrupts, and Xilkernel

Jump to solution

In the System Assembly View ->Ports tab

1. Expand your peripheral and look for a port called IP2INTC_Irpt

If there is no connection here then click and assign a connection (I hope you know how to do that)

2. Then expand your interrupt controller (in the same view)

Double click on the Intr connection and assign your Interrupt signal (created in step 1)

Regenerate the bitstream and the libraries.

BR

Message Edited by benradu on 04-03-2009 08:39 AM
Message Edited by benradu on 04-03-2009 09:18 AM

View solution in original post

Highlighted
Visitor
Visitor
11,810 Views
Registered: ‎04-01-2009

Re: Custom IP, Interrupts, and Xilkernel

Jump to solution

benradu,

 

Thanks!  That was the missing link.  Now xparameters.h defines XPAR_XPS_INTC_0_TEST_IP_0_IP2INTC_IRPT_INTR, which is what I have been seeking.

 

Thanks again,

Chris

0 Kudos
Highlighted
Explorer
Explorer
6,842 Views
Registered: ‎02-17-2013

Re: Custom IP, Interrupts, and Xilkernel

Jump to solution

Hey

I am doing a custom IP, interrupts who use zedboard, unfortunately it's'nt work there is personn who did similar project with zedboard. I added my own IP with the create import peripheral and I added the interrupt with this line in the file interrupt_v2_1_0.mpd of the XPS. 

PORT my_interrupt = "",DIR = O, SIGIS = INTERRUPT, SENSITIVITY = EDGE_RISING, INTERRUPT_PRIORITY = LOW

you can see a image of the XPS.

Do you can help me ?
Best regards.  
 

hope.png
0 Kudos
Highlighted
Explorer
Explorer
6,841 Views
Registered: ‎02-17-2013

Re: Custom IP, Interrupts, and Xilkernel

Jump to solution

WHen I did the test it's'nt work I don't know if it's the hw or the sw who have default I added the main.c.

 

0 Kudos
Highlighted
Anonymous
Not applicable
6,833 Views

Re: Custom IP, Interrupts, and Xilkernel

Jump to solution

Here is a doc I created a long time ago, it may here you here

0 Kudos
Highlighted
Explorer
Explorer
1,766 Views
Registered: ‎02-17-2013

Re: Custom IP, Interrupts, and Xilkernel

Jump to solution

Hey 

Thanks for your reply I already saw this document but I use the processor zynq, more this document don't explain how I must do with the processor Arm. I think I need'nt use the Axi interrupt Controller I can wire my interrupt directly on the General interrupt Controller GIC of the zynq. The code in c language will be differently I don't use the same functions. you can see my main.c 

Best regards. 

0 Kudos