Applying Optimization Directives to Global Variables - 2021.2 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
Release Date
2021-12-15
Version
2021.2 English
Directives can only be applied to scopes, or to objects within a scope. As such, they cannot be directly applied to global variables which are declared outside the scope of any function. Therefore, to apply a directive to a global variable you must manually assign it using the following process:
  1. With the code open in the Code Editor, select the scope (function, loop or region) where the global variable is used in the Directive view.
  2. Right-click and use the Insert Directive command to open the Vitis HLS Directives Editor.
  3. Select and configure the required directive, and click OK to add it.
  4. Locate the added directive in the Directive view, and manually edit the variable name to assign it to the global variable.