Optimization directives can be also applied to objects or scopes defined in a class. The difference is typically that classes are defined in a header file. Use one of the following actions to open the header file:
- From the
Vitis Component
Explorer view open the
Includes
folder for an HLS component and double-click the header file to open it. Or, from within an open source code file, place the cursor over the#include
statement for the header file, hold down the Ctrl key, and click the header file to open it in the Code Editor. - With the source code, open the HLS Directive editor
- Select the scope (function, loop or region) where the global variable is used in the Directive editor.
- Select Add Directive and edit the
variable
name to assign it to the class or variable. - Click OK to add the directive to the source code or config file.
CAUTION:
Care should be taken when applying directives as pragmas to a
header file. The file might be used by other people or used in other projects. Any
directives added as a pragma are applied each time the header file is included in a
design.