In development
DigitCore
FPGA Convolutional Neural Network Accelerator
Hardware acceleration for artificial intelligence through digital design.
DigitCore is a personal project in development. Its goal is to design and implement a hardware accelerator that can run convolutional neural network inference on an AMD Xilinx FPGA. Handwritten digit recognition using the MNIST dataset is the first planned application.
The challenge is mapping the mathematical operations of a trained model onto a specialised VHDL architecture. The project will explore parallelism, numerical representation and resource optimisation.
Proposed architectureMotivation
Studying computer engineering gave me a grounding in AI, computer vision, computer architecture and high-performance computing. With DigitCore I want to understand how AI algorithms translate into specialised digital circuits.
I want to explore how to run those algorithms with limited resources and understand the trade-offs between throughput, numerical precision, latency and hardware resource use. This project will let me practise VHDL and AMD Xilinx FPGA development, focusing on digital system design, integration, optimisation and verification.
Technical objectives
- Train a convolutional neural network in Python with Keras.
- Implement the mathematical inference operations explicitly in NumPy.
- Quantise weights, biases and activations using fixed-point arithmetic.
- Design the hardware modules for inference in VHDL.
- Explore sequential and parallel processing architectures.
- Implement pipelining strategies.
- Build an automated verification environment with Python and cocotb.
- Synthesise and implement the design for an AMD Xilinx FPGA using Vivado.
- Analyse how accuracy, latency, throughput and hardware resource use interact.
Proposed architecture
Training will run in software. The trained model’s weights and biases will be extracted and quantised for VHDL inference on the FPGA.
- MNIST datasetHandwritten digit images
- TrainingCNN in Keras
- ExtractionWeights and biases
- QuantisationFixed-point arithmetic
- InferenceVHDL RTL on FPGA
- PredictionSelected class
An image through the CNN
- Input28 × 28 pixel image
- Convolution3 × 3 filters
- ReLUActivation
- Max PoolingSpatial downsampling
- FlattenMaps to vector
- Dense layersScore per class
- ArgmaxDigit selection
From software to hardware
Each reference model will help isolate calculation, quantisation and RTL implementation errors during verification.
- Keras
Reference model
Train the CNN and extract the model parameters.
- NumPy
Mathematical inference
Express each inference operation directly in NumPy.
- NumPy
Quantised arithmetic
Match the planned circuit’s word lengths, precision, rounding and arithmetic behaviour.
- VHDL
RTL implementation
Design compute units, memories, registers, state machines and control logic.
- cocotb
Hardware/software verification
Automatically compare Python reference outputs with the signals from the VHDL simulation.
Hardware design and optimisation
The same CNN can map to different compute architectures. FPGA resources, dependencies between operations, memory bandwidth and timing constraints will shape the choice.
Sequential architecture
One MAC unit computes and accumulates each product over successive clock cycles.
| Unit | Cycle A | Cycle B | Cycle C |
|---|---|---|---|
| MAC | w₁ × x₁ | w₂ × x₂ | w₃ × x₃ |
Parallel architecture
Multiple units compute products concurrently. A reduction stage combines the partial products.
| Unit | Cycle A | Cycle B |
|---|---|---|
| Unit 1 | w₁ × x₁ | ReductionΣ |
| Unit 2 | w₂ × x₂ | |
| Unit 3 | w₃ × x₃ |
Parallelism and pipelining
Splitting computation into stages lets different inputs advance through the pipeline concurrently. Register timing and dependencies between stages will be studied.
- Multiply
- Accumulate
- Activation
Hardware resources to study
Verification and communication between hardware and software
GHDL will simulate the VHDL circuits. From Python, cocotb will drive images and circuit signals, retrieve predictions and compare outputs with the mathematical reference model. GTKWave will help inspect signals and their timing.
- TestbenchPython and cocotb · images and stimuli
- RTL simulationGHDL · VHDL signals
- ComparisonSimulated prediction against NumPy reference
Possible UART extension
The first version can be completed using simulation and synthesis. UART is a possible extension for a later board demonstration, where an external application could send images and receive results.
Planned evaluation
Inference quality
- Classification accuracy on MNIST
- Impact of quantisation
- Agreement between software and hardware outputs
Design cost
- Inference latency and clock cycle count
- Processing throughput
- Achievable operating frequency
- DSP, LUT, register and BRAM utilisation
- Trade-offs between performance and available resources
Vivado synthesis and timing analysis will provide resource and timing estimates. If a board is available, measured latency and throughput will be documented separately with the test conditions.
Technologies
Artificial intelligence and mathematical processing
Digital design and hardware
Simulation and verification
Engineering and development
Current status and roadmap
The project is at an early stage of learning, research and architecture definition.
- VHDL, FPGA and digital design trainingEarly stage
- CNN training and evaluationPlanned
- Mathematical inference implementationPlanned
- Quantisation and reference modelPlanned
- Hardware architecture developmentPlanned
- Simulation and functional verificationPlanned
- Synthesis, analysis and optimisationPlanned
- Demonstration and technical documentationPlanned