For both hardware and hardware emulation, the
--package command takes the XCLBIN file and libadf.a as input, produces a script to launch hardware emulation
(launch_hw_emu.sh), and writes the
required support files. An example command line follows:
v++ --package --config package.cfg ./aie_graph/libadf.a \ ./project.xclbin -o aie_graph.xclbin
option specifies a configuration file with the following options:
platform=xilinx_vck190_base_202120_1 target=hw_emu save-temps=1 [package] boot_mode=sd out_dir=./emulation enable_aie_debug=1 rootfs=<path_to_platform>/sw/versal/xilinx-versal-common-v2021.2/rootfs.ext4 image_format=ext4 kernel_image=<path_to_platform>/sw/versal/xilinx-versal-common-v2021.2/Image sd_file=host.exe
The following table explains the options for both hardware and hardware emulation.
|Command-line Flag||Hardware||Hardware Emulation||Details|
||Target platform||Target platform||Either a base platform, or a custom platform that meets AI Engine flow requirements.|
||Specifies the hardware emulation build target.
||Causes the Vitis compiler to save intermediate files created during the build and package process.|
|boot_mode 1||sd||sd||Indicates the device boots from an SD card or from a QSPI image in
flash memory. Values can be:
|out-dir||<path>||<path>||Specifies a directory where output files should be created. If
|kernel_image||<path>/Image||<path>/Image||Specifies the image file that is specified as part of the linking command. The file here should be the same for both targets.|
|rootfs||<path>/rootfs.cpio||<path>/rootfs.cpio||Specifies the path to the Root FS file that is requires as part of the linking command. The file should be the same for both targets.|
||Generate debug features for the AI Engine kernels. This can be used in both hardware and emulation builds.|
||The AI Engines will be enabled by the PS application. When unset, generate the CDO commands to enable AI Engines during PDI load instead. Only valid if libadf.a is an input file and the platform is of a Versal platform.|
||Used only for bare-metal designs. Automatically programs the PS core
to run. For example,
||Specifies the domain to be run. For AI Engine
designs, this should always be
||Copies the ELF for the main application that will run on the Cortex-A72 processor for bare metal, and any files needed to run on Linux. The XCLBIN file is automatically copied to the out-dir or sd_card folder. To have more files copied to the sd_card folder, you must specify this option multiple times.|
The following table shows the output defined by
-out-dir produced when building for both hardware and
For hardware emulation, the key output file is the launch_hw_emu.sh script used to launch emulation.
The sd_card.img image includes the BOOT.BIN (U-Boot to boot Linux, PDI boot data,
etc.), Image (kernel image), XCLBIN file, user application (host.exe), and other files. For example, all
generated files are placed in a folder called
To use the sd_card.img file on a Linux host, use the dd command to write the image to the SD card. If you are targeting Linux but with package.image_format=fat32, copy the sd_card folder to an SD card formatted for FAT32. This is not needed for hardware emulation.
sd_cardoutput, however, it is not incorporated into the
rootfs. If you want to include the executable images in
rootfs, you must rebuild the
rootfsbefore running the
If the design needs to be programmed to a local flash memory, make sure
--package.boot_mode qspi is used. This allows
the use of the
program_flash command or the use
of the Vitis IDE to program the device or program the flash
memory, described in Using the Vitis IDE.