At AI = 0.5 MACs/byte, even a 4-wide SIMD accelerator is mostly waiting for memory. To get a real speedup, we either:
Increase AI — tile the computation so weights are reused (keep them in a local BRAM buffer instead of fetching from DMEM every time).
Increase bandwidth — use a wider bus or DMA.
Project 3's accelerator does option 1: a local weight buffer reduces DMEM traffic.
From profiling data to accelerator spec
A useful back-of-envelope: how fast do we need the accelerator to be?
Target: < 100 ms total inference (target 10× speedup over your measured baseline).
Conv2D dominates (>90% of runtime). After acceleration it should drop to < 10 ms:
With a 4-wide int8 MAC array running at 27 MHz with local BRAM weight buffering:
4 MACs/cycle × 27M cycles/s = 108M MACs/s
Conv2D is compute-bound (weight buffer eliminates memory bottleneck)
Expected layer speedup: ~4× (matching the MAC-array width)
Because Conv2D is >90% of runtime, Amdahl's law gives:
Conclusion: a 4-wide MAC array with local BRAM buffering gives ~3× system speedup — meaningful and achievable. The local weight buffer is the architectural decision that matters most: without it, the MAC array is memory-bound and the speedup collapses.
Amdahl's Law — applied to your numbers
Amdahl's Law gives the theoretical maximum system speedup when only a fraction of the workload is accelerated by factor :
Fill in your measured values:
Variable
Formula
Your value
= Conv2D fraction
(Conv2D cycles) / (total cycles)
= layer speedup
(SW Conv2D cycles) / (HW Conv2D cycles)
System speedup
Example: , → system speedup = = = 3.2×
Key insight: even with a perfect Conv2D accelerator (), the maximum possible speedup is . The non-accelerated 8% is the hard ceiling.
This is why profiling comes before design: without measuring , you cannot predict what speedup any accelerator will achieve, regardless of how fast it is.
In-class exercise — from profiling to spec
Given the following (hypothetical) profiling output from a student's board:
What is the arithmetic intensity of the Conv2D layer in this run, assuming KH=KW=3, C_in=1, C_out=8, H_out=24, W_out=19, and the memory is not cached? (Hint: MACs ÷ bytes loaded)
Using Amdahl's Law with , what system speedup does a 4× layer speedup achieve?
If you could only choose one: (a) double the MAC array width from 4 to 8, or (b) add a weight prefetch buffer that doubles the effective memory bandwidth — which gives a larger system speedup? Why?
Expected: (1) AI = 0.5 MACs/byte (memory-bound without local buffer). (2) System speedup ≈ 3.3×. (3) The weight buffer (b) wins if currently memory-bound — doubling MACs with a memory-bound design gives < 2× improvement. The buffer moves you into the compute-bound region where more MACs help.
What to report in Project 3
Your Project 3 submission must include:
Measurement
Where to get it
Baseline cycles (per layer)
M04A03 profiling output
Accelerator cycles (per layer)
M05A03 end-to-end measurement
Speedup per layer and system-wide
ratio of the above
Arithmetic intensity of your design
MACs ÷ bus bytes (calculated)
LUTs, FFs, BRAMs used by accelerator
nextpnr utilization report
Was the bottleneck compute or memory?
Roofline analysis (M05A04)
These six numbers tell the complete story of your design.
Lab 3 due — -O0 vs. -O2 cycle measurement
Lab 3 (assigned in M02A05) is due this class:
Cycle counts for the 64-element int8 dot product at -O0 and -O2.
Disassembly of both versions with annotation: which instructions disappeared?
(Bonus) With the M extension enabled: how much does mul change the count?
Submit the cycle count table, the annotated disassembly, and the source + Makefile.
Next class
Design Space for the Accelerator: interface options, datapath width trade-offs, BRAM budgeting, and the Project 3 kickoff. You leave that class with a concrete spec to implement.