syn.directive.latency - 2025.2 English - UG1702

Vitis Reference Guide (UG1702)

Document ID
UG1702
Release Date
2025-11-20
Version
2025.2 English

Description

Specifies a maximum or minimum latency value, or both, on a function, loop, or region.

Vitis HLS always aims for minimum latency. The following illustrates the behavior of the tool after specifying minimum and maximum latency values.

  • Latency is less than the minimum: If Vitis HLS can achieve less than the minimum specified latency, it extends the latency to the specified value. This action can enable increased sharing.
  • Latency is greater than the minimum: The constraint is satisfied. The tool performs no further optimizations.
  • Latency is less than the maximum: The constraint is satisfied. The tool performs no further optimizations.
  • Latency is greater than the maximum: If Vitis HLS cannot schedule within the maximum limit, it increases effort to achieve the specified constraint. If it still fails to meet the maximum latency, it issues a warning. Vitis HLS then produces a design with the smallest achievable latency.
Tip: You can also use syn.directive.latency to limit the efforts of the tool to find an optimum solution. Specify latency constraints for scopes within the code. Loops, functions, or regions, reduces the possible solutions within that scope and can improve tool compilation time. Refer to the Improving Synthesis Runtime and Capacity section of the Vitis High-Level Synthesis User Guide (UG1399) for more information.

To limit the total latency of all loop iterations, apply the latency directive to a region that encompasses the entire loop. For example: syn.directive.latency Region_All_Loop_A max=10

Region_All_Loop_A: {
Loop_A: for (i=0; i<N; i++) 
  { 
  ..Loop Body... 
  }
}

In this case, even if the loop is unrolled, the latency directive sets a maximum limit on all loop operations.

Syntax

syn.directive.latency=[OPTIONS] <location>
  • <location> is the location (function, loop or region) (in the format function[/label]) to be constrained.

Options

max=<integer>
Limits the maximum latency.
min=<integer>
Limits the minimum latency.

Examples

Function foo has a minimum latency of 4 and a maximum latency of 8.

syn.directive.latency=min=4 max=8 foo

In function foo, loop loop_row is specified to have a maximum latency of 12.

syn.directive.latency=max=12 foo/loop_row