2. Use V++ to Link AI Engine and HLS Kernels with the Platform - 2023.2 English

Vitis Tutorials: AI Engine

Document ID
Release Date
2023.2 English

After the AI Engine kernels, graph, PL kernel, and HLS kernels have been compiled and simulated, you can use v++ to link them with the platform to generate an .xsa.

Section 2

v++ lets you integrate your AI Engine, HLS, and RTL kernels into an existing extensible platform. This step is where the platform chosen is provided by the hardware designer (or you can opt to use one of the many extensible base platforms provided by AMD and have v++ build the hardware design for you in addition to integrating the AI Engine and PL kernels in the design.

You have a number of kernels at your disposal, but you need to tell the linker how you want to connect them together (from the AI Engine array to PL and vice versa). These connections are described in a configuration file: system.cfg, shown below.

Option/Flag Description
nk Specifies the number of instantiations of the kernel. For example, nk=mm2s:1:mm2s means that the kernel mm2s will instantiate one kernel with the name mm2s.
stream_connect/sc Specifies the streaming connections to be made between PL/AI Engine or PL/PL. In this case, it should always be an output of a kernel to the input of a kernel.

NOTE: The v++ command line can get cluttered, and using the system.cfg file can help contain it.

For ai_engine_0 the names are provided in the graph.h. For the design, as an example, this line:

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

has the name DataIn1 which is the interface name.

You can see the v++ switches in more detail in the Vitis Unified Software Platform Documentation.

To build the design run the follow command:

make xsa


v++ -l --platform -t sw_emu $PLATFORM_REPO_PATHS/xilinx_vek280_es1_base_202320_1/xilinx_vek280_es1_base_202320_1.xpfm s2mm.xo mm2s.xo libadf.a --save-temps -g --config system.cfg -o tutorial.xsa
Flag/Switch Description
--link/-l Tells v++ that it will be linking a design, so only the *.xo and libadf.a files are valid inputs.
--target/-t Tells v++ to build to software emulation (which will build the emulation models).
--platform Same as the previous two steps.
--config This allows you to simplify the v++ command line if it gets too unruly and have items in an .ini style file.

Now you have a generated .xsa that will be used to execute your design on the platform.