Loop Merging - Exit Condition - 2022.2 English

Vitis HLS Messaging (UG1448)

Document ID
UG1448
Release Date
2022-12-16
Version
2022.2 English

Description

Warning: [200-945] Loop should have only have one exit point.

This message reports that the code is violating loop merging optimization rules.

Explanation

Loop merging optimization requires the loops to not have multiple exit conditions, as shown in the following code:

void example_label(int A[50], int B[50]) {
  int i=0;
#pragma HLS loop_merge force
  do{
 
     B[i] = A[i] + 5;
     if(B[i]==A[i]*B[i])
     {
         break;
     }
     else if (B[i] == A[i]+B[i])
     {
         break;
     }
  i++;
  }while(i<50);
 i=0;
  do{
  B[i] = A[i] + 5;
  i++;
  }while(i<50);

Solution

Make sure there is only one exit condition among the loops.