How foodinsect/mnist-cnn-fpga works
This is a Vivado/Zynq MNIST CNN accelerator project. The documented product workflow streams image pixels into FPGA logic, buffers them for convolution and pooling, computes class scores, and returns classifications over UART. The README also describes MATLAB host integration, AXI control, and simulation-only 1,000-image testing. The available tree lacks the RTL and MATLAB sources, so hardware stages and their links are represented from README documentation; the SDK application excerpt shows interrupt setup, but not the inference datapath. Generated files and the vendor BSP are not mapped as product subsystems.
Main entry points: helloworld.c UART output · design_1 On-chip BRAM
Components 16
Host and control
- SDK application
MNIST_CNN_FPGA.sdk/CNN/src/helloworld.c - AXI control
MNIST_CNN_FPGA.srcs/sources_1/bd/design_1
Image buffering
- On-chip BRAM
MNIST_CNN_FPGA.srcs/sources_1/bd/design_1 - Sliding window
MNIST_CNN_FPGA.srcs/sources_1/bd/design_1 - Shift buffers
MNIST_CNN_FPGA.srcs/sources_1/bd/design_1
CNN inference
- PE array
MNIST_CNN_FPGA.srcs/sources_1/bd/design_1 - Convolution
MNIST_CNN_FPGA.srcs/sources_1/bd/design_1 - ReLU
MNIST_CNN_FPGA.srcs/sources_1/bd/design_1 - Max pooling
MNIST_CNN_FPGA.srcs/sources_1/bd/design_1 - Feature FIFO
MNIST_CNN_FPGA.srcs/sources_1/bd/design_1 - Fully connected
MNIST_CNN_FPGA.srcs/sources_1/bd/design_1 - Digit result
MNIST_CNN_FPGA.srcs/sources_1/bd/design_1
Platform I/O
- UART output
MNIST_CNN_FPGA.sdk/CNN/src/helloworld.c
Other components
- MATLAB host
- Image pixels
- UART terminal
Connections 15
- MATLAB host → AXI control: streams images
- SDK application → AXI control: controls accelerator
- Image pixels → On-chip BRAM: loads pixels
- On-chip BRAM → Sliding window: fetches pixels
- Sliding window → Shift buffers: buffers rows
- Shift buffers → PE array: feeds pixels
- PE array → Convolution: computes features
- Convolution → ReLU: activates features
- ReLU → Max pooling: passes activations
- Max pooling → Feature FIFO: buffers features
- Feature FIFO → Fully connected: feeds classifier
- Fully connected → Digit result: outputs class
- Digit result → UART output: returns result
- UART output → UART terminal: prints result
- MATLAB host → UART output: receives results