仅对英特尔可见 — GUID: hsi1468861028556
Ixiasoft
1. Intel® HLS Compiler Pro版参考手册
2. 编译器
3. C语言和库支持
4. 组件接口
5. 组件存储器(存储器属性)
6. 组件中的循环
7. 组件并发
8. 任意精度数学支持
9. 组件目标频率(Target Frequency)
10. 任务系统
11. 库
12. 高级硬件综合控制
13. Intel® High Level Synthesis Compiler Pro版参考总结
A. 高级数学源代码库
B. 支持的数学函数
C. Cyclone® V限制
D. Intel® HLS Compiler Pro版参考手册存档
E. Intel® HLS Compiler Pro版参考手册修订历史
13.1. Intel® HLS Compiler Pro版i++命令行参数
13.2. Intel® HLS Compiler Pro版头文件
13.3. Intel® HLS Compiler Pro版编译器定义的预处理器宏
13.4. Intel® HLS Compiler Pro版关键字
13.5. Intel® HLS Compiler Pro版模拟API(仅测试台)
13.6. Intel® HLS Compiler Pro版组件存储器属性
13.7. Intel® HLS Compiler Pro版循环预处理指令
13.8. Intel® HLS Compiler Pro版范围预处理指令
13.9. Intel® HLS Compiler Pro版组件属性
13.10. Intel® HLS Compiler Pro版组件默认值接口
13.11. Intel® HLS Compiler Pro版组件调用接口控制属性
13.12. Intel® HLS Compiler Pro版组件宏
13.13. Intel® HLS Compiler Pro版技术性任务系统API
13.14. Intel® HLS Compiler Pro版管道API
13.15. Intel® HLS Compiler Pro版流输入接口
13.16. Intel® HLS Compiler Pro版流输出接口
13.17. Intel® HLS Compiler Pro版存储器映射接口
13.18. Intel® HLS Compiler Pro版加载-存储单元控制
13.19. Intel® HLS Compiler Pro版任意精度数据类型
仅对英特尔可见 — GUID: hsi1468861028556
Ixiasoft
6.4. 循环展开(unroll预处理指令)
Intel® HLS Compiler支持使用unroll预处理指令展开循环的多个副本。
实例 代码
#pragma unroll <N> for (int i = 0; i < M; ++i) { // Some useful work }
在此实例中,<N>指定展开因子,即HLS编译器生成的循环的副本数。如果没有指定展开因子,那么在编译过程中知道循环迭代的次数后,HLS编译器会将循环完全展开。
在展开循环时的编译器生成的代码类型实例,请参考以下代码片段,其中指定展开因子为3:
hls_register float data[N];
#pragma unroll 3
for (int i = 0; i < N; i++)
{
data[i] = function(i, a);
}
通过展开因子3展开的循环使得编译器将代码片段转换为类似以下代码的内容:
hls_register float data[N]; for (int i = 0; i < N; i += 3) { data[i + 0] = function(i + 0, a); if (i + 1 < N) { data[i + 1] = function(i + 1, a); } if (i + 2 < N) { data[i + 2] = function(i + 2, a); } }
您可以在高级设计报告(report.html)中找到每个循环的展开状态。