Evaluating the Functionality - 2024.1 English

Vitis Libraries

Release Date
2024-08-06
Version
2024.1 English

You can build the kernels and test the functionality through software emulation, hardware emulation, and running directly on supported hardware with the FPGA.

Software Emulation: Software emulation is equivalent to running a C-simulation of the kernel. The time for compilation is minimal, and is therefore recommended to be the first step in testing the kernel.

Hardware Emulation: Hardware emulation runs the test on the generated RTL after synthesis of the C/C++ code. The simulation, since being done on RTL requires longer to complete when compared to software emulation.

Testing on the Hardware: To test on hardware, the kernel must be compiled into a bitstream (building for hardware). This would consume some time since the C/C++ code must be converted to RTL, run through synthesis and implementation process before a bitstream is created. As a prerequisite the drivers must be installed for the corresponding XSA, for which the example was built.

Use the following commands to run PL tests:

For PCIe devices:

source < path-to-Vitis-installation-directory >/settings64.sh
source < path-to-XRT-installation-directory >/setup.sh
export PLATFORM=< path-to-platform-directory >/< platform >.xpfm
export OPENCV_INCLUDE=< path-to-opencv-include-folder >
export OPENCV_LIB=< path-to-opencv-lib-folder >
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:< path-to-opencv-lib-folder >
make host xclbin TARGET=< sw_emu|hw_emu|hw >
make run TARGET=< sw_emu|hw_emu|hw >

For embedded devices:

Software Emulation:

source < path-to-Vitis-installation-directory >/settings64.sh
source < path-to-XRT-installation-directory >/setup.sh
export PLATFORM=< path-to-platform-directory >/< platform >.xpfm
export OPENCV_INCLUDE=< path-to-opencv-include-folder >
export OPENCV_LIB=< path-to-opencv-lib-folder >
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:< path-to-opencv-lib-folder >
make run TARGET=sw_emu

Hardware Emulation and Hardware Build:

#Download the platform, and common-image from Xilinx Download Center. Run the sdk.sh script from the common-image directory to install sysroot using the command:
$ ./sdk.sh -y -d ./ -p

#Unzip the rootfs file
"gunzip ./rootfs.ext4.gz"

source < path-to-Vitis-installation-directory >/settings64.sh
export PLATFORM=< path-to-platform-directory >/< platform >.xpfm
export SYSROOT=< path-to-platform-sysroot >
make host xclbin TARGET=< hw_emu|hw >
make run TARGET=< hw_emu|hw > #This command will generate only the sd_card folder in case of hardware build.

Note. For hw run on embedded devices, copy the generated sd_card folder content under package_hw to an SD Card. More information on preparing the SD Card is available here. After successful booting of the board, run the following commands:

cd /mnt
export XCL_BINDIR=< xclbin-folder-present-in-the-sd_card > #For example, "export XCL_BINDIR=xclbin_zcu102_base_hw"
./run_script.sh