Unroll Infinite Loop - 2020.1 English

Vitis HLS Messaging (UG1448)

Document ID
UG1448
Release Date
2020-06-03
Version
2020.1 English

Description

This message is to inform the user that the code is violating loop unrolling optimization rules.

Explanation

Unroll optimization creates a set of parallel resources on teh hardware to execute. If the loop is not bounded then the tool would not know the number of resources to be creates. The example shown below fails loop optimization.

decoderInput_whileloop:while(1)
        {
    #pragma HLS unroll
            if(!inputStream.empty())
            {
                if(cnt==0)
                {
                     tempData.even = inputStream.read();
                     cnt =1;
                }
                else
                {
                    tempData.odd=inputStream.read();
                    pairedData.write(tempData);
                    cnt=0;
                }
            }
            else
            {
                break;
 
            }

Solution

To completely unroll the loop, consider making the loop finite.