make xsa: Use Vitis Tools to Link AI Engine and HLS Kernels with the Platform - 2023.2 English

Vitis Tutorials: AI Engine (XD100)

Document ID
Release Date
2023.2 English

After the AI Engine graph and PL HLS kernels have been compiled, you can use the Vitis compiler to link them with the platform to generate an XSA file.

The Vitis tools allow you to integrate the AI Engine graph and HLS kernels into an existing extensible platform. This is an automated step from a software developer perspective 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 the Vitis tools build the hardware design and integrate the AI Engine and PL kernels into the design).

To test this feature in this tutorial, use the base VCK190 platform to build the design.

The command to run this step is shown as follows (default TARGET=hw_emu, N_FIR_FILTERS=1, N_FIR_TAPS=15, FIR_WINDOW_SIZE=256, EN_TRACE=0):

make xsa

The expanded command is as follows:

cd build/fir_$(N_FIR_TAPS)_taps/x$(N_FIR_FILTERS)_firs/winSz_$(FIR_WINDOW_SIZE)/x$(N_AIE_PER_FIR)_aie_per_fir/hw_emu

v++ 	-l 						\
	--platform xilinx_vck190_base_202320_1		\
	--save-temps 					\
	--temp_dir build/fir_$(N_FIR_TAPS)_taps/x$(N_FIR_FILTERS)_firs/winSz_$(FIR_WINDOW_SIZE)/x$(N_AIE_PER_FIR)_aie_per_fir/hw_emu/_x		\
	--verbose 					\
	-g 						\
	--clock.defaultTolerance 0.001 			\
	--clock.freqHz 300000000:datamover_0 		\
	--config $(SYSTEM_CONFIGS_REPO)/system.cfg 	\
	-t hw_emu 					\
	-o vck190_aie_fir.hw_emu.xsa  			\
	datamover.hw_emu.xo				\

If EN_TRACE is enabled, ensure that the following v++ flags are also set

	--profile.trace_memory DDR			\ datamover:datamover_0:all \ ai_engine_0.DataIn		\ ai_engine_0.DataOut

This flag captures the trace data for the ports specified.

Summary of the switches used:

Switch Description
--platform | -f Specifies the name of a supported acceleration platform as specified by the $PLATFORM_REPO_PATHS environment variable or the full path to the platform XPFM file.
--save-temps | -s Directs the v++ command to save intermediate files/directories created during the compilation and link process. Use the --temp_dir option to specify a location to write the intermediate files to.
--temp_dir This allows you to manage the location where the tool writes temporary files created during the build process. The temporary results are written by the Vitis compiler, and then removed, unless the --save-temps option is also specified.
--verbose Display verbose/debug information.
-g Generates code for debugging the kernel during software emulation. Using this option adds features to facilitate debugging the kernel as it is compiled.
--clock.freqHz \<freq_in_Hz>:\<cu>[.\<clk_pin>] Specifies a clock frequency in Hz and assigns it to a list of associated compute units (CUs) and optionally specific clock pins on the CU.
--config Specifies a configuration file containing v++ switches.
--target | -t [hw|hw_emu] Specifies the build target.
--output | -o Specifies the name of the output file generated by the v++ command. The linking process output file name must end with the .xsa suffix [|all]:[|all]:[|all](:[counters|all]) Enables monitoring of data ports through the monitor IPs. This option needs to be specified during linking. Detailed Profiling Options
--profile.trace_memory \<FIFO>:\<size>|\<MEMORY>[\<n>] When building the hardware target (-t=hw), use this option to specify the type and amount of memory to use for capturing trace data. Detailed Profiling Options

Detailed Description of All Vitis Compiler Switches Linking the Kernels in Vitis

Inputs Sources Description
datamover.hw/hw_emu.xo The data-mover kernel object file.
libadf.a Compiled AI Engine design graph
Output Objects Description
vck190_aie_fir.hw_emu.xsa Compiled Platform Binary Container
make application: Compile the Host Application