10-18-2017 11:34 AM
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?
07-28-2020 05:00 AM
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".
07-28-2020 06:17 AM - edited 07-28-2020 06:19 AM
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
07-28-2020 06:19 AM
07-28-2020 06:32 AM
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?