cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cerilet
Explorer
Explorer
3,086 Views
Registered: ‎08-26-2014

How to measure how much latency a variable function takes?

Hello,

 

I have a function with several for loops that vary the number of times they are executed overtime. Therefore, Vivado HLS cannot estimate what its latency is.

 

Is it possible to measure how many clock cycles the function takes to execute every time I call it from the test bench file?

 

Many thanks,

 

Cerilet

0 Kudos
4 Replies
cerilet
Explorer
Explorer
3,048 Views
Registered: ‎08-26-2014

No one know how to tackle this problem?
0 Kudos
jprice
Scholar
Scholar
3,033 Views
Registered: ‎01-28-2014

In short, look at the loop  trip count directive. Specify a min/max trip count for each loop and HLS can make an estimate of the overall function latency. It should already report the II and loop latency for each loop and pulls that information with the bounds you provide to report overall latencies. 

u4223374
Advisor
Advisor
3,023 Views
Registered: ‎04-26-2015

If you do a cosimulation, HLS should be able to calculate latency there (based on the provided test data). It can't do it during C simulation because the C simulation has no concept of "clock cycles".

hbucher
Scholar
Scholar
2,961 Views
Registered: ‎03-22-2016

@cerilet

In the HLS manual it states that you should use assert() to tell HLS the maximum loop size.

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.