Interoperability with XO and RTL Kernels - 2022.1 English

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document ID
UG1393
Release Date
2022-05-25
Version
2022.1 English
Important: There is no software emulation support for the XO design flow described here.

Vitis System Compilation mode can also be used with standard Vitis kernels (.xo) and the application acceleration design flow. Therefore, you can use VSC with Vitis HLS C++ kernels, as described in Vitis High-Level Synthesis User Guide (UG1399), and RTL kernels, as described in Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393).

Figure 1. XO Flow

Given a VSC accelerator code, sc_acc.cpp, and a Vitis kernel, kernel.xo, the following would be the command lines required to build the project:

v++ -c sc_acc.cpp -o sc_acc.o
v++ -l sc_acc.o kernel.xo -o hw.xclbin # also produces hw.o
 
g++ -c host.cpp -o host.o
g++ -l -o host.exe host.o sc_acc.o hw.o -lvpp_acc -lxrt_hw -lpthread

In the scenario as it has been described, the kernel.xo is already compiled. So, the VSC accelerator code (sc_acc.cpp) needs to be compiled as shown in the first v++ command above. The output of this is the object file sc_acc.o. The v++ command recognizes the VSC accelerator code, and compiles it properly into the object file.

The v++ --link command is then run to link the .xo and .o files into the .xclbin. Notice that this produces a hw.o file in addition to the hw.xclbin file. The hw.o file is required for compilation of the host application by the g++ command as is shown in the next steps.

The g++ command compiles the host code, and then links the various object files (host.o, sc_acc.o, and hw.o) to produce the host.exe executable. Notice the addition of the vpp_acc and the xrt_hw libraries to the g++ command line as they are required for the linking process.

In a standard Vitis flow, using native-XRT or OpenCL code, the user host code has to explicitly load the .xclbin. In a mixed VSC-XO flow the user host code can still load the .xclbin explicitly, but is not required. Instead, the device-ID can be obtained by calling API vpp::sc::get_xrt_device().

Buffers objects can be easily passed between the native XRT and VSC APIs. The two possible buffer transfer scenarios are described in the following sections.