[ENG-2097] Small fix for annotate_ff_width#181
Conversation
Greptile SummaryThis PR replaces the
Confidence Score: 3/5The new counting logic requires the pass to run after register splitting, but the existing synthesis pipeline calls it before; all multi-bit FFs would receive an incorrect width of 1, silently disabling clock-gating. The central change inverts the call-order assumption: counting [N]-indexed cells only produces the right answer when they already exist in the design, yet synthesis.py still places this pass before splitcells. Every regular multi-bit FF ends up with ff_width=1, making cg_min_ff_size a no-op and suppressing the clock-gating optimization that depends on it. passes/silimate/annotate_ff_width.cc — verify the intended call-order relative to splitcells, and confirm synthesis.py is updated accordingly. Important Files Changed
Sequence DiagramsequenceDiagram
participant S as synthesis.py
participant AFF as annotate_ff_width
participant SC as splitcells
participant CG as clockgate
S->>AFF: run (before split)
Note over AFF: OLD: reads WIDTH param / Q-port size → correct width (e.g. 8)
Note over AFF: NEW: counts cells by base name → always 1 (no [N] suffix yet)
AFF-->>S: ff_width attr set on each cell
S->>SC: splitcells -format [N]
Note over SC: reg (WIDTH=8) → reg[0]…reg[7], each WIDTH=1
S->>CG: clockgate -min_ff_size N
CG->>CG: read ff_width attr
Note over CG: OLD ff_width=8 → orig_w ≥ threshold → gate applied
Note over CG: NEW ff_width=1 → orig_w < threshold → all FFs skipped
Reviews (1): Last reviewed commit: "better comment" | Re-trigger Greptile |
FF width pass will count the number of regs to get the proper width