Step 5: Create the System Project - 2023.2 English

Vitis Tutorials: AI Engine

Document ID
XD100
Release Date
2023-11-29
Version
2023.2 English

The System project is where the different components that you have built so far are integrated into a single system as described in Creating a System Project for Heterogeneous Computing. The AI Engine component, the HLS components, and the Application component are integrated into the system project using the following steps.

  1. From the main menu select File > New Component > System Project

This opens the Create System Project wizard on the Name and Location page.

  1. Enter the Component name as system_project (default), enter the Component location as the workspace (default), and click Next.

This opens the Select Platform page.

  1. On the Select Part page select the xilinx_vck190_base_20xxx0_1 platform and click Next to open the Embedded Component Paths page.

The Embedded Component Paths page lets you specify the path to the Sysroot, RootFS, and Image for the embedded processor platform as described at Installing Embedded Platforms. Enter the following choices and click Next to proceed:

Kernel Image: <path-to-common-files>/Image
Root FS: <path-to-common-files>/rootfs.ext4
Sysroot: <path-to-common-files>/sysroots/cortexa72-cortexa53-xilinx-linux

TIP: You can enable the Update Workspace Preference checkbox to add the settings to any component or project that uses the specified platform as explained in Embedded Component Paths.

  1. Review the Summary page and click Finish to create the defined System project.

The System project vitis-sys.json file is opened in the center editor, and the project is added to the Vitis Components Explorer.

After creating the System project, you need to configure it. You must define which of the components in the current workspace should be added to the System. In this case, all the components are to be added.

Unified IDE - System Project Binary

Under the Hardware Linker Settings in the open vitis-sys.json file, start by selecting the + command next to the Binary Containers. This lets you add a binary container when one doesn’t exist. Accept the default name binary_container_1 and select both the HLS components that are displayed: mm2s and s2mm. This creates the binary container for the System project and lets you add HLS components at the same time.

Expand the Binary Container and scroll down to the AIE Graphs and select + to select and add the aie_component.

Select the hw_link/binary_container_1-link.cfg to edit the configuration file containing commands that determine how the hw_link process will run and the how device binary will be generated. The Config File Editor opens and displays the V++ Linker Settings. Look through the settings to see what is available. In the lower half of the Config File Editor is a Kernels Data section that lets you specify the number of CUs for each kernels, or the naming convention applied. You can also enable profiling options for when the device is run.

Select the Source Editor command to see the text form of the Config File Editor.

The design features a number of PL kernels as well as the AI Engine graph. You need to tell the linker how to connect the AI Engine array to PL and vice versa. You will need to replace the current lines in the config file:

[connectivity]
nk=mm2s:1:mm2s_1
nk=s2mm:1:s2mm_1

With the following lines:

[connectivity]
nk=mm2s:1:mm2s
nk=s2mm:1:s2mm
sc=mm2s.s:ai_engine_0.DataIn1
sc=ai_engine_0.DataOut1:s2mm.s
Option/Flag Description
nk Specifies the number of instantiations of the kernel as described in Creating Multiple Instances of a Kernel.
stream_connect/sc Specifies the connections to be made between streaming outputs and inputs as described in Specifying Streaming Connections.

NOTE: For ai_engine_0 the streaming input and output names are provided in the graph.h, for example:

in = adf::input_plio::create("DataIn1", adf::plio_32_bits,"data/input.txt");

Close the Config File Editor and return to the System project.

Click the link for the Package Settings config file, package/package.cfg. The packaging process creates the packaged SD card directory and contains everything needed to boot Linux and run your generated application and device binary.

Unified IDE - System Project Package

Examine the file, scroll down to the AI Engine settings. Select the checkbox for Do Not Enable Cores to prevent the AI Engine from starting before the Application begins. Switch to the text view of the package.cfg file and ensure it has the defer_aie_run=true statement in it.

Close the package.cfg file when you are finished.

Finally, you can add the host application to the System project. Select the Add Existing Component link under the Component heading. Select the Application component to add. Add the host application.

The System project is now fully defined.