Skip to content
hw.dev
hw.dev/signal/systolic-cnn-pytorch-cocotb-check-2026
SignalSystolic CNN Accelerator

One Test Runs a CNN Accelerator Against Its Training Data

A Cocotb test now drives quantized PyTorch data through an entire accelerator core and compares the final 4 by 4 output.

Thesis connection

Chip designers can catch arithmetic and data-movement errors together when one software workload drives the complete simulated core.

#ai-hardware#eda#testing#verification
Read Original

This convolutional neural network (CNN) accelerator now runs the same quantized weights and inputs produced by its PyTorch training notebook through the complete simulated chip core. The test uses Cocotb, a Python framework that drives digital hardware simulations, to load both memories, execute all nine kernel positions, drain the output queues, accumulate a 4 by 4 result, and compare every final value.

The committed run covers 3,952 nanoseconds of simulated chip time in 6.405 seconds on the developer's computer, with one test and zero failures. That single path reaches the weight memory, activation memory, processing array, output queues, and final accumulator. It is much stronger than checking each block with unrelated sample values because a data-ordering error between blocks can now corrupt the same answer the software model expects.

One passing workload is not broad coverage, and the repository does not yet show this test running on every change. The next step is to put this exact case in continuous integration, then vary tensor values, saturation cases, and reset timing while keeping PyTorch as the independent reference.