Flops toggle on every clock edge whether or not their data changes โ wasting dynamic power. Clock gating stops the clock to idle registers. RTL authors provide clock_enable signals; synthesis inserts integrated clock gates (ICG).
Blocking the clock to a register bank when it does not need to update. Saves power proportional to gated flop count ร toggle rate. Must be glitch-free โ a spurious clock pulse corrupts state.
Dynamic power in CMOS is dominated by switching activity: P โ ฮฑ ยท C ยท Vยฒ ยท f, where ฮฑ is the activity factor (how often nodes toggle), C is capacitance, V is supply voltage, and f is frequency. Clock networks often consume 30โ50% of dynamic power because every flop toggles its clock pin every cycle โ even when Q does not change.
| Power term | RTL lever | Who owns it |
|---|---|---|
| Dynamic (switching) | Clock enable, operand isolation, lower activity | RTL author + synthesis |
| Static (leakage) | Power gating, voltage islands, sleep modes | Architecture + UPF + PD |
| Short-circuit | Slew rate, cell sizing | Physical design |
As an RTL author you directly control ฮฑ on datapath and register banks. Backend teams control C (placement, wire length) and f (clock tree, voltage). Writing enable-style RTL is how you hand off a gating-friendly design.
Clock gating attacks the largest controllable slice. Operand isolation attacks the second.
ICG latches enable when clk is low, then ANDs with clk โ prevents mid-high glitch on gated clock.
| Technique | RTL pattern | Power savings |
|---|---|---|
| Clock enable (CE) | if (en) q <= d; in sequential block | Synthesis infers CE/ICG on flop bank |
| Operand isolation | Mux inputs to zero when idle | Reduces combo toggle into flops |
| Power domain off | Not RTL-author territory | Full block shutdown โ UPF/spec |
| Memory sleep | SRAM light-sleep pins | Macro control โ instantiate correctly |
// Synthesis-friendly clock enable โ infers ICG
always @(posedge clk or negedge rst_n) begin
if (!rst_n)
counter_q <= 8'h0;
else if (count_en) // enable = "this bank may update"
counter_q <= counter_q + 8'd1;
end
// count_en should be registered or stable before active edge
// Typical: count_en = running && !hold
// ANTI-PATTERN: combo-gated clock in RTL wire gated_clk = clk & enable; // glitch risk! always @(posedge gated_clk) // async clock to tool flow data_q <= data_d; // Lint will scream; silicon may get runt pulses
Gating the root clock to the entire chip from RTL is never your job. Gate enable on specific flop banks. Physical designers and CTS own the clock tree.
// Enable from deep combo? Register it one cycle early.
reg count_en_q;
always @(posedge clk or negedge rst_n) begin
if (!rst_n)
count_en_q <= 1'b0;
else
count_en_q <= running && !hold && !fifo_full; // combo โ reg
end
always @(posedge clk or negedge rst_n) begin
if (!rst_n)
counter_q <= 8'h0;
else if (count_en_q) // stable before latch window
counter_q <= counter_q + 8'd1;
end
Synthesis attribute (vendor-specific): Some flows accept (* clock_gating_integrity_cell = "true" *) or // synopsys map_to_module hints. Default path: write clean enable RTL and let the tool infer ICG โ don't instantiate vendor cells unless your PD team requires it.
Reset synchronizers, watchdog timers, and interrupt controllers that must sample every cycle โ gating breaks function.
If en is high 95% of the time, ICG overhead may exceed savings. Profile activity first.
Flops receiving async signals need consistent clocking โ don't gate synchronizer chains without CDC review.
Test mode must bypass gating โ DFT inserts test-enable on ICG. Don't fight the flow with custom clock hacks.
// When ALU is idle, don't let operands toggle into it
wire [31:0] alu_a = alu_active ? operand_a : 32'h0;
wire [31:0] alu_b = alu_active ? operand_b : 32'h0;
wire [31:0] alu_out = alu_a + alu_b; // combo toggles reduced
always @(posedge clk)
if (alu_active)
result_q <= alu_out;
Glitch-free awareness: ICG cells latch enable while clk is low, then gate on the rising edge. Your enable must be stable before the latch window โ register it one cycle early if it comes from combo logic.
Enable that toggles during the low phase can produce a runt clock pulse on the gated branch.
// SRAM macro โ light sleep when not accessed (instantiate per vendor doc)
always @(posedge clk) begin
if (mem_idle_counter == 8'd255)
mem_ls <= 1'b1; // light sleep โ saves leakage, adds wake latency
else if (mem_rd || mem_wr)
mem_ls <= 1'b0;
end
// Document wake cycles in block spec โ software may need to poll ready
Not every enable saves power. If count_en is high 98% of cycles, ICG cell overhead can exceed savings. Profile activity before and after:
| Report | What to look for | Action if bad |
|---|---|---|
| Switching activity (SAIF/VCD) | Toggle rate on gated flop outputs | Enable too often active โ widen idle window |
| Clock gating efficiency | % flops with ICG + % time gated | Add enables on idle banks |
| Power report post-PNR | Dynamic mW before/after RTL change | Confirm operand isolation too |
// Simulation-only: count how often enable is high (remove before synth) reg [31:0] en_high_cycles, total_cycles; always @(posedge clk) begin total_cycles <= total_cycles + 1; if (count_en) en_high_cycles <= en_high_cycles + 1; end // After sim: activity = en_high_cycles / total_cycles // Target: < 30% for meaningful ICG savings on this bank
if (enable) on sequential updates โ not combo clock gatingassign gated_clk = clk & en in RTL โ glitch risk.