Conversation
Greptile SummaryThis PR adds an activity-based clock gating mode to the
Confidence Score: 3/5The circuit transformation is functionally correct, but the activity annotations written to every converted FF and the ICG cell use an incorrect formula, meaning downstream power analysis will produce wrong results. The gclk_ackt value written to activity attributes on every gated FF multiplies two toggle rates together instead of scaling clock activity by the CE duty fraction, analogous to how gclk_duty is correctly computed. This silently produces wrong power estimates for every FF clock-gated by the new path. An unused SigMap and a helper that silently skips CLK updates when the token is absent add further uncertainty. passes/techmap/clockgate.cc — specifically the gclk_ackt formula around line 476 and the update_ff_activity_attr helper at lines 206-217. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Parse -min_disabled_threshold arg] --> B{use_disabled_threshold?}
B -- No --> C[Group FFs by clock net
qualify if net_size >= min_net_size]
B -- Yes --> D[For each DFFE on clock net:
read EN duty cycle
compute disabled_frac = 1 - ce_active_frac
add to en_disabled_sum]
D --> E{en_disabled_sum >= threshold?}
E -- No --> F[Skip clock net]
E -- Yes --> G[Create ICG cell
set CLK and CE ports]
C --> G
G --> H[Compute gclk_duty = clk_duty x ce_active_frac
gclk_ackt = clk_activity x ce_activity
Set ICG FANOUT=1 and activity attrs]
H --> I[Connect ICG gated clock output wire]
I --> J[For each DFFE in net:
Remove CE, repoint CLK to gated wire
Emit new DFF, update activity attrs]
J --> K[Log converted FF count]
Reviews (1): Last reviewed commit: "bug fixes" | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Modified clockgate pass to allow for a new option, where we can gate flops based on inferred enable duty cycle
Algorithm: