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
Did you mean:
Highlighted
Contributor
307 Views
Registered: ‎03-07-2018

## Why functions take more clock cycles after applying pipeline pragma?

Hello,

I am using acosf() function in my HLS code, inside some loop as written below:

for(h=0; h<46; h++)
{
for(j=0; j<46; j++)
{
dx=(x11[h]-x11[j]);
dy=(y11[h]-y11[j]);
dz=(z11[h]-z11[j]);
r2 =dx*dx + dy*dy + dz*dz;
r=sqrtf(r2);
uu = dz/r;
pcolhea1 = acosf(uu);}}

In analysis view, acosf() function takes 2 clock cycles, but when I pipeline j loop the same function takes 33 clock cycles. Why such a big difference? Can anybody tell??

Thanks.

2 Replies
Moderator
271 Views
Registered: ‎10-04-2011

## Re: Why functions take more clock cycles after applying pipeline pragma?

Hello @kritika117 ,

I think to understand this better, can you provide the complete code and project for this? What I am confused on is where in the code the directive is applied. When you say you pipeline the J loop, do you mean the following:

```...
for(j=0; j<46; j++) {
#pragma HLS PIPELINE
...```

or

```...
#pragma HLS PIPELINE
for(j=0; j<46; j++) {
...

```

If the latter, then this would completely unroll all loops within the pipeline region - in this case the J loop.

OK, please let me know, and attack a complete example if possible

Scott

Contributor
256 Views
Registered: ‎03-07-2018

## Re: Why functions take more clock cycles after applying pipeline pragma?

``` for(j=0; j<46; j++) {