The
config_compile -pipeline_loops
command
enables loops to be pipelined automatically based on the iteration count. All loops
with an iteration count below the specified limit are automatically pipelined. The
default is 64.
Given the following example code:
for (y = 0; y < 480; y++) {
for (x = 0; x < 640; x++) {
for (i = 0; i < 5; i++) {
// do something 5 times ...
}
}
}
If the pipeline_loops
option is
set to 6, the innermost for
loop in the above code
snippet will be automatically pipelined. This is equivalent to the following code
snippet:
for (y = 0; y < 480; y++) {
for (x = 0; x < 640; x++) {
for (i = 0; i < 5; i++) {
#pragma HLS PIPELINE II=1
// do something 5 times ...
}
}
}
If there are loops in the design for which you do not want to use
automatic pipelining, apply the PIPELINE directive with the off
option to that loop. The off
option prevents automatic loop pipelining.
Important:
Vitis HLS applies the
config_compile
-pipeline_loops
command after performing all user-specified directives.
For example, if Vitis HLS applies a
user-specified UNROLL directive to a loop, the loop is first unrolled, and automatic
loop pipelining cannot be applied.