HLS for循环优化 基本指标

• Latency: Number of clock cycles required for the function to compute all output values. 计算消耗的时钟周期个数
• Initiation interval (II): Number of clock cycles before the function can accept new input data.函数调用到下次函数可以重新接收数据所需的时钟周期个数
• Loop iteration latency: Number of clock cycles it takes to complete one iteration of the loop. 一个循环内所需的时钟周期个数
• Loop initiation interval: Number of clock cycle before the next iteration of the loop starts to process data. 本次循环到下次循环所需的时间
• Loop latency: Number of cycles to execute all iterations of the loop 整个loop for循环所需的时间

在这里插入图片描述
pipeline
在这里插入图片描述

code

在这里插入图片描述
在这里插入图片描述
function initial inerval 多一个时钟是因为 ap_done指示信号需要一个时钟

pipeline

在directive中对loop增加 pipeline

unroll

并行度和资源量的 一个折中
在这里插入图片描述
factor :展开为几个
在这里插入图片描述

  循环变量的类型(如 int 或者 ap_int<4>等)对综合结果是没有影响的,因为 Vivado HLS

考虑的是 i 的最大值是多少,从而根据 i 的最大值来进行相应的资源规划。

发布了415 篇原创文章 · 获赞 251 · 访问量 68万+

猜你喜欢

转载自blog.csdn.net/qq_35608277/article/details/104641602
HLS
今日推荐