◉ Pulse
YutongChenVictor avatar
#9 today

YutongChenVictor/NPU-E2E

Verilog Tool #axidma #deep-learning #fpga #npu

End-to-End NPU: RTL systolic array → AXI4 SoC → TVM compiler → FPGA inference

Created Jul 29, 2026
Stars
13
Today
+13
Forks
1
Quality
100/100
Momentum
21

README

Fetched from GitHub on Oct 30, 2026, 9:24 PM UTC · README.md

View original on GitHub

Third-party content — Open Source Pulse is not the owner of this repository.

This README belongs to YutongChenVictor/NPU-E2E and its contributors. We fetch it directly from the project’s public GitHub repository and display it for reference only. All text, code, images and trademarks remain the property of their respective authors. See the repository for its license terms. Copyright / takedown policy.

NPU Design

中文

An educational full-stack NPU accelerator demo: end-to-end from 16×16 systolic array RTL design, AXI4 SoC integration, C/Python runtime, UART serial driver, and TVM BYOC compiler backend to neural network inference.

NPU_design/
├── systolic_array/         ← RTL + testbenches + SoC integration
│   ├── rtl/                7 compute modules + define.vh
│   ├── soc/                9 SoC integration modules (DMA, regfile, AXI4)
│   ├── tb/                 17 self-checking testbenches + golden model
│   ├── spec/               module specifications (CN/EN)
│   └── principles/         systolic array architecture principles (CN/EN)
├── compiler/               ← ML compiler toolchain
│   ├── cosim/              RTL co-simulation harness (Python + Verilog)
│   ├── runtime/            C runtime + Python reference + UART serial driver
│   ├── tvm_npu/            TVM BYOC target + codegen
│   └── spec/               compiler specification

├── DEPENDENCIES_CN.md / DEPENDENCIES_EN.md   dependency list (CN/EN)
└── README.md               this file

systolic_array — 16×16 Weight-Stationary Systolic Array

Compute Core (rtl/)

Module Description
pe.v Processing element (INT8 MAC + data forwarding)
systolic_array.v 16×16 PE grid (generate-loop)
systolic_array_ctrl.v 3-state FSM (IDLE/COMPUTE/DRAIN)
ifmap_buffer.v Dual-buffer with per-row skew chain
weight_buffer.v Dual-buffer with row/column dual read
accumulator.v Cross-tile accumulator + output buffer
systolic_array_top.v System top (dual-skew aligned + streaming I/O)

SoC Integration (soc/)

Module Description
npu_soc_top.v NPU SoC top-level (DMA + SA + stream adapters)
reg_file.v Control/status register file
axi4_lite_regfile.v AXI4-Lite → register file bridge
dma_engine.v DMA controller (protocol-agnostic)
axi4_mem_bridge.v AXI4 memory bridge
axi4_dma_wrapper.v AXI4 DMA wrapper (engine + bridge)
stream_splitter.v DMA byte stream → ifmap/weight dual streams
result_packer.v SA wide result → DMA byte stream
npu_uart_bridge.v UART → AXI4-Lite bridge for embedded control

Quick Start

# Run the full SoC cosim (requires Icarus Verilog 12)
cd compiler/cosim
make test_M8_K64_N8

# Run a single testbench
cd systolic_array
iverilog -I rtl -o pe_tb.out rtl/pe.v tb/pe_tb.v && vvp pe_tb.out

# Generate test vectors
python tb/test_vectors/golden_model.py gen

compiler — ML Compiler Toolchain

Component Description
cosim/ Python test generation + cosim_tb.v + Makefile
runtime/npu_runtime.c C bare-metal GEMM runtime
runtime/npu_serial.py Python UART serial driver
tvm_npu/python/ TVM BYOC target, codegen, and setup
e2e_pipeline.py End-to-end cosim pipeline

Quick Start

# Python-only reference
python compiler/runtime/npu_runtime.py check

# C runtime integration test
gcc -std=c99 -Wall -Wextra -O2 -DTEST_NPU_RUNTIME \
    -o npu_test compiler/runtime/npu_runtime.c && ./npu_test

