XRT and AI Engine Driver - 2024.1 English

AI Engine System Software Driver Reference Manual (UG1642)

Document ID
Release Date
2024.1 English

The Xilinx Runtime (XRT) stack offers a unified API for accessing both the AMD Versal™ FPGA and AI Engine. It incorporates multi-process/thread safe core APIs that support various functions, including partial reconfiguration, memory management, data communication, and kernel scheduling.

Within the XRT stack, there is a command line tool known as the xclbinutil utility. This utility serves several purposes, such as generating kernel binaries (xclbin), packaging the kernel binaries, signing them, and inspecting their contents. The xclbin file encompasses the AI Engine configuration PDI and associated metadata.

To configure both the AI Engine and FPGA, the XRT kernel driver utilizes the FPGA manager integrated into the Linux kernel. Meanwhile, host applications utilize XRT tools to generate kernel binaries that encompass both programmable logic (PL) kernels and AI Engine PDI, complete with configuration data and the kernel ELFs. The following figure shows the AIE-XRT runtime stack for Linux:

Figure 1. XRT Software Stack

In Linux operating systems, the XRT API controls the AI Engine graph and PL kernels. The following figure shows the APIs and drivers required in this system. XRT manages hardware resources from Linux kernel. AI Engine kernel driver provides kernel APIs for XRT kernel module to enquire for AI Engine partitions, request AI Engine partitions and registers for errors notification. After AI Engine is configured, XRT uses AI Engine userspace driver to control AI Engine at runtime and AI Engine kernel APIs to do runtime control, update runtime parameters, and transfer data. As the AI Engine runtime control is included in the control cpp file generated by AI Engine compiler, XRT does not care about the AI Engine control details. In a bare-metal or standalone environment, AMD provides standalone board support package (BSP), drivers, and libraries for applications to use to reduce development effort. In the case of bare-metal, PS application is written with ADF APIs to use AI Engine.

Figure 2. Linux Runtime Software Stack – AI Engine

Figure 3. Bare-metal Runtime Software Stack – AI Engine