Applying Directives to the Proper Scope - 2021.2 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
Release Date
2021-12-15
Version
2021.2 English

Although the Vitis HLS GUI lets you apply directives to specific code objects, the directives are added to the scope that contains the object. For example, you can apply the INTERFACE pragma to an interface object in the Vitis HLS GUI, but the directive is applied to the top-level function (scope). The interface port (object) is identified in the directive.

You can apply optimization directives to the following objects and scopes:

Functions
When you apply directives to functions, Vitis HLS applies the directive to all objects within the scope of that function. The effect of any directive stops at the next level of the function hierarchy, and does not apply to sub-functions.
Tip: Directives that include a recursive option, such as the PIPELINE directive, can be applied recursively through the hierarchy.
Interfaces
Vitis HLS applies the directive to the top-level function, which is the scope that contains the interface.
Loops
Directives apply to all objects within the scope of the loop.

For example, if you apply the LOOP_MERGE directive to a loop, Vitis HLS applies the directive to any sub-loops within the loop, but not to the loop itself. The loop to which the directive is applied is not merged with siblings at the same level of hierarchy.

Arrays
Directives are applied to the scope that contains the array.