// Read settings
std::string binaryFile = "./vadd.xclbin";
auto xclbin = xrt::xclbin(binaryFile);
int device_index = 0;
std::cout << "Open the device" << device_index << std::endl;
auto device = xrt::device(device_index);
std::cout << "Load the xclbin " << binaryFile << std::endl;
auto uuid = device.load_xclbin(binaryFile);
In the Vitis application acceleration development flow you must specify a Xilinx device binary file, or xclbin
. This is an executable to be loaded into the Xilinx device and run by the accelerator card or platform. You must also identify the Xilinx device to load the xclbin into. In some systems there may be multiple accelerator cards with multiple devices. So you must specify the device as well as the xclbin
.
There are a number of ways to identify both the device and binary file during execution. You can hard code them, as has been done for the device in this tutorial, specify them from the command line as as been done for the .xclbin
file here, or you can specify them in other ways as demonstrated in the Vitis_Accel_Examples.
In the code example above, taken from the user-host.cpp
file in this tutorial, the device is simply device_index
0, and the binary file is passed from the command line. The code:
Identifies the Xilinx binary file:
xrt::xclbin(binaryFile)
Opens the device:
xrt::device(device_index)
Loads the xclbin into the device:
device.load_xclbin(binaryFile)