/setup.sh
```
2. Generate the platform file (`xclbin`) with `v++` commands.
```bash
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
```
3. Optimize the design with the Vivado tool, and rewrite the routed DCP.
```bash
vivado -mode batch -source opt.tcl
```
4. Reuse the routed DCP to generate the device binary file (`.xclbin`).
```bash
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
```
5. 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.
```bash
#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
```
## Conclusion
This tutorial illustrated how to use the `v++` command `--vivado` option to control Vivado synthesis and implementation, using a simple example to optimize the design with the Vivado tool. It also showed the steps to reuse an implemented DCP to generate the device binary file (`.xclbin`), building the Vitis accelerated application from the optimized Vivado implementation.
Return to Main Page
Copyright© 2020-2022 Xilinx