On this page 11 sections
- What is a clock gating check?
- Inferred checks on AND and OR gates (real OpenSTA results)
- Why the ICG cell is timed differently
- The real ICG problem: clock latency on the enable path
- Complex gates and muxes: the silent case
- Debugging a clock gating check: flowchart
- Example: budgeting an ICG enable path (illustrative)
- Interview questions and answers
- FAQ
- Summary
- References
A clock gating check makes sure that the enable of a clock gate changes only when it cannot cut or create a clock pulse. If the enable of an AND gate rises while the clock is high, the gated clock gets a clipped pulse that downstream flops may or may not see. STA catches this with setup and hold checks on the enable pin, measured against a different pair of clock edges than a normal flop check.
This post covers inferred checks on AND and OR gates, why an integrated clock gating (ICG) cell is timed differently, how clock latency eats into the ICG enable path, and complex gating cells. Every slack quoted comes from a small hand-written netlist built from the open ASAP7 7 nm predictive libraries (RVT, FF corner) and timed with OpenSTA 2.3.1: 400 ps clock, propagated clocks, 20 ps input slew, no wire parasitics. Anything that is not a tool or library result is labelled illustrative. For the power side of clock gating (why we gate, how enables are found in synthesis), see clock gating and ICG cells.
What is a clock gating check?#
A gating cell has a clock pin and a gating pin (the enable). STA infers a check on the gating pin when the cell output is used as a clock downstream (flop clock pins, an output port or a generated clock source) and the gating input is data, or a clock not used as a clock after this cell. The rule: the enable may change only while the clock is blocking the output. A change while the clock passes chops the pulse or adds an edge.
- Active-high gating (AND, NAND). The clock passes when the enable is 1. The output can only follow the clock while the clock is high, so the enable must change while the clock is low. Setup is checked against the rising clock edge (the enable must be settled before the clock goes high), and hold against the falling edge (the enable must not change until the clock has gone low).
- Active-low gating (OR, NOR). The clock passes when the enable is 0, and the output is forced high when the enable is 1. Here the enable must change while the clock is high. Setup is checked against the falling edge and hold against the rising edge.
Default gating margins are 0. set_clock_gating_check -setup <value> -hold <value> adds margin globally or on a clock, cell or pin, which is useful early in the flow when wires and clock latency are not real yet (see SDC constraints).
Inferred checks on AND and OR gates (real OpenSTA results)#
The demo has four gated branches. Each enable comes from a flop (DFFHQNx1, or DFFLQNx1 for falling edge) through one inverter, and each gated clock drives one flop. Branch A (AND2x2, posedge enable) gives the classic hold report. The enable arrives at 41.11 ps, but an AND gate needs it quiet until the falling edge at 200 ps (report excerpt, slew column removed):
Startpoint: ra (rising edge-triggered flip-flop clocked by clk) Endpoint: ga (rising clock gating-check end-point clocked by clk) Path Group: **clock_gating_default** Path Type: min 0.00 0.00 clock clk (rise edge) 35.42 35.42 v ra/QN (DFFHQNx1_ASAP7_75t_R) 5.68 41.11 ^ ia/Y (INVx1_ASAP7_75t_R) 41.11 data arrival time 200.00 200.00 clock clk (fall edge) 200.00 v ga/A (AND2x2_ASAP7_75t_R) 0.00 200.00 clock gating hold time -158.89 slack (VIOLATED)Note the endpoint label (clock gating-check end-point), the **clock_gating_default** path group, which you miss if you only report the clk group (see reading a timing report), and the required time from the fall edge.
| Branch | Gating cell | Enable launched by | Setup slack (ps) | Checked against | Hold slack (ps) | Checked against |
|---|---|---|---|---|---|---|
| A | AND2x2 | rising-edge flop | 356.44 | rise at 400 | −158.89 | fall at 200 |
| B | AND2x2 | falling-edge flop | 153.11 | rise at 400 | 42.33 | fall at 200 |
| C | ICGx1 | rising-edge flop | 328.74 | rise at 400 (library setup 28.63) | 54.22 | rise at 0 (library hold −12.93) |
| D | OR2x2 | rising-edge flop | 156.46 | fall at 200 | 441.10 (see note) | rise at 0 |
Real OpenSTA 2.3.1 results, ASAP7 RVT FF, 400 ps clock, no wire parasitics.
What the table shows:
- A posedge enable fails hold on an AND gate by almost half a cycle. Do not pad it with a 160 ps delay chain that varies with every PVT corner; change the structure.
- A falling-edge launch (B) fixes hold (42.33 ps), but setup becomes a half-cycle path, which bites at high frequency or with duty-cycle distortion (see half-cycle paths and duty cycle and pulse width).
- An OR gate (D) suits a posedge enable, since the enable changes while the clock is high. Setup is still half a cycle, and the gated clock idles high when disabled.
- Note on D hold: OpenSTA 2.3.1 paired the enable launched at 400 ps with the rising edge at 0 ps (441.10 ps). The physically relevant pairing, launch at 0 against the rise at 0, leaves 41.10 ps (worked out by hand from the same path delay). Always check which edges a gating report pairs.
Adding set_clock_gating_check -setup 20 -hold 10 moved every inferred check by exactly its margin (A: 336.44 / −168.89 ps; B: 133.11 / 32.33 ps; D setup: 136.46 ps). The ICG check stayed at 328.74 ps, because it comes from Liberty arcs.
Why the ICG cell is timed differently#
An ICG cell puts a latch in front of the AND gate. In ASAP7 ICGx1_ASAP7_75t_R the Liberty file says so directly (condensed excerpt):
cell (ICGx1_ASAP7_75t_R) { clock_gating_integrated_cell : latch_posedge_precontrol; pin (GCLK) { clock_gate_out_pin : true; state_function : "CLK & IQ"; ... } pin (CLK) { clock_gate_clock_pin : true; ... } pin (ENA) { clock_gate_enable_pin : true; timing () { related_pin : "CLK"; timing_type : setup_rising; ... } timing () { related_pin : "CLK"; timing_type : hold_rising; ... } } pin (SE) { clock_gate_test_pin : true; ... } }latch_posedge_precontrol means a low-transparent latch feeding an AND gate for a rising-edge clock, with the test input combined before the latch. While the clock is high the latch holds the enable, so ENA changes in the high phase are ignored until the clock goes low.
So the enable gets a full cycle: ENA has a normal setup_rising check to the next rising edge (branch C: arrival 42.63 ps, required 371.37 ps after the 28.63 ps library setup, slack 328.74 ps), and hold is against the same rising edge (library hold −12.93 ps, slack 54.22 ps). OpenSTA reported these in the clk group as "library setup time". No glitch, no half-cycle path and no inferred hold problem is why synthesis inserts ICGs rather than bare AND gates (the latch vs flip-flop post covers the latch behaviour).
SE is the scan enable: at 1 the clock passes regardless of ENA, so scan shift works through gated branches (see scan chain reordering). With SE tied to 0 in the demo, check_setup -verbose listed gc/SE and ge/SE as unconstrained endpoints; in a real design SE is timed in the test-mode SDC.
The real ICG problem: clock latency on the enable path#
After CTS, the ICG sits closer to the clock root than its sinks, because the gated clock still has to be buffered out, while the flop that launches the enable sits at leaf level. So the launch clock arrives late and the ICG's capture clock early, and the enable path loses the gap (see clock tree synthesis). In branch E, the enable flop re is clocked through four BUFx2 buffers (50.28 ps latency) and the ICG straight from the port: arrival 88.67 ps, required 371.37 ps, slack 282.71 ps.
| Case | ICG clock latency (ps) | Enable flop clock latency (ps) | ICG enable setup (ps) | ICG enable hold (ps) | Sink flop setup, din→fe/D (ps) |
|---|---|---|---|---|---|
| C: ICG and enable flop both at the root | 0 | 0 | 328.74 | 54.22 | — |
| E: enable flop 4 buffers deep, ICG at the root | 0 | 50.28 | 282.71 | 99.03 | 379.37 |
| E′: ICG clock moved 3 buffers deep | 40.65 | 56.00 | 321.42 | 60.24 | 418.59 |
Real OpenSTA 2.3.1 results. In E′ the extra ICG clock pin load on the buffer chain raised the enable flop latency from 50.28 to 56.00 ps; OpenSTA also applied 1.97 ps of clock reconvergence pessimism removal.
Losing 46 ps does not matter at 400 ps, but with a deep tree at high frequency this is why ICG enables often show up among the worst setup paths after CTS. Moving the ICG clock later (E′) won back 38.71 ps, at the cost of enable hold (99.03 to 60.24 ps): useful skew with the usual hold trade-off.
Common ways teams handle it (illustrative, not a sign-off recipe):
- Model the latency pre-CTS. With ideal clocks the gap is invisible; extra gating setup margin or an estimated
set_clock_latencyon ICG clock pins makes synthesis and placement work to the real budget. - Place ICGs near their sinks, clone them and limit their fanout, so the gated subtree stays short.
- Shorten the enable logic, or register it a cycle earlier where the function allows.
- Skew the ICG clock (E′ style) only with hold checked at the fast corner in every mode (see MMMC and OCV).
Complex gates and muxes: the silent case#
STA infers a check only when the cell function makes the active level obvious. Branch X gates the clock through AO21x1_ASAP7_75t_R (Y = A1·A2 + B) with the clock on A1, the enable on A2 and B tied low, which is functionally an AND gate.
- OpenSTA 2.3.1 inferred no gating check:
report_checks -to gx/A2returned "No paths found" for both setup and hold. - Adding
set_clock_gating_check -high -setup 0 -hold 0on the cell, or on pingx/A2, still gave "No paths found" in this OpenSTA version. - The enable path showed up only as an unconstrained path ending at the downstream flop's clock pin:
fx/CLK, arrival 57.11 ps, slack INF, path group "(none)".check_setup -verbosedid not flag it.
The enable is effectively unchecked, and no slack summary shows it. Commercial tools document set_clock_gating_check -high/-low for such cells and usually warn when they cannot infer a check, and set_case_analysis on a side input can reduce a complex cell to a simple gate. The better fix is the netlist: use an ICG, or constrain clock muxes explicitly (see generated clocks and, for a clock through an XOR, timing arcs).
Debugging a clock gating check: flowchart#
A typical debug sequence:
- List every clock gate and separate ICGs from discrete gates; a discrete gate in the clock path is worth a question to the RTL owner.
- Confirm a check exists on each enable pin (look in
**clock_gating_default**). "No paths found" is a red flag, not a pass. - Read the edges: AND/NAND setup to rise, hold to fall; OR/NOR the reverse; ICG both to rise. Unexpected edges point at clock definitions or
set_case_analysis. - Hold failure on a discrete AND: use an ICG or a falling-edge enable flop, not delay cells.
- Setup failure on an ICG enable: compare launch and capture latency. A large gap needs the latency fixes above; matched latency means the enable logic is too deep (fix it in synthesis or with a timing ECO).
- Re-run every mode and corner, including test mode.
Worked example: budgeting an ICG enable path (illustrative)#
A 1 GHz block (1,000 ps period) has an ICG whose enable comes from a state-machine decode. The numbers below are illustrative, chosen to show the arithmetic.
- Launch flop clock latency after CTS: 420 ps. ICG clock latency: 300 ps (it sits higher in the tree).
- Clock-to-Q: 45 ps. Enable logic: 6 levels at about 40 ps each, so 240 ps. Wire: 60 ps.
- ICG setup from the library: 30 ps. Clock uncertainty for setup: 50 ps (see clock uncertainty and jitter).
Arrival = 420 + 45 + 240 + 60 = 765 ps. Required = 1,000 + 300 − 30 − 50 = 1,220 ps. Slack = +455 ps. A flop-to-flop path with the same logic and both ends at 420 ps would have 575 ps, so the ICG path has lost the 120 ps latency gap. With 14 levels (560 ps) of enable logic, the flop path keeps +255 ps but the ICG path only +135 ps, so it is the path that runs out of margin first. Budget ICG enables against the ICG's clock arrival, not the leaf arrival.
Interview questions and answers#
1. What is a clock gating check? A setup and hold check on the enable pin of a clock gate, so the enable changes only while the clock is blocking the output and the gated clock has no glitch.
2. For an AND gate, which edges are used? Setup to the rising edge, hold to the falling edge (the enable changes while the clock is low). OR is the reverse.
3. Why does an AND gate with an enable from a rising-edge flop fail hold? It changes just after the rising edge, while the AND gate passes the clock. Hold is against the falling edge, so slack is about minus half a period plus clock-to-Q (−158.89 ps at 400 ps in the demo).
4. Why use an ICG instead of an AND gate?
Its latch holds the enable during the high phase, giving a full-cycle setup, an easy hold and no glitch risk, from Liberty setup_rising/hold_rising arcs on ENA.
5. What does latch_posedge_precontrol mean?
It is a Liberty clock_gating_integrated_cell value: a latch-based gate for a rising-edge (posedge) clock, with the test-control input combined before the latch.
6. Why are ICG enable paths often critical after CTS? The ICG sits higher in the tree than the launch flop, so the enable path loses the latency gap (50.28 ps cut slack from 328.74 to 282.71 ps in the demo).
7. What does set_clock_gating_check do?
It sets margins for inferred gating checks, and with -high/-low gives the active level where the tool cannot infer it. Margins did not change the library-based ICG check in OpenSTA.
8. What happens if the clock is gated through a mux or a complex cell? The check may not be inferred and the enable becomes unconstrained, as with the AO21 in OpenSTA 2.3.1. Use an ICG or verify the check exists.
FAQ#
Is a clock gating check the same as a clock gating cell's setup time? For an ICG, the check is the cell's library setup and hold. For a discrete gate, the check is inferred by STA, and its margin is 0 unless you set one.
Do clock gating checks matter pre-CTS? Yes for structure: the AND-with-posedge-enable hold failure shows up with ideal clocks. The latency effect on ICG enables only shows up after CTS, unless you model it.
Can a gating check fail because of crosstalk? Yes. The enable path is a normal data path, and coupling can speed it up (hold) or slow it down (setup). See crosstalk.
Does clock gating affect power analysis? Yes, gating is a major lever on clock power. See power analysis in VLSI and the synthesis post for how ICGs are inserted.
Summary#
- A clock gating check is a setup and hold check on the enable pin of a clock gate. AND/NAND: the enable changes while the clock is low (setup to rise, hold to fall). OR/NOR: it changes while the clock is high (setup to fall, hold to rise).
- An enable from a rising-edge flop fails hold on a bare AND gate by about half a cycle: −158.89 ps in the OpenSTA demo. A falling-edge launch passes (42.33 ps), but it turns setup into a half-cycle path.
- ICG cells (ASAP7
latch_posedge_precontrol) give the enable a full cycle with library setup and hold arcs. - After CTS, ICG enables lose the latency gap between the leaf launch flop and the higher ICG: 328.74 ps fell to 282.71 ps with a 50 ps gap. Fix it with placement, cloning, shorter enable logic, or careful skew.
- Complex gating cells may get no check at all. In OpenSTA 2.3.1, an AO21 gate's enable became an unconstrained path with INF slack. Report every gating pin and treat "No paths found" as a bug.
References#
- L. T. Clark et al., "ASAP7: A 7-nm finFET predictive process design kit," Microelectronics Journal, vol. 53, pp. 105–115, 2016. DOI: 10.1016/j.mejo.2016.04.006
- ASAP7 standard-cell libraries used here (
asap7sc7p5t_{INVBUF,SIMPLE,AO,OA,SEQ}_RVT_FF_nldm_*.lib, includingICGx1_ASAP7_75t_R), as packaged in OpenROAD-flow-scripts: github.com/The-OpenROAD-Project/OpenROAD-flow-scripts - OpenSTA static timing analyzer, Parallax Software (commands
report_checks,set_clock_gating_check,check_setup): github.com/parallaxsw/OpenSTA




