The following section summarizes all the steps to control the Vivado tool implementation with the v++
command, optimize design with the Vivado tools, and reuse implemented DCP to generate the platform file. You might use it as a quick reference for commands.
Set up the core development kit and working directory.
#setup Xilinx Vitis tools. XILINX_VITIS and XILINX_VIVADO will be set in this step. source <VITIS_install_path>/settings64.sh #Setup Xilinx runtime. XILINX_XRT will be set in this step. source <XRT_install_path>/setup.sh
Generate the platform file (
xclbin
) withv++
commands.v++ -t hw --config design.cfg -c -k apply_watermark -o apply_watermark.hw.xilinx_u200_gen3x16_xdma_2_202110_1.xo ../src/krnl_watermarking.cl v++ -t hw -s --config design.cfg -R2 -l -o apply_watermark.hw.xilinx_u200_gen3x16_xdma_2_202110_1.xclbin apply_watermark.hw.xilinx_u200_gen3x16_xdma_2_202110_1.xo
Optimize the design with the Vivado tool, and rewrite the routed DCP.
vivado -mode batch -source opt.tcl
Reuse the routed DCP to generate the device binary file (
.xclbin
).v++ -t hw --config design.cfg -l -o apply_watermark.hw.xilinx_u200_gen3x16_xdma_2_202110_1.xclbin apply_watermark.hw.xilinx_u200_gen3x16_xdma_2_202110_1.xo --reuse_impl ./_x/link/vivado/routed.dcp
This tutorial has provided host code to make it complete to run through various flows. The following commands are references to build the host and run the application.
#Generate the host executable. g++ -I$XILINX_XRT/include/ -I$XILINX_VIVADO/include/ -Wall -O0 -g -std=c++11 -L$XILINX_XRT/lib/ -lOpenCL -lpthread -lrt -lstdc++ -o 'host' '../src/host.cpp' #Please set correct XCL_EMULATION_MODE manually if running sw_emu and hw_emu modes ./host apply_watermark.hw.xilinx_u200_gen3x16_xdma_2_202110_1.xclbin ../src/inputImage.bmp ../src/golden.bmp