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

Vitis Tutorials: AI Engine

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

After the 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 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 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, EN_TRACE=0):

make xsa

The expanded command is as follows:

cd build/fir_$(N_FIR_TAPS)_taps/x$(N_FIR_FILTERS)_firs/hw_emu

v++ -l 				\
	--platform xilinx_vck190_base_202310_1 		\
	--include design/pl_src 		\
	--save-temps 					\
	--temp_dir build/fir_$(N_FIR_TAPS)_taps/x$(N_FIR_FILTERS)_firs/hw_emu/_x \
	--verbose 					\
	-g 						\
	--clock.defaultTolerance 0.001 			\
	--clock.freqHz 300000000:datamover_0 		\
	--clock.freqHz 500000000:fir_hls_0 		\
	--config design/system_configs/system.cfg 	\
	--vivado.prop run.synth_1.{STEPS.SYNTH_DESIGN.ARGS.CONTROL_SET_OPT_THRESHOLD}={16} \
	--advanced.param compiler.userPostSysLinkOverlayTcl=$(DIRECTIVES_REPO)/post_sys_link.tcl \
	-o vck190_hls_fir.hw_emu.xsa  		\
	datamover.hw_emu.xo					\
  	fir_hls.hw_emu.xo

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

	--profile.trace_memory DDR			\
	--profile.data datamover:datamover_0:all \
	--profile.data fir_hls:dir_hls_0:all

By enabling EN_TRACE=1 timing violation occurs for 10 filters,tolerance of WNS=-0.050 is set:

--xp param:compiler.worstNegativeSlack=-0.050

This 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
--profile.data [|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.
fir_hls.hw/hw_emu.xo The FIR filter chain PL kernel object file.
Output Objects Description
vck190_hls_fir.hw_emu.xsa Compiled Platform Binary Container
make application: Compile the Host Application