cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
lygw
Explorer
Explorer
580 Views
Registered: ‎09-11-2019

problem about #pragma HLS dependence in Vitis 2020.1

In Vitis HLS Migration Guide(UG1391 (v2020.1) July 28, 2020), I find that the usage of #pragma HLS dependence has changed a lot. And I don't understand how to use it correctly now. Can someone give me some examples ? Thanks a lot !

lygw_2-1599573104108.png

 

Tags (1)
4 Replies
bchebrol
Xilinx Employee
Xilinx Employee
537 Views
Registered: ‎06-04-2018

Hi @lygw ,

You can use the following dependence_inter as reference.

https://github.com/Xilinx/Vitis_Accel_Examples/tree/master/cpp_kernels/dependence_inter

Thanks,

Vishnu

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

0 Kudos
lygw
Explorer
Explorer
513 Views
Registered: ‎09-11-2019

In this example, no matter if I commented the Line 67 "#pragma HLS DEPENDENCE variable = linebuf inter false" of the vconv.cpp, the II of each loop didn't change in the hw_emu. Is it normal ?
0 Kudos
lygw
Explorer
Explorer
485 Views
Registered: ‎09-11-2019

For the better understanding, I reorganized my questions.

0. Version of Vitis

捕获.PNG

1. hw_emu

I ran the hw_emu of the dependence_inter project (Vitis_Accel_Examples-master/cpp_kernels/dependence_inter) and got the report below.

捕获.PNG

It seemed normal but when I checked the file vconv_vitis_hls.log, I found the warning below.

捕获.PNG

In the ug1391-vitis-hls-migration-guide, I found that the usage of #pragma HLS DEPENDENCE changed in the Vitis 2020.1.

捕获.PNG

Now I have some questions about the usage:

1) In the box ①, it mentions that using "distance" value of >0 to replace "dependent=true". And I want to know how to realize "dependent=false". Can I use "distance" value of =0 to replace "dependent=false" ?

2) In the box ②, it says that -distance <integer> is deprecated. But in the box ①,it still use the "distance" value. Is there a conflict ?

3) How can I realize the same effect of #pragma HLS DEPENDENCE variable = linebuf inter false without any warning ?

2. Effect of #pragma HLS DEPENDENCE

Because the dependence_inter example project is used to teach the usage of #pragma HLS DEPENDENCE, and also because I wanted to check if the this instruction works normally when such a warning exists, I commented the Line 67 of the vconv.cpp and saved the file.

捕获.PNG

According to the comments, the II will increase if #pragma HLS DEPENDENCE variable = linebuf inter false isn't be used. However, when I ran the hw_emu again, I found no loop's II changed.

捕获.PNG

I alse tried setting #pragma HLS DEPENDENCE variable = linebuf inter true but the result was the same as before again.

Now I am confused about this phenomenon. I can't judge whether #pragma HLS DEPENDENCE variable = linebuf inter false is effective in this example project or not. And I also want to know why this result does not match the phenomenon described in the comments.


Thanks for any help!

0 Kudos
lygw
Explorer
Explorer
425 Views
Registered: ‎09-11-2019

What's more, in my code file kernel_separate.cpp, I want to delete the dependence between writing sum0 (sum1, sum2, sum3) and reading sum0 (sum1, sum2, sum3) in two neighbouring loops so as to reduce II to 1.

The reason why the dependence between writing sum0 and reading sum0 in two neighbouring loops is false is that each of sum0, sum1, sum2, sum3 won't be used twice in four consecutive loops in my design so they can take 3 clocks to calculate float numbers and take 1 clock to write back when II = 1.

But now I've tried many styles of #pragma HLS DEPENDENCE variable = sum0 inter false like #pragma HLS dependence variable=sum0 distance=0 inter, #pragma HLS dependence variable=sum0 distance=1 inter, #pragma HLS dependence variable=sum0 inter distance=1. And I found all of them couldn't delete the dependence and the II violation is as below:

捕获.PNG

Now I want to know what I can do to delete the dependence. I attached my file in the post. Thanks for any help !

0 Kudos