APU Software¶
This chapter describes the software that will be running on the APU (A53 cores) part of the Zynq US+ MPSoC. The APU software is responsible for processing the custom NVMe commands.
The firmware is available under alkali-csd-fw.
Building the APU software¶
To build the system and necessary software, follow alkali-csd-fw README.
APU base system¶
Linux Kernel linux-xlnx is used as the operating system for the APU. Buildroot is used to build all dependencies and utilities for the APU and creates rootfs.
The rootfs contains basic set of system utilities, APU and RPU applications.
uBPF Virtual Machine¶
uBPF Virtual Machine a user space software allowing execution of a BPF programs. the uBPF library is integrated with the APU application and is used to execute BPF payloads sent from the host. The capabilities of BPF programs can be easily extended by adding external functions that can be called from the BPF binary. Such functions are implemented in alkali-csd-fw/tree/main/apu-app/src/vm.
Currently, the BPF programs allow to delegate inference of TFLite models to the VTA delegate.
The example of such program is ADD runner in alkali-csd-projects project.
Userspace custom NVMe command handler¶
Userspace application is used to handle custom Accelerator-related NVMe commands. Communication with firmware running on the RPU is achieved by using rpmsg. All vendor specific commands detected by the firmware are passed through to this application.
The application is available in alkali-csd-fw/tree/main/apu-app.
Adding support for new NVMe commands¶
Adding support for additional commands is fairly simple.
Commands are dispatched by handle_adm_cmd
and handle_io_cmd
functions located in alkali-csd-fw/blob/main/apu-app/src/cmd.cpp.
To handle another command, simply expand the switch
responsible for calling handlers by calling your new handler and then send_ack
with proper ACK type (PAYLOAD_ACK_DATA
when command returns data, PAYLOAD_ACK
otherwise).
Buffer with the command will be provided using recv
and mmap_buf
represents buffer for data transferred to or from host.