RTL Design / Module 9: Lint ยท CDC ยท Timing ยท Area ยท QoR
Lesson 9.11

Clock gating & low-power RTL basics

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).

Clock gating

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.

0

Why power matters at the RTL level

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 termRTL leverWho owns it
Dynamic (switching)Clock enable, operand isolation, lower activityRTL author + synthesis
Static (leakage)Power gating, voltage islands, sleep modesArchitecture + UPF + PD
Short-circuitSlew rate, cell sizingPhysical 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.

Dynamic power breakdown

Clock gating attacks the largest controllable slice. Operand isolation attacks the second.

1

ICG cell โ€” what synthesis inserts

Integrated clock gating cell

ICG latches enable when clk is low, then ANDs with clk โ€” prevents mid-high glitch on gated clock.

TechniqueRTL patternPower savings
Clock enable (CE)if (en) q <= d; in sequential blockSynthesis infers CE/ICG on flop bank
Operand isolationMux inputs to zero when idleReduces combo toggle into flops
Power domain offNot RTL-author territoryFull block shutdown โ€” UPF/spec
Memory sleepSRAM light-sleep pinsMacro control โ€” instantiate correctly
2

Clock enable style โ€” what to write

ce_style_good.v
// 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
gate_clk_bad.v โ€” do NOT write
// 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
Trap

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_reg.v โ€” register combo enable before ICG window
// 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.

3

When NOT to gate

๐Ÿšจ

Always-on logic

Reset synchronizers, watchdog timers, and interrupt controllers that must sample every cycle โ€” gating breaks function.

๐Ÿ”€

Enable toggles every cycle

If en is high 95% of the time, ICG overhead may exceed savings. Profile activity first.

๐Ÿ“ก

CDC / async inputs

Flops receiving async signals need consistent clocking โ€” don't gate synchronizer chains without CDC review.

๐Ÿงช

Scan / DFT

Test mode must bypass gating โ€” DFT inserts test-enable on ICG. Don't fight the flow with custom clock hacks.

operand_isolation.v
// 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.

ICG enable latch timing

Enable that toggles during the low phase can produce a runt clock pulse on the gated branch.

mem_light_sleep.v โ€” macro-level gating
// 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
4

Measuring whether gating helped

Not every enable saves power. If count_en is high 98% of cycles, ICG cell overhead can exceed savings. Profile activity before and after:

ReportWhat to look forAction if bad
Switching activity (SAIF/VCD)Toggle rate on gated flop outputsEnable too often active โ€” widen idle window
Clock gating efficiency% flops with ICG + % time gatedAdd enables on idle banks
Power report post-PNRDynamic mW before/after RTL changeConfirm operand isolation too
activity_counter.v โ€” quick RTL activity probe
// 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
5

Low-power RTL checklist

  • Use if (enable) on sequential updates โ€” not combo clock gating
  • Register enable signals that come from deep combo logic
  • Isolate operands to idle datapath blocks (mux to zero)
  • Don't gate reset paths, synchronizers, or always-sampling logic
  • Verify DFT can control ICG in scan mode
  • Measure: power reports after PNR โ€” confirm gating actually helps

๐ŸŽฏ What to remember

  • Write clock enable style; synthesis inserts ICG cells.
  • Never assign gated_clk = clk & en in RTL โ€” glitch risk.
  • Gate only when idle time is meaningful; don't gate always-on logic.
  • Operand isolation complements clock gating for combo toggle reduction.
Advertisement