Importing HLS Kernels - 2020.2 English

Model Composer and System Generator User Guide (UG1483)

Document ID
UG1483
Release Date
2020-11-18
Version
2020.2 English

To import the HLS kernel as a block into Model composer, you need to select it from the AI Engine library.

Figure 1. HLS Kernel

Double-click the block symbol to display the parameters of the HLS kernel block as shown in the following figure.

Figure 2. HLS Kernel Parameters

The block mask parameters need to be updated in order to import the HLS kernel as a block. The following table provides details on the parameters and descriptions for each parameter.

Table 1. Parameters
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 Mandatory 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 an absolute path of the file.

If environment variables are used to specify the source file path, then an appropriate error is returned.

Specifies the search path for source files (.cc, .hpp) from the MATLAB current folder.

Kernel search paths Vector of Strings Optional If the kernel header file or the kernel source file is not found using the value provided through the Kernel header file or Kernel source file fields respectively, 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 ${ENV} or $ENV format.

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): -Dname and -Dname=definition. That is, the optional argument must begin with the -D string and if the option definition value is not provided, it is assumed to be 1.

After successful import, the Function tab GUI displays automatically. You can quickly review the HLS Kernel definition and ports as shown in the following figure.

Figure 3. Kernel Definition and Ports