How eevaain/tiny-tpu works
Project type and purpose
• This is a hardware-design project written in SystemVerilog that implements a minimal Tensor Processing Unit (TPU) featuring a weight-stationary systolic array.
• Purpose: to perform efficient matrix multiplications via a 2×2 grid of Processing Elements (PEs), orchestrated by a Control Unit, with on-chip Unified Buffer and Weight Memory for data storage and a DMA interface for external I/O.
File structure
• Top-level files:
• Makefile, .gitignore, README.md (project metadata)
• .gtkw files under root (GTKWave configurations for inspecting various modules)
• img/ (architecture and PE illustrations)
• src/ (all RTL modules):
• control_unit.sv
• tpu.sv (top-level TPU wrapper)
• tt_um_tpu.sv (probably a test-top or unified-module wrapper)
• dma.sv (external memory interface)
• unified_buffer.sv
• weight_memory.sv
• input_setup.sv
• mmu.sv (Matrix Multiply Unit wrapper that instantiates PEs and accumulators)
• processing_element.sv
• accumulator.sv
• test/ (unit tests and dump scripts):
• dump_*.sv (Verilog dump benches per module)
• test_*.py (pytest harness)
README for additional insights
• The README defines the high-level architecture:
1. Control Unit
2. Unified Buffer
3. Weight Memory
4. Input Activation Setup
5. Matrix Multiply Unit (2×2 PEs + 2 accumulators)
6. Interface (DMA)
• Data-flow steps and instruction set (LOAD_ADDR, LOAD_WEIGHTS, LOAD_INPUT, COMPUTE, STORE_RESULTS, NOP) are described.