Configuring the HW-Link Project - 2021.2 English

Versal ACAP AI Engine Programming Environment User Guide (UG1076)

Document ID
UG1076
ft:locale
English (United States)
Release Date
2021-12-17
Version
2021.2 English

With the various domain application projects added to the top-level system project, only the connections between the AI Engine graph and the PL kernels need to be defined using the hw_link project. This project is automatically generated during the creation of the AI Engine graph project.

  1. Open the hw_link project by double-clicking on the project in the Explorer view. Right-click on the binary_container in the Hardware Functions window, and select the Edit V++ Options command.

  2. Edit the V++ Options field. It is important to add the correct path to the config file because the v++ command needs it for the Vitis IDE workspace.

  3. Import the specified config file into the hw_link project folder.

    Tip: The system configuration file is added to the hw_link project folder and not to a src folder.

    As explained in Linking the System, for AI Engine graph applications the Vitis compiler needs some instruction on how to connect PL kernels to the graph. The number of kernels to be instantiated is already configured in the IDE. However the definition of the connections between the PL kernels and the graph must be specified.

    For the Vitis IDE the following is an example configuration file:

    [connectivity]
    stream_connect=mm2s_1.s:ai_engine_0.DataIn1
    stream_connect=ai_engine_0.clip_in:polar_clip_1.in_sample
    stream_connect=polar_clip_1.out_sample:ai_engine_0.clip_out
    stream_connect=ai_engine_0.DataOut1:s2mm_1.s
    [advanced]
    param=compiler.addOutputTypes=hw_export

The connectivity sc option defines connections between the ports of the AI Engine graph and streaming ports of PL kernels. Connections can be defined as the streaming output of one kernel connecting to the streaming input of a second kernel, or to a streaming input port on an IP implemented in the target platform.

The system.cfg file has some differences between the Vitis IDE and the command-line flow as described in Linking the System. The primary difference is that the IDE provides the connectivity nk options of the config file, instantiating a specified number of compute units (CUs) per kernels, as specified in the build settings. In addition, the IDE uses a naming convention for CUs in the form <kernel>_#, where # indicates the CU instance. In the case where there is only one CU instance, it has the _1 extension. This means that for the Vitis IDE, the system.cfg should not specify the nk option, and the sc option should use the CU instance name from the IDE.