Downloads · 30 days
0
walid0015/de10nano-mac-accelerator
de10nano-mac-accelerator is a machine learning model from walid0015. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A complete FPGA accelerator project for the Terasic DE10-Nano (Intel Cyclone V SoC) that implements a 16-unit parallel MAC (Multiply-Accumulate) array with DMA-based DDR3 data movement, controlled from Linux via memor…
Downloads · 30 days
0
Access
Public
Updated Apr 24, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.v62 KB · 45%
From the Hugging Face model README
A complete FPGA accelerator project for the Terasic DE10-Nano (Intel Cyclone V SoC) that implements a 16-unit parallel MAC (Multiply-Accumulate) array with DMA-based DDR3 data movement, controlled from Linux via memory-mapped registers.
┌─────────────────────┐ ┌─────────────────────────────┐
│ HPS (ARM Cortex-A9)│ │ FPGA Fabric │
│ │ │ │
│ Linux + C program │ LW H2F │ ┌───────────────────────┐ │
│ mmap(/dev/mem) ───┼──Bridge──┼──┤ mac_accelerator │ │
│ │ │ │ Registers + FSM + │ │
│ DDR3 (1GB) │ F2SDRAM │ │ DMA + 16× MAC + │ │
│ A[], B[] vectors ◄─┼──Bridge──┼──┤ BRAM + Reduce Tree │ │
│ │ │ └───────────────────────┘ │
└─────────────────────┘ └─────────────────────────────┘
NUM_MACS and everything adapts├── rtl/
│ ├── mac_unit.v — Single MAC: multiply + accumulate (DSP inference)
│ ├── mac_array.v — Parameterized array of N MAC units
│ ├── reduction_tree.v — Pipelined adder tree for partial sum reduction
│ ├── bram_buffer.v — Dual-port BRAM wrapper (M10K inference)
│ ├── accel_csr.v — Avalon-MM slave: control/status register file
│ ├── accel_dma.v — Avalon-MM master: DDR3 burst read/write engine
│ ├── accel_fsm.v — Master FSM: orchestrates fetch→compute→reduce
│ ├── mac_accelerator.v — Top accelerator module (Platform Designer component)
│ ├── de10nano_top.v — Board top-level: HPS + accelerator
│ └── tb_mac_accelerator.v — Full testbench with mock DDR3
├── sw/
│ ├── accel_driver.h — Register map + inline helper functions
│ ├── accel_test.c — HPS test program with verification & benchmarking
│ └── Makefile — Cross-compile for ARM Cortex-A9
├── qsys/
│ ├── mac_accelerator_hw.tcl — Platform Designer component description
│ └── soc_system_setup.md — Step-by-step Qsys configuration guide
├── scripts/
│ ├── pin_assignments.tcl — DE10-Nano FPGA pin assignments
│ ├── de10nano_accel.sdc — Timing constraints (50 MHz)
│ └── program_fpga.sh — Program FPGA from Linux
└── docs/
├── 00_ARCHITECTURE.md — Full system architecture + dataflow
├── 01_QUARTUS_FLOW.md — Complete build instructions
└── 02_SCALING.md — Scaling guide: more MACs, CSR/sparse
| Offset | Name | R/W | Description |
|---|---|---|---|
| 0x00 | CTRL | W | Bit 0: START, Bit 1: RESET |
| 0x04 | STATUS | R | Bit 0: BUSY, Bit 1: DONE, Bit 2: ERROR |
| 0x08 | ADDR_A | W | DDR3 physical address of vector A |
| 0x0C | ADDR_B | W | DDR3 physical address of vector B |
| 0x10 | ADDR_RESULT | W | DDR3 address for result writeback |
| 0x14 | VEC_LEN | W | Number of elements |
| 0x18 | RESULT_LO | R | Result lower 32 bits |
| 0x1C | RESULT_HI | R | Result upper 32 bits |
| 0x20 | NUM_MACS | R | Number of MAC units (hardware discovery) |
| 0x24 | VERSION | R | IP version |
| 0x28 | CYCLE_COUNT | R | Cycles for last operation |
5CSEBA6U23I7qsys/soc_system_setup.md.rbf filesw/accel_test.c for ARMdocs/01_QUARTUS_FLOW.mdChange one parameter to scale:
parameter NUM_MACS = 32 // in mac_accelerator.v
Everything adapts automatically. See docs/02_SCALING.md for CSR/sparse roadmap.
| Resource | Used | Available | % |
|---|---|---|---|
| ALMs | ~4,000 | 41,910 | 10% |
| DSP Blocks | 32 | 112 | 29% |
| M10K Blocks | 4 | 553 | <1% |
MIT