For in-depth end-to-end instructions check our tutorials.
- Learn how to combine Tensil and TF-Lite to run YOLO on Ultra96
- Learn Tensil with ResNet and PYNQ Z1
- Learn Tensil with ResNet and Ultra96
- Learn how to build speech controlled robot with Tensil and Arty A7 - Part I
- Learn how to build speech controlled robot with Tensil and Arty A7 - Part II
- Getting Tensil to run ResNet at 300 FPS on ZCU104
For reference documentation see our website.
- Pull and run Tensil docker container (see below);
- Download and install Xilinx Vitis or Vivado;
- Download and install Xilinx PYNQ for your FPGA development platform;
- Copy Tensil PYNQ driver
drivers/tcu_pynq
to/home/xilinx/tcu_pynq
on your FPGA development platform.
docker pull tensilai/tensil
docker run -u $(id -u ${USER}):$(id -g ${USER}) -v $(pwd):/work -w /work -it tensilai/tensil bash
Compile AI/ML model (ResNet20 v2 CIFAR) for specific TCU architecture and FPGA development platform, PYNQ Z1 in this example.
tensil compile -a /demo/arch/pynqz1.tarch -m /demo/models/resnet20v2_cifar.onnx -o "Identity:0" -s true
tensil compile -a /demo/arch/pynqz1.tarch -m /demo/models/resnet20v2_cifar.pb -o "Identity" -s true
tensil emulate -m resnet20v2_cifar_onnx_pynqz1.tmodel -i /demo/models/data/resnet_input_1x32x32x8.csv
Make Verilog RTL for specific TCU architecture and FPGA development platform, PYNQ Z1 in this example.
tensil rtl -a /demo/arch/pynqz1.tarch -s true
Create Vivado design for specific FPGA development platform. We include detailed steps in our PYNQ Z1 tutorial. If you get stuck, we can help! Please reach out to us at [email protected] or in Discord.
Use PYNQ and Jupyter notebooks to run AI/ML model on FPGA. (See in notebooks
.)
- Download and install OpenJDK 11 from Azul;
- Download and install Verilator;
- Download test models:
wget https://github.com/tensil-ai/tensil-models/archive/main.tar.gz
tar xf main.tar.gz
mv tensil-models-main models
rm main.tar.gz
./mill rtl.run -a ./arch/pynqz1.tarch -s true
./mill compiler.run -a ./arch/pynqz1.tarch -m ./models/resnet20v2_cifar.onnx -o "Identity:0" -s true
./mill emulator.run -m resnet20v2_cifar_onnx_pynqz1.tmodel -i ./models/data/resnet_input_1x32x32x8.csv
./mill __.test -l org.scalatest.tags.Slow
To run a single RTL test in, for example, the Accumulator module, and also output a VCD file, do:
./mill rtl.test.testOnly tensil.tcu.AccumulatorSpec -- -DwriteVcd=true -z "should accumulate values"
To view the latest VCD file generated:
./scripts/gtkwave/display-latest-vcd.py
To view a specific VCD file:
./scripts/gtkwave/display-vcd.sh <vcd_file>
docker build -f docker/web/Dockerfile -t tensil-web-compiler .
aws ecr get-login-password | docker login --username AWS --password-stdin <ACCOUNT ID>.dkr.ecr.<REGION>.amazonaws.com
docker tag tensil-web-compiler <ACCOUNT ID>.dkr.ecr.<REGION>.amazonaws.com/tf2rtl-web-compiler
docker push <ACCOUNT ID>.dkr.ecr.<REGION>.amazonaws.com/tf2rtl-web-compiler
- Say hello and ask a question on our Discord
- Email us at [email protected]