# TVM BYOC setup
python compiler/tvm_npu/python/setup_tvm_npu.py

Test Results

All 17 testbenches passing (iverilog simulation) across PE, SA, buffer, accumulator, golden model, SoC integration, DMA engine, and AXI4 bridge levels.

Hardware Verification

Deployed and verified on real silicon — XCZU4EV-SFVC784-1-I FPGA board, clocked at 175 MHz.

Item Specification
Chip Xilinx Zynq UltraScale+ XCZU4EV
Clock Frequency 175 MHz
FPGA Toolchain Vivado 2023.2 (recommended)
Peak Throughput 256 MAC × 175 MHz = 44.8 GMAC/s (INT8)
Peak OPS 512 OPS × 175 MHz = 89.6 GOPS
Power 2.1 W (NPU logic only)
Efficiency 21.3 GMAC/s/W

LeNet-5 Handwritten Digit Recognition (32×32 → 10 classes)

  • TVM Backend: Relax IR → FuseOpsByPattern → npu_gemm() calls — full BYOC pipeline verified on hardware
  • Direct Invocation: No TVM dependency; hand-written C calling npu_runtime.c GEMM interface — also verified
  • Model: Conv1(1→6, 5×5) → Pool → Conv2(6→16, 5×5) → Pool → FC(256→120) → FC(120→84) → FC(84→10)
  • Inference latency (Python cycle model estimate): 655 SA calls, 875k cycles, 5.0 ms @ 175 MHz (NPU compute only)
  • End-to-end latency (measured on FPGA): 5.1 ms over PCIe/ETH; ~1 s over UART

Transport Comparison (single 32×32 image)

Transport End-to-End Measured Latency Notes
UART (115200 baud) ~1 s Debug/low-speed control; serial transfer
PCIe 5.1 ms DMA transfer; compute and transport decoupled
Ethernet 5.1 ms Raw UDP frames; compute and transport decoupled

License

GNU AGPLv3 — see LICENSE.


Document Version: v0.8.0 | Last Updated: 2026-07-29

Rendered by GitHub from the repository’s README. Scroll to read the full file.
First trending

Jul 29, 2026

first spotted on the list

Best rank

#9

highest position reached

Appearances

2

times on the trending list

Quality score

100

out of 100

Momentum

21

trend strength indicator

Star velocity

0.14

stars per day since creation

Activity — last 60 days

daily counts, collected every 6 hours
  • Stars
  • Forks
  • Merged PRs
  • Issues
  • Closed issues

Collecting activity data since launch — check back in a few days.

Star history

total stars per snapshot
891011121314YutongChenVictor/NPU-E2E · Jul 29, 2 PM UTC: 9 starsYutongChenVictor/NPU-E2E · Jul 30, 2 AM UTC: 13 stars2 PM8 PM2 AM

Rank history

position on trending · lower is better
#1#8#10#12#14#16#18#20Jul 29, 2 PM UTC: rank #19Jul 30, 2 AM UTC: rank #92 PM8 PM2 AM

3D card for your website

Live HTML card with a glass surface and pointer tilt. Paste the iframe on any website.

<iframe src="https://www.notionpulse.cc/embed/YutongChenVictor/NPU-E2E" width="420" height="240" style="border:0;max-width:100%;background:transparent" loading="lazy" title="YutongChenVictor/NPU-E2E — trending on Open Source Pulse"></iframe>

Stars badge

Show current stars in your README or profile. Auto-updates every 6 hours.

YutongChenVictor/NPU-E2E stars badge
Markdown
[![YutongChenVictor/NPU-E2E](https://www.notionpulse.cc/api/badge/YutongChenVictor/NPU-E2E.svg)](https://www.notionpulse.cc/repo/YutongChenVictor/NPU-E2E)
HTML
<a href="https://www.notionpulse.cc/repo/YutongChenVictor/NPU-E2E"><img src="https://www.notionpulse.cc/api/badge/YutongChenVictor/NPU-E2E.svg" alt="YutongChenVictor/NPU-E2E stars badge" /></a>

Repository of the Day

#9 Repository of the Day

Repository of the Week

#9 Repository of the Week

Repository of the Month

#9 Repository of the Month