make package: Package the Design - 2023.2 English

Vitis Tutorials: AI Engine

Document ID
Release Date
2023.2 English

With the HLS kernel outputs created, as well as the new platform, you can now generate the programmable device image (PDI) and a package to be used on an SD card. The PDI contains all executables, bitstreams, configurations of the device. The packaged SD card directory contains everything to boot Linux, the generated applications, and .xclbin.

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

make package


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

v++	-p  							\
	-t hw_emu						\
	--save-temps						\
	--temp_dir build/fir_$(N_FIR_TAPS)_taps/x$(N_FIR_FILTERS)_firs/hw_emu/_x			\
	-f xilinx_vck190_base_202310_1									\
	--package.rootfs $(COMMON_IMAGE_VERSAL)/rootfs.ext4 						\
	--package.kernel_image $(COMMON_IMAGE_VERSAL)/Image 						\
	--package.boot_mode=sd										\
	--package.out_dir build/fir_$(N_FIR_TAPS)_taps/x$(N_FIR_FILTERS)_firs/hw_emu/package	  	\
	--package.image_format=ext4									\
	--package.sd_file build/fir_$(N_FIR_TAPS)_taps/x$(N_FIR_FILTERS)_firs/hw_emu/fir_hls_xrt.elf    \
			  build/fir_$(N_FIR_TAPS)_taps/x$(N_FIR_FILTERS)_firs/hw_emu/vck190_hls_fir.hw_emu.xsa 	\
			  --package.sd_file design//exec_scripts/

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

	--package.sd_file design/profiling_configs/xrt.ini

This will include the XRT ini file which includes tracing parameters.

Switch Description
--package | -p Packages the final product at the end of the Vitis compile and link build process.
--target | -t [hw|hw_emu] Specifies the build target.
--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.
--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.
--package.sd_dir \<arg> Where specifies a folder to package into the sd_card directory/image. The contents of the directory are copied to a sub-folder of the sd_card folder.
--package.rootfs \<arg> Where \<arg> specifies the absolute or relative path to a processed Linux root file system file. The platform RootFS file is available for download from Refer to the Vitis Software Platform Installation for more information.
--package.kernel_image \<arg> Where \<arg> specifies the absolute or relative path to a Linux kernel image file. Overrides the existing image available in the platform. The platform image file is available for download from Refer to the Vitis Software Platform Installation for more information.
--package.boot_mode \<arg> Where \<arg> specifies Boot mode used for running the application in emulation or on hardware.
--package.image_format Where \<arg> specifies \<ext4|fat32> output image file format. ext4: Linux file system and fat32: Windows file system
--package.sd_file Where \<arg> specifies an ELF or other data file to package into the sd_card directory/image. This option can be used repeatedly to specify multiple files to add to the sd_card.

Detailed Description of All Vitis Compiler Switches Details of Packaging the System

Inputs Sources Description
$(COMMON_IMAGE_VERSAL)/rootfs.ext4 The Root Filesystem file for Petalinux.
$(PLATFORM_REPO_PATHS)/Image The pre-built Petalinux Image the processor boots from.
$(BUILD_TARGET_DIR)/fir_hls_xrt.elf The PS Host Application executables created in the make application step.
$(BUILD_TARGET_DIR)/vck190_hls_fir.hw_emu.xsa The XSA file created in the make xsa step.

The output of the V++ Package step is the package directory that contains the contents to run hardware emulation.

Output Objects Description
$(BUILD_TARGET_DIR)/package The hardware emulation package that contains the boot file, hardware emulation launch script, the PLM and PMC boot files, the PMC and QEMU command argument specification files, and the Vivado tools simulation folder.
make run_emu: Run Hardware Emulation