make kernels: Compile PL Kernels - 2022.2 English

Vitis Tutorials: AI Engine Development

Document ID
XD100
Release Date
2022-12-01
Version
2022.2 English

In this step, the Vitis compiler takes any kernels (RTL or HLS C) in the PL region of the target platform (xilinx_vck190_base_202210_1) and compiles them into their respective XO files.

The following commands compiles the kernels (default TARGET=hw_emu, N_FIR_FILTERS=1, N_FIR_TAPS=15, EN_TRACE=0):

make kernels

The expanded command is as follows:

mkdir -p ../build/fir_hls_$(N_FIR_FILTERS)firs_$(N_FIR_TAPS)taps/hw_emu

cd ../build/fir_hls_$(N_FIR_FILTERS)firs_$(N_FIR_TAPS)taps/hw_emu

v++ --target hw_emu					\
   --hls.pre_tcl ./directives/hls_pre.tcl		\
	--hls.clock 500000000:fir_hls 			\
	--platform xilinx_vck190_base_202210_1		\
	--include ../../../design/pl_src 		\
	--save-temps 					\
	--temp_dir _x 					\
	--verbose 					\
	-g -c 						\
	-k fir_hls 					\
	../../../design/pl_src/fir_hls.cpp 		\
	-o fir_hls.hw_emu.xo   

v++ --target hw_emu					\
	--hls.clock 250000000:datamover 			\
	--platform xilinx_vck190_base_202210_1		\
	--save-temps 					\
	--temp_dir _x 					\
	--verbose 					\
	-g -c 						\
	-k datamover 					\
	../../../design/pl_src/datamover.cpp 		\
	-o datamover.hw_emu.xo   

Summary of the switches used: |Switch|Description| | — | — | |–target | -t [hw|hw_emu]|Specifies the build target.| |–hls.clock | Specifies a frequency in Hz at which the listed kernel(s) should be compiled by Vitis HLS. | |–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 Vitis compiler 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. | |–compile | -c|Required for compilation to generate XO files from kernel source files.| |–kernel <arg>|-k <arg>|Compile only the specified kernel from the input file. Only one -k option is allowed per Vitis compiler command.| |–output | -o|Specifies the name of the output file generated by the V++ command. The compilation process output name must end with the XO file suffix.|

Detailed Description of All Vitis Compiler Switches

Input Description
fir_hls.cpp The FIR filter chain PL kernel source code.
datamover.cpp The data-mover PL kernel source code.
Output Description
fir_hls.hw/hw_emu.xo The FIR filter chain PL kernel object file.
datamover.hw/hw_emu.xo The stream-to-memory-mapped data-mover kernel object file.
make xsa: Use Vitis Tools to Link HLS Kernels with the Platform