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:
- 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 global variable. - Click OK to add the directive to the source code or config file.