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
Visitor migr
Visitor
3,529 Views
Registered: ‎10-02-2016

Variable latency warning

Jump to solution

Hello everybody

 

To determine the latency of various code lines I would like to set the latency directive to some of my code lines using a label.

This would allow me to know where optimizations of my code are necessary (to consider switching from floating point to fixed-point representations) in order to achieve a given, tight latency constraint - possibly via comparison to the arithmetic blocks in my hand-crafted data dependency graph. Of course, some code lines may have a variable latency, but in this case I would just be happy to know the worst-case latency of that block. 

An example (snippet from my code):

 

labelsincos:
{
sin1 = sin(mult1);
cos1 = cos(mult1);
}

 

During synthesis I get the following warning:

WARNING: [SCHED 204-71] Latency directive discarded for region labelsincossince region contains function calls with variable latency.

Side-note: mult1 is a float.

 

Of course, as these special code lines are implemented separately on a floating point unit, I can see the latency in the synthesis report. But usually I am not able to associate my code lines with their corresponding latency from the latency information in the report file.

 

So my question is:

How can I set a latency directive to a block with variable latency or associate code lines with their corresponding latency?

 

Any help will be much appreciated!

 

Cheers,

Michael

 

 

0 Kudos
1 Solution

Accepted Solutions
Scholar jprice
Scholar
6,644 Views
Registered: ‎01-28-2014

Re: Variable latency warning

Jump to solution

I think the problem with this is that HLS tries to do it on functional boundaries. Within a function it'll reorder operations however it sees fit to accomplish your goals. The only way I could think of to see what you want to see is encapsulate the code in question in a function. Then you can force inline on or off. Forcing inline to be off will keep the function boundary and you can see how long the function takes (note this adds a cycle of latency and slows everything down). Once you're done analyzing you can turn inline back on.

2 Replies
Scholar jprice
Scholar
6,645 Views
Registered: ‎01-28-2014

Re: Variable latency warning

Jump to solution

I think the problem with this is that HLS tries to do it on functional boundaries. Within a function it'll reorder operations however it sees fit to accomplish your goals. The only way I could think of to see what you want to see is encapsulate the code in question in a function. Then you can force inline on or off. Forcing inline to be off will keep the function boundary and you can see how long the function takes (note this adds a cycle of latency and slows everything down). Once you're done analyzing you can turn inline back on.

Visitor migr
Visitor
3,464 Views
Registered: ‎10-02-2016

Re: Variable latency warning

Jump to solution

Thank you very much, your solution works very well for me. 

 

Cheers,

Michael

0 Kudos