In the Vitis HLS Directive Editor dialog box, you can specify either of the following Destination settings:
- Directive File
- Vitis HLS inserts the directive as a Tcl command into the file directives.tcl in the solution directory.
- Source File
- Vitis HLS inserts the directive directly into the C source file as a pragma.
The following table describes the advantages and disadvantages of both approaches.
Directive Format | Advantages | Disadvantages |
---|---|---|
Directives file (Tcl Script) |
Each solution has independent directives. This approach is ideal for design exploration. If any solution is re-synthesized, only the directives specified in that solution are applied. |
If the C source files are transferred to a third-party or archived, the directives.tcl file must be included. The |
Source Code (Pragma) |
The optimization directives are embedded into the C source code. Ideal when the C sources files are shipped to a third-party as C IP. No other files are required to recreate the same results. Useful approach for directives that are unlikely to change, such as TRIPCOUNT and INTERFACE. |
If the optimization directives are embedded in the code, they are automatically applied to every solution when re-synthesized. |
When specifying values for pragma arguments, you can use literal values (for example, 1, 55, 3.14), or pass a macro using #define. The following example shows a pragma with literal values:
#pragma HLS ARRAY_PARTITION variable=k_matrix_val type=cyclic factor=5
This example uses defined macros:
#define E 5
#pragma HLS ARRAY_PARTITION variable=k_matrix_val type=cyclic factor=E