rtl(npu): 1x8 weight-streaming int8 GEMV NPU - #12
Conversation
…npu.md WB B4 CSR slave (§2.2/§3), 2-deep weight-stream FIFO (§2.3), 8x32-bit signed MAC accumulator bank with bandwidth-following lane feed (§4.2), fixed-point round-half-away-from-zero/saturate requantiser (§4.1), GEMV sequencer FSM (§4.3), normal-mode SRAM writeback and streaming-argmax result path (§4.4), and malformed-descriptor error checks (§5). Closes issue #10.
|
Verdict: clean — merged. Boundary: author Gate integrity: Evidence re-run:
Spec spot-check against Two items are open per the manifest, both correctly escalated rather than silently guessed: argmax tie-break policy (spec silent) and simultaneous |
Deliverable manifest
Role: rtl-agent-Sonnet5-medium
Issue: #10
Artifacts:
sky130_sram_2kbyte_1rw1r_32x512_8OpenRAM macro (PD-stage swap)Gates:
make lint MOD=npu) = PASS, 0 warnings, for all four legalWS_WIDTHvalues {8,16,32,64} (verified viaverilator --lint-only -GWS_WIDTH=<n>; the Makefile gate itself runs the default WS_WIDTH=32)hw/dv/, clean room, RTL role does not run/write tests)hw/syn/npu.ysdoes not exist yet; out of scope for this issue, which requested lint only)Spec refs (shall-list implemented):
rst_nresets every flop except the activation SRAM's data contents (explicit spec carve-out) and its registered read-output (a hard-macro behavior, matches real OpenRAM macros — no reset path exists on that port innpu_act_sram.sv)wb_stalltied low,wb_ackone cycle after everycyc&&stb,wb_selignored (full-word writes only), unmapped offsets read 0 / ignore writes,wb_errnever assertedi_ws_valid && o_ws_ready;o_ws_readylow only when both FIFO slots hold unconsumed datanpu_requant.svOUT_BASE+ncadvances as soon as its byte is unpacked, independent of the other lanes in that pop); activation byte read once per k-step and broadcast; parametric inWS_WIDTHwith no datapath change (verified lint-clean at 8/16/32/64)BUSYspansRUN+DRAIN(=TAIL);DONE/IRQ latched the same cycle the FSM would otherwise re-enterIDLE, only after allK*Nbytes are consumedABORTforcesIDLEimmediately, clearsBUSY, no-op if already idlelm_head-class (N>2048) descriptors are representable only in argmax mode (hardware makes no distinction beyond the existingMODEbit + descriptor length — matches "no special case is needed in the sequencer")K_ZERO→N_ZERO→N_NOT_MULTIPLE_OF_C→ACT_RANGE→OUT_RANGE→BUSY_REJECT),SCALE_M/SCALE_SHIFTfull ranges legalABORTonly)Open items:
CTRL.GO+CTRL.ABORTin the same write while busy: implemented as ABORT-wins (forces IDLE, noBUSY_REJECTset). Spec doesn't define this combination; undefined/nonsensical firmware usage, flagging for visibility.npu_act_sram.svis a behavioral placeholder (plain byte array, 1-cycle sync read on port B, write on port A) standing in for the ADR-0002 D5sky130_sram_2kbyte_1rw1r_32x512_8hard macro; PD-stage swap is a backend-engineer task, not attempted here.hw/syn/npu.ysdoes not exist;make synth MOD=npuwas not run (not requested by this issue).Friction:
Skill candidates:
op_*) would have saved some design-space exploration; came up because the spec allows firmware to reprogram descriptor registers while BUSY without defining hardware locking.