Overview
A configurable output stationary systolic array GEMM accelerator (D = AᵀB + C), implemented in RTL. The design is optimized for fully pipelined execution with high throughput and supports both integer and floating point FMA operations. The main goal is continuous GEMM streaming with minimal stalls, avoiding diagonal scheduling by using row/column major input streaming.
Architecture and dataflow
The accelerator is built around an output stationary systolic array, where partial sums remain in the processing elements while A and B are streamed through the array. Data is fed in row major streaming format. A small control block orchestrates load, compute, and drain phases, while a register file/SRAM bank enables operand reuse across cycles instead of repeatedly fetching from DRAM.
Memory and streaming model
The design supports flexible A, B, and C streaming modes, including preload and fully streamed C. Ping pong buffering is used in MAC PEs to overlap computation with memory transfers, ensuring the systolic array remains busy while the next tile is being prepared. This enables back to back GEMM execution with zero inter kernel stalls.
The array achieves nxn outputs every n cycles after pipeline fill. For instance for 4x4 matrices, the pipeline fills in 10 cycles and then produces one result once every 4 cycles. The design is fully pipelined and optimized for sustained throughput rather than single operation latency.
Verification
The design was verified using a Verilator based testbench against a NumPy golden reference model. Both integer and floating point modes were tested, with directed cases ensuring correctness across different matrix sizes and streaming configurations.
Hardware implementation
The accelerator was implemented on a Zynq-7020 FPGA to validate functionality in hardware. The Processing System communicates with the accelerator via AXI GP, while AXI HP is used for DRAM access. The design closes timing at 100 MHz and includes dedicated control logic for orchestration, along with buffering structures for data reuse and pipeline stability.