UPGRADE YOUR BROWSER

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!

取消
显示结果 
搜索替代 
您的意思是: 
Participant yaoyinqi
Participant
251 次查看
注册日期: ‎06-21-2018

HLS 添加loop_flatten指令减少latency的问题

Hi,ALL

根据手册ug902  p168所说,loop_faltten指令对perfect loop和semi-perfect loop有效,但我实际试验了一下,觉得对semi-perfect loop并没有减少latency,反而增加了latency,对比结果如下。

flatten.jpg

Code:【loop_flatten是添加到循环L2】

void top(int x[16], int y[16], int M) {

L1 : for(int i=0;i<M;i++)
{
#pragma HLS LOOP_TRIPCOUNT min=1 max=10 avg=5
     L2: for (int k=0;k<10;k++) {
           y[k] = x[k] + 1;

     }
}

无flat.jpg有flat.jpg

 

0 项奖励
1 条回复1
Xilinx Employee
Xilinx Employee
201 次查看
注册日期: ‎03-24-2010

回复: HLS 添加loop_flatten指令减少latency的问题

The effective way here is to use pipeline.

Loop flatten helps reducing cycles jumping into and out the inner loop. Tool will do loop flatten automatically. 

Regards,
brucey
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 项奖励