Cannot Apply Array Stencil Optimization - Cannot Apply Array Stencil Optimization - 2026.1 English - UG1448

Vitis HLS Messaging (UG1448)

Document ID
UG1448
Release Date
2026-06-23
Version
2026.1 English

Description

Warning: Cannot apply array stencil optimization to variable in loop because of unknown trip count of loop.

Explanation

Stencil optimization does not work for loops with variable iteration counts. To optimize these loops, use the 'tripcount' pragma to explicitly specify the loop's expected number of iterations.

stencil_label2:for (c=0; c<col_size-2; c++) {
#pragma HLS pipeline II=1
#pragma HLS array_stencil variable=O
                 temp = (DTYPE)0;
stencil_label3:for (k1=0;k1<3;k1++){
stencil_label4:for (k2=0;k2<3;k2++){
                 mul = F_buf[k1][k2] * O[r+k1][c+k2];