Loop unrolling (HAST-114)
Piedone opened this issue · comments
Unroll loops with constant parameters, i.e. copy the loop body as many times as the loop would run. Since one loop execution takes one clock cycle in itself if the loop body otherwise wouldn't then we can pack more operations into a single clock cycle.
With constant substitution this is now more widely usable.
This happens in Vivado HLS: https://www.xilinx.com/support/documentation/sw_manuals/xilinx2014_1/ug902-vivado-high-level-synthesis.pdf#page=199
It seems that in Posit32 actually no loops could be automatically unrolled due to the loops expressions not being resolvable statically. However sometimes manual loop unrolling can help.
Also see this article, page 6, "D. Loop Optimizations".