cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Adventurer
Adventurer
1,089 Views
Registered: ‎07-09-2017

big latency with dsp atan2

Hi everyone,

 

In vivado HLS, I used the atan2 function in dsp library (#include "hls_dsp.h"). I got very big latency with the atan2 function (attached below). Is that normal? If not, how should I optimise it?

 

Regards,

snip_20171018202729.png

5 Replies
Observer
Observer
422 Views
Registered: ‎10-10-2017

Hi jianmingli1,

0 Kudos
Reply
409 Views
Registered: ‎07-23-2019

 

That is probably not because the atan2 function itself but the things surrounding. It doesn't make sense for a mathematical function to vary in latency from 8 to 997 cycles. 

Optimizing is quite a case-by-case situation. Really hard to say "how to optimize HLS for speed just by giving it has an atan2 function". 

0 Kudos
Reply
394 Views
Registered: ‎03-27-2014

If the atan function is estimated using a CORDIC, then latency will vary depending on the accuracy you want. I don't know how you define accuracy in your environment.

This algorithm is basically trying to guess the best estimate of the atan function, more cycles (meaning more guesses) will produce a better estimate

I remember a couple of years ago the Xilinx IP maximal accuracy was 48 guesses, meaning you will always have 48 cycles of latency for maximal accuracy

gw.
Embedded Systems, DSP, cyber
0 Kudos
Reply
Observer
Observer
391 Views
Registered: ‎10-10-2017

The vivado HLS tool contains an atan2 example project. There, the synthesised function is only the hls::atan2 function. What I have found so far is that there is a great trade off between the latency and the HW utilization. Just by adding the pipeline directive, the latency decreased from around 60[us] to 60[ns], but the LUT’s amount multiplied by a factor of ~8(from 1300 to 10100). Quite drastic improve in latency in cost of HW.
0 Kudos
Reply
383 Views
Registered: ‎07-23-2019

 

Yes, speed and area are exclusive. If you find something fast and small, you have obsoleted every other way of doing that thing.

Many times is not latency what matters, but interval. Does it matter to you if your output is, say, 1 us delayed as long as you can process, say, one data item every 5 ns?

0 Kudos
Reply