LOOP REWIND - Return Type - 2020.2 English

Vitis HLS Messaging (UG1448)

Document ID
UG1448
Release Date
2020-11-24
Version
2020.2 English

Description

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

Explanation

For the loop rewind optimization, the function return should be void or should have a return statement.

The following example will fail optimization.

int decoderInput(hls::stream<mag_type> &inputStream, hls::stream<dataPair> &pairedData)//, hls::stream<int> &windex)
{
    static count_type cnt;
    mag_type val, val_next;
    dataPair tempData;
    int n=0;
        decoderInput_whileloop:while(1)
        {
    #pragma HLS PIPELINE II=1 rewind
            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

The loop rewind optimization would need the function return type a void or have a return statement.