INT8 FPGA accelerator
A standalone signed INT8 accelerator with INT32 accumulation and an AXI4-Lite interface. Hardware schedules up to 16 × 16 output panels on the same 16-MAC array, reducing repeated transfers between Python and the simulated device.
- Array
- 4 × 4 signed INT8 MACs, INT32 accumulation
- Full panel
- 1.655× ideal / 1.906× stalled simulated-cycle ratio
- Workload
- 18,900 dense outputs match RTL; 440/450 digits correct
- Tools
- SystemVerilog, AXI4-Lite, Python, Verilator, Icarus Verilog, Yosys
Credit. The workload uses scikit-learn’s UCI digits dataset. This standalone design does not reuse NOVA, VexRiscv, LiteX, or an AMD DPU.
Reuse the operands.
Keep the array small.
The panel controller reuses A and B across 4 × 4 tiles. Each processing element forwards its inputs to a neighbor and keeps a signed INT32 sum.
AXI4-Lite writes load A and B. Reads return completed results.
MLP bias, ReLU, requantization, and argmax stay here.The datapath
Sixteen processing elements pass A values right and B values down, with lane skew so corresponding operands meet on the same clock. Each cell keeps its own signed INT32 sum. The AXI4-Lite slave accepts address and data separately, supports byte writes, and holds responses stable under backpressure.
The v2 design has 8 KiB of banked input storage and a 1 KiB result store. One command covers up to 16 rows and 16 columns, with a reduction depth of at most 256. Larger reductions return partial sums to Python, which accumulates them with wide integers and checks the final INT32 range.
Why larger panels help
The first driver reloads both operands for each 4 × 4 output tile. A stronger software-only baseline keeps operands resident and traverses the tiles in a serpentine order. The comparison uses that baseline so savings from better software are already accounted for.
For a 16 × 256 × 16 multiplication, the improved v1 driver writes 4,352 input words. The v2 panel scheduler needs 2,048. The arithmetic array still has 16 MACs; its per-tile core count actually rises from K + 8 to K + 9. Fewer loads and commands produce the gain.
Simulated results
Under the ideal bus profile, the full-panel case falls from 18,080 to 10,922 cycles, a 1.655× baseline-to-v2 ratio. With fixed bus stalls, it falls from 50,208 to 26,336 cycles, or 1.906×. These counts include input transfers, control, polling, computation, and output reads.
The benchmark contains 112 GEMMs across four configurations and two bus profiles. It includes a real single-MAC RTL engine with the same panel storage, bus, and driver. A separate replay reproduced 24 selected rows, including the unfavorable long-row case.
At 1 × 256 × 512, v2 is 3.40% slower under the ideal profile and 4.05% slower with stalls. Reloading the A row at panel boundaries outweighs the reduced command count. Short single-tile cases also regress. The full CSV retains every result.
Python execution, packing, and host-side arithmetic consume no modeled bus cycles between register operations. These ratios are not board latency, CPU speedups, or end-to-end inference time.
A two-layer INT8 workload
A 64 → 32 → 10 ReLU MLP runs on scikit-learn’s 8 × 8 digits dataset. Both dense layers execute through the production Python driver against clocked RTL. The second layer consumes activations derived from the first layer’s actual RTL outputs.
All 18,900 dense outputs match the independent integer reference. The host adds bias, applies ReLU and requantization, then performs the final argmax. Quantized predictions classify 440 of 450 held-out images correctly, or 97.78%.
The split uses 1,347 training images and 450 held-out images, randomly stratified with seed 260. Calibration uses only the training set. This is one documented split of the bundled digits dataset, not MNIST or a writer-disjoint benchmark. The float model gets 439/450; that one-image difference does not establish a general benefit from quantization.
Verification and hardware boundary
Independent numerical oracles check the RTL and driver. The core is cross-checked in Verilator and four-state Icarus simulation. Tests cover dimensions and signed extremes, bus stalls and byte strobes, reset and error handling, tails, repeated commands, and large reductions. Deliberately faulty RTL copies must fail active assertions. A local processing-element transition proof adds a narrowly scoped formal check.
The design has not run on a physical KR260. Vivado K26 synthesis, full-board integration, vendor place-and-route, timing signoff, a bitstream, and a matching Vitis build remain unperformed. Preliminary Yosys mapping is not a substitute for those checks.
Evidence
- Complete simulated benchmark CSV
- Full bank and bus architecture diagram
- MLP split, calibration, and fixture manifest
- Evidence notes and measurement scope
Dataset: Alpaydin and Kaynak, Optical Recognition of Handwritten Digits, UCI, distributed with scikit-learn under CC BY 4.0.