Skip to content

JochiSt/AI_FPGA

Repository files navigation

AI_FPGA

Goal is to run a Tensorflow / Keras ANN on an FPGA using HLS4ML.

Setup

create virtual environment

python3 -m venv HLS4ML
. HLS4ML/bin/activate

install requirements

For an convinient usage, there is a requirements.txt file in this repository. This can be easily installed via

pip install -r requirements.txt

Notes:

If you are using python 3.10, installation of the ONNX package is not possible per default. This solution suggests adding a CMAKE ARG before the installation.

export CMAKE_ARGS="-DONNX_USE_PROTOBUF_SHARED_LIBS=ON"
pip install -r requirements.txt

By this the installation is successful.

Installation Xilinx Vivado 2020.1

If the installation seems to be on hold, fake /etc/os-releases to a version, which is officially supported by Xilinx see this answer record

If the installation stops on generating the installed hardware list - this answer records helped me - and I generated this list manually after the installer exits.

Install Digilent Board files

This manual from Digilent helped me to install the Board Files from Digilent.

HLS4ML Tutorial

There is a HLS4ML tutorial focusing on HEP. This is based on: Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC v2019.2 (64-bit)

References

[1] https://fastmachinelearning.org/hls4ml/ [2] https://jiafulow.github.io/blog/2021/02/17/simple-fully-connected-nn-firmware-using-hls4ml/