To import the HLS kernel as a block into Vitis Model Composer, you need to select it from the HLS/User-Defined Functions library.
Double-click the block symbol to display the parameters of the HLS kernel block as shown in the following figure.
The block mask parameters need to be updated to import the HLS kernel as a block. The following table provides details on the parameters and descriptions for each parameter.
Parameter Name | Parameter Type | Criticality | Description |
---|---|---|---|
Kernel header file | String | Mandatory | The name of the HLS kernel header file that contains the function
declaration. The string could be just the file name, a relative path to
the file, or an absolute path of the file. Use the
Browse button to select the
file. If environment variables are used to specify the header file path, then an appropriate error is returned. |
Kernel function | String | Mandatory | The name of the kernel function in C/C++ for which the HLS kernel block is to be created. |
Kernel source file | String | Optional | The name of the source file that contains the kernel function
implementation (definition). The string could be just the file name, a
relative path to the file or the absolute path of the file. You can
specify both the declaration and the definition of the function in the
header file and leave this field empty. If environment variables are used to specify the source file path, an appropriate error is returned. |
Kernel search paths | Vector of Strings | Optional | If the kernel header file or the kernel source file are not found using
in the current folder, then the paths provided in Kernel search paths are used to
locate the files. This parameter allows use of
environment variables while specifying paths for the kernel header
file and the kernel source file. The environment variable can be
used in either |
Preprocessor options | Optional | Optional preprocessor arguments for downstream
compilation with specific preprocessor options. The
following two preprocessor option formats will be accepted (multiple
can be selected): |
After successful import, the Function tab GUI displays automatically. You can quickly review the HLS Kernel definition and specify the directionality of the ports from the drop-down as shown in following figure.
When you click the Build button after specifying the directionality of the ports, a new window opens as shown in the following figure. Do not forget to set the Signal size appropriately for stream signal types or else you might run into a memory overflow. For example, if at every invocation, the kernel produces 16 samples, set Signal Size to 16.