Array_stencil - Array_stencil - 2026.1 English - UG1399

Vitis High-Level Synthesis User Guide (UG1399)

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

Description

Enables automatic stencil window buffer inference on an array variable. Use #pragma HLS array_stencil variable=xxxoff to disable auto stencil on a variable in a loop.

Global Auto Control

config_array_stencil -throughput_driven <off|on>

Code Canonical Forms and Limitations:

  • Stencil optimization can only be applied to the top level.
  • Loop bounds need to be constant for multi-dimensional stencil patterns.
  • The pragma must be located within the loop.
  • The loop where stencil optimization is applied must require a pipeline pragma with II=1.
  • Stencil optimization requires nested loops to be perfect nested loops.
  • The access pattern should have a fixed pattern.
  • The access pattern order must follow the loop order, for example, it must have a loop increment +/- 1.

Syntax

Form Syntax
Pragma #pragma HLS array_stencil variable=<name> [off]
Config File Not available (pragma only)
Tcl Not available (pragma only)

#pragma HLS array_stencil variable=<name > <off>

Use "#pragma HLS array_stencil variable=xxx off" to disable auto stencil on a variable in a loop.

Options

variable=<name>

Specifies the array variable to apply stencil buffer inference to.

off

Disables auto stencil on the specified variable in a loop.