In a typical XRT-managed application, the host manages the start and
stop of a kernel using an XRT Run object from the xrt::run
class as described in Executing Kernels on the Device. In user-managed kernels, the start and stop mechanism
is different, but the kernel is still software controlled from the host application
using register read and write calls. These API calls are transferred into low-level
calls by XRT to start and stop the kernel, consuming a small amount of time to start or
stop the kernel on the hardware and incurring some overhead each time the kernel is
started. This overhead can be significant when the data is input to the kernel from
either Ethernet or SerDes, which work at a line-rate of 1000 GB/s.
However, streaming kernels that are data-driven such as the kernel described here, eliminate these low-level API calls and let the kernel react to the flow of data from the Ethernet or SerDes at the much higher data rates. The user-managed kernel described here is started once and automatically restarted as needed, and so is called a never-ending kernel. These kernels are executed in a purely data-driven mode with streaming data coming from and going to the I/O pins (Ethernet, SerDes) of the FPGA, or streamed from or to a different kernel (kernel-to-kernel streaming).
Because never-ending kernels are data-driven, with the operation of the kernel
dependent on the data stream, they do not need to be user-managed by the host
application beyond the initial start thus avoiding the overhead of repeated API calls
from the host program. These kernels require the ap_ctrl_chain
protocol specified by Vitis HLS, using the auto_restart
bit to
keep ap_start
high and to run the kernel continuously
once started, or until auto_restart
is reset. The host
application must manually enable the auto_restart
bit
as explained in Enabling Auto-Restart of User-Managed Kernels. The kernel
requirements are detailed in the following section.