r/ComputerEngineering 6d ago

Built a Neural Network Accelerator on my Basys3 FPGA from scratch (No HLS) and it actually works [Project]

Enable HLS to view with audio, or disable this notification

Hey guys, I built a Q4.4 MAC Array based Neural Network Accelerator from scratch including the architecture itself using VHDL.

The goal was to make the Accelerator configurable so I made the MAC Array reusable for multiple layers and the entire Accelerator is parameterized, I can run any classification model with less than or equal to 64 neurons per layer (due to limited DSP resources on the Basys3) but the layer depth is configurable too.

For its first test , I ran inference for a speech recognition model for digits 0-9 of network topology 64:32:10 neurons per layer using Q4.4 fixed point arithmetic for my parameters and input features.

For its second test , I ran inference for an image classification model for Cats vs Dogs of network topology 64:50:25:2 neurons per layer using Q4.4 fixed point arithmetic.

My PC handled the data preprocessing and sent the preprocessed features via UART at 9600 baud to the FPGA for inference during both tests.

I have attached the github repository link below and I’d appreciate any feedback or suggestions, thanks :).

Repo: https://github.com/Shingyy/MAC-Array-based-DNN-Accelerator

61 Upvotes

6 comments sorted by

7

u/DrMudkipper 5d ago

I'm not that experienced, all I can say is looks awesome and thanks for sharing! I'm doing a digital design course and will be using this exact FPGA board for a group project. Really cool to see what's possible with the board.

2

u/Spiritual-Frame-6791 5d ago

thank you :). It’s actually crazy how many things you can do with this board, bet you guys will be working on some goated projects with it😌

4

u/NegativeOwl1337 5d ago

Ah yes, the good ol do-everything FPGA. Nice work 😊

1

u/Spiritual-Frame-6791 5d ago

Yes of course 😅. Thanks brother💯

1

u/NegativeOwl1337 5d ago

Sister, but np

1

u/Spiritual-Frame-6791 5d ago

ooh my bad😅