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: 
Highlighted
Participant herand
Participant
865 Views
Registered: ‎07-24-2017

HSI "get_property IRQID" not working with concatenated irq signals

Jump to solution

Hello,

 

I followed AR 64980 - How to use the HSI to create a custom driver , from which I learned how to open a hardware defintion file in a drivers tcl scripts in order to get properties of the corresponding hardware.

 

In my tcl, I create a c-file which contains all necessairy information about an IP such that when using the driver, the programmer does not have to check for adresses by himself like for IRQ which can be found in xparameters.h as e.g. "XPAR_FABRIC_MYIP_0_IRQ_INTR". My tcl scripts achieves this by selecting each IP, selecting their out pins called "irq" and check for their property IRQID:

 

set curPin [get_pins -of_object $curIP -filter NAME==irq]
set irqID [get_property IRQID $curPin]

This worked fine before as long as only one IP was connected to the pin IRQ_F2P of the ZYNQ7 Processing System.

However, I want to attach multiple irq sources now and as I have found nothing more up-to-date than AR 55703 , I have connected both IPs to the PS by merging their irq outputs with the IP "concat" and connect this vector to the pin IRQ_F2P.

Unfortunately, this breaks the HSI flow as the get_property IRQID command does not yield the irq number anymore but only an empty response.

 

Is there a workaround to get this flow working again with multiple irqs?

 

Thanks in advance.

 

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
Participant herand
Participant
1,147 Views
Registered: ‎07-24-2017

Re: HSI "get_property IRQID" not working with concatenated irq signals

Jump to solution

Thank you @ibaie for pointing me into the correct direction.

 

I have found multiple hints in that document, which finally led me to scugic.tcl, where my search ended with the following lince of code:

 

set source_ports [::hsi::utils::get_interrupt_sources $periph]

Somehow, neither in the SDKs XSCT console nor in hsi shell, I could get ::hsi::utils command to work in order to test step-by-step, but I get the following error: invalid command name "::hsi::utils::get_interrupt_sources"

I read somewhere, that the command namespace import ::hsi::utils::* should help, but it doesn't.

 

However, I decided to implement my own solution based on some ideas I gathered while reading: My approach is to grab the most inner signal which attaches to the SCUGIC and reverse follow it to it's source(s), which can either only be my custom IP (previous approach) or a xlconcat IP (leaving out the IP AXI Interrupt Controller for now).

In the second case, I grab the xlconcat input pins and follow their connected nets to their origin, extract the source IPs name and compare it to the list of my custom IPs. Traversing through the list beginning in the index of 0, I can easily calcuate the IRQID as 61 + index (as stated here, AR# 58942 ).

 

# get output pin connetced to IRQ_F2P
set irq_pin [get_pin -of_objects [get_nets -of_objects [get_pin -of_objects [get_cells ps7_scugic_0] -filter NAME=~IRQ_F2P]] -filter {NAME!~IRQ_F2P* && DIRECTION == O}]

# get source IP of net connected to IRQ_F2P
set irq_ip [get_cells -of_objects $irq_pin]

if {[string match -nocase [get_property IP_NAME $irq_ip] "xlconcat"]} {

# get nets connected to IN0, IN1, ..., IN15
set irq_nets [get_net -of_objects [get_pin -of_objects $irq_ip -filter NAME=~In*]]

for {set index 0} {$index < [llength $irq_nets]} {incr index} {

# get name of net connecting to xlconcat input and use it to find its corresponding IP
set irq_net [get_property NAME [lindex $irq_nets $index]]

# calculate IRQID for that net
set IRQID_number [expr { $index + 61 }]

# custom stuff from here on

}

}

 

0 Kudos
2 Replies
Moderator
Moderator
817 Views
Registered: ‎10-06-2016

Re: HSI "get_property IRQID" not working with concatenated irq signals

Jump to solution

Hi @herand

 

You can take a look to the device-tree-generator in the Github repository. As you might now this tools uses HSI to go through the design and generate the device-tree file for the Linux images, so all the interrupt numbers are listed there.

 

I cannot point you the exact lines that might be usefull for you but take a look to the code and that might point you to the best approach for your use case.

 

Regards,

Ibai


Ibai
Don’t forget to reply, kudo, and accept as solution.
Participant herand
Participant
1,148 Views
Registered: ‎07-24-2017

Re: HSI "get_property IRQID" not working with concatenated irq signals

Jump to solution

Thank you @ibaie for pointing me into the correct direction.

 

I have found multiple hints in that document, which finally led me to scugic.tcl, where my search ended with the following lince of code:

 

set source_ports [::hsi::utils::get_interrupt_sources $periph]

Somehow, neither in the SDKs XSCT console nor in hsi shell, I could get ::hsi::utils command to work in order to test step-by-step, but I get the following error: invalid command name "::hsi::utils::get_interrupt_sources"

I read somewhere, that the command namespace import ::hsi::utils::* should help, but it doesn't.

 

However, I decided to implement my own solution based on some ideas I gathered while reading: My approach is to grab the most inner signal which attaches to the SCUGIC and reverse follow it to it's source(s), which can either only be my custom IP (previous approach) or a xlconcat IP (leaving out the IP AXI Interrupt Controller for now).

In the second case, I grab the xlconcat input pins and follow their connected nets to their origin, extract the source IPs name and compare it to the list of my custom IPs. Traversing through the list beginning in the index of 0, I can easily calcuate the IRQID as 61 + index (as stated here, AR# 58942 ).

 

# get output pin connetced to IRQ_F2P
set irq_pin [get_pin -of_objects [get_nets -of_objects [get_pin -of_objects [get_cells ps7_scugic_0] -filter NAME=~IRQ_F2P]] -filter {NAME!~IRQ_F2P* && DIRECTION == O}]

# get source IP of net connected to IRQ_F2P
set irq_ip [get_cells -of_objects $irq_pin]

if {[string match -nocase [get_property IP_NAME $irq_ip] "xlconcat"]} {

# get nets connected to IN0, IN1, ..., IN15
set irq_nets [get_net -of_objects [get_pin -of_objects $irq_ip -filter NAME=~In*]]

for {set index 0} {$index < [llength $irq_nets]} {incr index} {

# get name of net connecting to xlconcat input and use it to find its corresponding IP
set irq_net [get_property NAME [lindex $irq_nets $index]]

# calculate IRQID for that net
set IRQID_number [expr { $index + 61 }]

# custom stuff from here on

}

}

 

0 Kudos