Host Software¶
This chapter describes the software that will be used on the host PC. The host software will communicate with the target platform using the NVMe interface.
It is located in alkali-csd-projects/tree/main/host-app.
Building the app¶
The host application is a simple C program that uses reads, writes and ioctls to communicate with the accelerator. To build it, run:
git clone https://github.com/antmicro/alkali-csd-projects.git
cd alkali-csd-projects
make host-app
To build the host application along with additional files needed to run an example, run:
EXAMPLE=add make example/build
For more details check Running examples section of alkali-csd-projects README.
Using the app¶
The easiest way to use the application is to utilize the wrapper script which is located in the alkali-csd-projects/tree/main/host-app directory:
cd host-app
./run.sh <path to NVMe device> <path to BPF source file> <input file> <output file>
The example of ADD operation can be executed with make
in the root alkali-csd-projects
:
EXAMPLE=add NVME_DEVICE=/dev/<nvmedevice> make example/load
Where:
/dev/<nvmedevice>
is the path to the NVMe accelerator,EXAMPLE
is the example available under alkali-csd-projects/tree/main/examples/tflite_vta/addexample/load
is a target building the example and running therun.sh
script to send data to process to the accelerator.
The results will be stored in build/examples/add/output.bin
.
The program that is running in the accelerator is alkali-csd-projects/blob/main/examples/tflite_vta/add/bpf.c. It is a simple C file that contains the BPF program that will be built using clang.
It runs a sample alkali-csd-projects/blob/main/examples/tflite_vta/add/model.tflite TFLite model on VTA accelerator on input specified in the alkali-csd-projects/blob/main/examples/tflite_vta/add/input-vector.bin.