Why is the loop's trip count and latency undetermined?
Based on the loop bounds there are two broad categories, which break down into three types:
a. The loop bound is a variable & HLS can determine the upper bounds of the loop.
b. The loop bound is a variable & HLS cannot determine the upper bound of the loop.
In all cases HLS can synthesize hardware to implement the loop. In the worst case, it will be a counter the size of the loop index variable.
For loop types 1 and 2a, HLS can determine how many iterations the loop will perform and able to report the loop latency, which is calculated as number of iterations * latency of the loop body. If required, it can unroll the loop since it knows how many copies of the loop body are required to implement the same functionality.
For type 2b, HLS will not be able to report the loop latency (since it does not know the number of iterations) and a question mark (?) will be shown in the report. In this case, the tripcount directive can be used to specify a value to be used for reporting.In addition, for type 2b, HLS will not be able to unroll the loop since it does not know how many copies of the loop body to create.