How ucb-bar/gemmini works
Project Type and Purpose
• Gemmini is a hardware‐accelerator generator and full‐stack DNN evaluation platform built on the Chipyard ecosystem.
• It uses Chisel (Scala DSL) to describe a RoCC accelerator that plugs into a RISC-V Rocket or BOOM core tile, enabling exploration of systolic‐array designs, DMA engines, scratchpads, and custom instructions for DNN workloads.
File Structure Analysis
• Top-level directories:
• .github/ and CI scripts—deployment and testing workflows (Verilator, Spike).
• modeling/—static performance modeling (Timeloop integration).
• scripts/—build helpers for ONNX and training/inference images.
• software/—C libraries, test suites, ONNX-Runtime port, shell wrappers.
• src/main/scala/gemmini/—Chisel RTL modules (controllers, mesh, DMA, scratchpad, FIFO queues, TLB).
• src/test/scala/gemmini/—unit tests for RTL components.
• Build/config: build.sbt, project/, Scala style configs.
Key Architectural Insights from README
• Gemmini is a decoupled access/execute accelerator with three controllers: ExecuteController (systolic array + transposer), LoadController (DMA in to scratchpad/accumulator), and StoreController (DMA out + optional max-pooling).
• Private memories: Scratchpad (inputType banks) and Accumulator (accType banks + adders/scalers/activations).
• Systolic array organized as MeshWithDelays → Tiles → PEs, supporting weight- or output-stationary dataflows.
• Custom ISA: mvin/mvout, config_*, matmul.preload/compute, and higher-level CISC loop instructions.
• Connectivity: Gemmini attaches via the Rocket Chip RoCC interface to the TileLink system bus, sharing the L2 cache and memory‐subsystem.
• Labels: use clear, descriptive names (e.g., “ExecuteController”, “Scratchpad Bank”).
• Another for memory elements (SRAM banks, caches).
• A third for interconnect/bus.