一、pipieline的目的
1.pipeline的目的是让II=1或者尽可能的接近1
二、pipeline优化分类
1.对操作或者表达式pipeline
对内置函数单元,例如adder,multiplier,memory进行pipeline
sequence of operations进行pipeline
2.对循环pipeline
对while循环,for循环进行pipeline
对循环pipeline,循环中的迭代草是overlap重叠的
下图的for循环的三种类型的pipeline
第一种,复用加法器
第二种,内层循环全部被展开
第三种,for循环被全部展开
3.function函数的pipeline
函数是overlap重叠的
对function进行pipeline后
如果这个函数run forever and never ends的情况下,
函数是自动rewind的,函数之间的bubble被挤掉了
并且,函数中的所有loops将全部被unroll展开。
pipeline函数可以使用dataflow并行化替代
注意:对function进行pipeline的代价比较大,因为会将所有的loop展开,
所以一般使用dataflow来替代function的pipeline
4.task的pipeline
三、pipeline的flush怎么用
关于pipeline的flush
四、pipeline被限制
1.loop with可变边界会阻止循环pipeline
对于循环边界是变量的for循环,通过优化实现了pipeline功能
2.数据的依赖会阻碍循环pipeline
3.IO的带宽,memory访问速度,bram的port都会阻碍pipline
4.branch控制分支,会阻碍pipeline
参考资料:
1. HLS Textbook. https://www.boledu.org/textbooks/hls-textbook
2. Kastner, R., Matai, J., and Neuendorffer, S.. Parallel Programming for FPGAs. (https://kastner.ucsd.edu/hlsbook/)
3. Fingeroff, Michael. High-Level Synthesis Blue Book. Xlibris Corporation, 2010.
4. Xilinx Vivado Design Suite User Guide: High-Level Synthesis (UG902). (https://docs.xilinx.com/v/u/en-US/ug902-vivado-high-level-synthesis)
5. Xilinx Vivado Design Suite Tutorial: High-Level Synthesis (UG871). (https://docs.xilinx.com/v/u/en-US/ug871-vivado-high-level-synthesis-tutorial)