Although the Vitis unified IDE 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 HLS component, 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:
- When you apply directives to functions, the HLS compiler 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
PIPELINEdirective, can be applied recursively through the hierarchy.
- The HLS compiler applies the directive to the top-level function, which is the scope that contains the interface.
- Directives apply to all objects within the scope of the loop.
For example, if you apply the
LOOP_MERGEdirective to a loop, the HLS compiler 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.
- Directives are applied to the scope that contains the array.