How jiajun-ji/cnn_accelerator works
This repository is a KV260 FPGA accelerator demo for quantized CNN inference. Its documented workflow runs a model in the PYNQ/Python environment, keeps feature maps and parameters in shared DDR, and offloads convolution/pooling and dense operations to FPGA IP; software can handle unsupported layers. The tree includes HLS operator sources and generated driver/interconnect code, but not the documented PYNQ project sources or image-format-conversion implementation. Consequently, several deployment links below are documented rather than source-verified.
Main entry points: Conv_core.cpp Convolution and pooling · layers.py Layer dispatch · dense.cpp Dense accelerator · design_1_zynq_ultra_ps_e_1_0.cpp Zynq MPSoC
Components 13
Inference deployment
- PYNQ inference
- Layer dispatch
Direct_run/layers.py
HLS operators
- Convolution and pooling
Project/HLS_Project/Conv_Pool_OP/Conv_Pool_int16/Conv_Pool/Conv_core.cpp - Convolution compute
Project/HLS_Project/Conv_Pool_OP/Conv_Pool_int16/Conv_Pool/Compute.cpp - Pooling core
Project/HLS_Project/Conv_Pool_OP/Conv_Pool_int16/Conv_Pool/Pool_core.cpp - Dense accelerator
Project/HLS_Project/Dense_OP/dense/dense/dense.cpp - Image format conversion
FPGA platform
- Shared DDR
- Convolution IP driver
Project/HLS_Project/Conv_Pool_OP/Conv_Pool_int16/Conv_Pool/solution9/impl/ip/drivers/My_Conv_v10_120/src/xmy_conv.c - Dense IP driver
Project/HLS_Project/Dense_OP/dense/dense/solution1/impl/ip/drivers/Dense_v1_35/src/xdense.c - Zynq MPSoC
Project/Vivado_Project/lenet3/lenet2.gen/sources_1/bd/design_1/ip/design_1_zynq_ultra_ps_e_1_0/sim/design_1_zynq_ultra_ps_e_1_0.cpp - AXI interconnect
Project/Vivado_Project/lenet3/lenet2.gen/sources_1/bd/design_1/ip/design_1_smartconnect_0_2/xtlm/smartconnect_xtlm.h
Other components
- Model operator
Connections 14
- Model operator → PYNQ inference: runs inference
- PYNQ inference → Layer dispatch: dispatches layers
- PYNQ inference → Shared DDR: shares tensors
- Layer dispatch → Convolution and pooling: offloads conv/pool
- Layer dispatch → Dense accelerator: offloads dense
- Layer dispatch → Image format conversion: offloads conversion
- Shared DDR → Convolution and pooling: provides data
- Shared DDR → Dense accelerator: provides data
- Convolution IP driver → Convolution and pooling: controls IP
- Dense IP driver → Dense accelerator: controls IP
- Zynq MPSoC → Shared DDR: hosts shared memory
- Zynq MPSoC → AXI interconnect: connects via AXI
- Convolution compute → Convolution and pooling: computes convolution
- Pooling core → Convolution and pooling: implements pooling