Description
Warning: [200-958] Unable to
rewind loop %s: function has no return.
This message reports that the code
is violating loop rewind optimization rules.Explanation
Loop rewind optimization requires the function return to either be void or 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 requires the function return type to either be void or have a return statement.