SW-Controllable Kernels - 2021.2 English

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

Document ID
English (United States)
Release Date
2021.2 English

Software controllable kernels expose a programmable register interface, allowing a host software application to interact with kernels through register reads and write. These are the most common and widely applicable types of kernels. There are two types of SW controllable kernels: user-managed and XRT-managed.

Note: XRT-managed kernels are a specialized form of user-managed kernels.

The primary difference between user-managed and XRT-managed kernels is related to the kernel execution mode. Because XRT relies on the ap_ctrl_chain and ap_ctrl_hs execution protocols generated by Vitis HLS, XRT-managed kernels are better for C++ developers as described in C/C++ Kernels and in Compiling Kernels with Vitis HLS. Alternatively, user-managed kernels can support many different user-defined execution protocols as found in existing Vivado RTL IP, and so are a better fit for RTL designers working with RTL Kernels.

The Vitis application acceleration development flow supports host programs written using the XRT native C/C++ API, which supports both user-managed kernels and XRT-managed kernels, as well as some advanced designs such as never-ending kernels. It also supports host applications using the OpenCL API for XRT-managed kernels. The next sections briefly describe the programming API and the different hardware interfaces required for XRT-managed or user-managed kernels.

Table 1. Software Control Using the XRT API
XRT-Managed Kernels User-Managed Kernels
  • The object class for an XRT-managed kernel is xrt::kernel
  • The software application communicates with the XRT-managed kernel using higher-level commands such as set_arg, run, and wait
  • The user does not need to know the low-level details of the programmable registers and kernel execution protocols
  • Control and status registers provide XRT with a known interface to interact with the kernel, which makes these high-level commands possible
  • If needed, it is also possible to control an XRT-managed kernel as a user-managed kernel (using atomic register reads and write)
  • OpenCL API can also be used with XRT-managed kernels (cl::kernel)
  • The object class for a user-managed kernel is xrt::ip
  • The software application communicates with the user-managed kernel using atomic register reads and writes through the AXI4-Lite interface
  • The application developer is responsible for knowing the address offset and purpose of each register in the kernel, and using them properly
  • There are no checks, high-level controls, or profiling capabilities. The user is responsible for running the simulations for performance analysis/debugging.