
The Approximate MAC Coprocessor is a physical-design-focused Tiny Tapeout submission that explores area and power reduction for "Smart Dust" Edge AI applications. It implements a 4-tap Finite Impulse Response (FIR) DSP engine controlled via a lightweight SPI bus.
To maximize silicon area efficiency on the SkyWater 130nm node, this design time-multiplexes a single Approximate Multiply-Accumulate (MAC) unit. By structurally removing the 4x4 LSB multiplication array, the design intentionally trades a mathematically acceptable amount of precision for a massive reduction in dynamic power and gate count.
SCLK, MOSI, MISO, CS_N), making it compatible with almost any microcontroller.The SPI interface uses a simple command-byte framing structure. Pull CS_N low to initiate a transaction.
0x01)Send the 0x01 command followed by four 8-bit coefficients. The FSM will store them in taps C0 through C3 and return to the IDLE state.
[0x01] -> [C0] -> [C1] -> [C2] -> [C3]0x02)Send the 0x02 command. Keep CS_N low and stream continuous 8-bit data samples. For every byte sent, the hardware computes the 4-tap accumulation and shifts out the upper 8 bits of the previous computation cycle.
[0x02] -> [Data0] -> [Data1] -> [Data2] ...[ junk ] -> [ junk ] -> [Out 0] -> [Out 1] ...A standard 8x8 multiplication generates a 16-bit product. To save gates, this design splits the 8-bit inputs into 4-bit nibbles (High and Low) and omits the Low-Low multiplication entirely:
Exact: (A_hi * B_hi)<<8 + (A_hi * B_lo)<<4 + (A_lo * B_hi)<<4 + (A_lo * B_lo)
Approximate: (A_hi * B_hi)<<8 + (A_hi * B_lo)<<4 + (A_lo * B_hi)<<4
This results in a slight underestimation of the true product, which acts as acceptable noise in signal filtering applications (like IIR/FIR sensor smoothing) while drastically shrinking the physical footprint of the multiplier logic.
See the repository's tb.py file for a full Cocotb test suite. The testbench automatically issues SPI transactions to load coefficients, streams data, and asserts that the RTL output matches a software-calculated mathematical approximation model.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | SCLK (SPI Clock) | MISO (SPI Data Out) | unused |
| 1 | MOSI (SPI Data In) | DEBUG_STATE_LOAD | unused |
| 2 | CS_N (SPI Chip Select) | DEBUG_STATE_STREAM | unused |
| 3 | unused | unused | unused |
| 4 | unused | unused | unused |
| 5 | unused | unused | unused |
| 6 | unused | unused | unused |
| 7 | unused | unused | unused |