Performance Pragma - 2 - 2022.1 English

Vitis HLS Messaging (UG1448)

Document ID
UG1448
Release Date
2022-06-22
Version
2022.1 English

Description

Warning: [HLS 214-345] Cannot apply performance pragma for loop 'VITIS_LOOP_11_1' in function 'top' due to existence of imperfect loop nest (test.cpp:12:9).

Explanation

Performance pragma can only support perfect nested loops. Imperfect loops are not supported. In addition, there should not be any dataflow regions inside these nested loops.

//////////// ORIGINAL ////////////
#include<string.h>
void top(int a[500],
    int b[500], int n) {
  int a_buf[50][10];
  int b_buf[50][10];
  memcpy(a_buf, a, sizeof(int) * 500);
  memcpy(b_buf, b, sizeof(int) * 500);
  int k;
  int i;
  int j;
    for (i =0; i < 50; ++i)  {
#pragma HLS PERFORMANCE target_ti=50
      for (j = 0; j < n; j++) {
#pragma HLS loop_tripcount max=10
#pragma HLS pipeline II=1
        a_buf[i][j] = b_buf[i][j]+ 4;
      }
      for (j = 0; j < n; j++) {
#pragma HLS loop_tripcount max=10
#pragma HLS pipeline II=1
        a_buf[i][j] += 4;
      }
    }
  memcpy(a, a_buf, sizeof(int) * 500);
}