Architecture
- Test architecture for low-power AI accelerators, following "A Robust Test Architecture for Low-Power AI Accelerators".
- 4×4 systolic array of 8-bit MAC PEs with 24-bit partial sums. Weights flow right; activations and partial sums flow down.
- Each PE adds a delta register, captured on the falling edge of the gated clock, and an equality comparator. The comparator chooses between the normal MAC update and holding the delta value, which exposes faults in the MAC and comparator paths.
- Clock gating on the partial-sum and delta registers (gated_clk = clk & clk_gate_en), so test phases can switch the array off for low-power test.
- Test controller FSM: global reset, load zero weights, load test patterns, load weight patterns, capture, reset weights, shift out. It covers 68 patterns: 43 for the MAC and 25 for the comparator.
- Test compression: an LFSR (seed 0xACE1) expands pattern templates into weight, activation and partial-sum vectors, generated in four phases. Stuck-at-0/1 and 0→1 / 1→0 transition test types are supported.
- Top level muxes between test-pattern and normal-operation inputs, and forces the clock gate on in normal mode.
Verification Architecture
- Directed Verilog testbenches for the PE (MAC, delta capture, comparator path) and for the 4×4 array.
- The array bench drives random activations with the clock gate enabled and traces the partial sums as they skew through the array.
- Results are inspected from printed traces; the benches don't compare automatically yet.
Verification Strategy
- PE-level check of the MAC, delta capture and comparator-select behaviour before building the array.
- Array-level check of systolic partial-sum propagation under clock gating.
- PlannedSelf-checking array bench against a software systolic model.
- PlannedFault-injection campaign (stuck-at and transition faults on every PE) with per-fault detection logging.
Results
- Improved fault coverage over the unmodified array (measured outside this repo).
- PE bench: MAC results correct (4×5+10 = 30, 2×7+8 = 26, 9×2+3 = 21) with the delta register tracking the partial sum.
- Array bench: partial sums emerge after the expected 4-cycle systolic fill and propagate down the columns under clock gating.
- Bugs found and fixed: PE clock gating, systolic partial-sum passing between rows, and a timing race in the PE bench.
Evidence
wire comp_result = (psum_reg == delta_reg);
always @(posedge gated_clk) begin
if (rst) begin
psum_reg <= 24'b0;
end else begin
// 1 → normal path, 0 → bypass MAC and use delta_reg value
if (comp_result) begin
psum_reg <= (weight_reg * iact_reg) + psum_in;
end else begin
psum_reg <= delta_reg;
end
end
end
always @(negedge gated_clk) begin
if (rst) begin
delta_reg <= 24'b0;
end else begin
delta_reg <= psum_reg;
end
end# Time: 60000 | 4 x 5 + 10 = 30 | Delta: 10
# Time: 80000 | 3 x 6 + 5 = 23 | Delta: 25
# Time: 100000 | 2 x 7 + 8 = 26 | Delta: 26
# Time: 130000 | 9 x 2 + 3 = 21 | Delta: 21