S346 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

S3 · Lesson 46 · Clocks and resets

Clock generation and distribution, jitter, glitch-free clock gating and reset synchronizers

Two signals reach nearly every flip-flop on a chip: the clock and the reset. The clock has to arrive everywhere at almost the same moment with almost the same period, through a tree of buffers spanning the whole die, and gating it off to save power must never chop a pulse short. The reset has to put every flip-flop in a known state and then let go of all of them on the same clock edge, even though the reset button knows nothing about the clock. Both are easy to get subtly wrong, and both failures show up as chips that work on most boards, most days.

  • Two ways to gate a clock. G1 is CLK & EN, a plain AND gate. G2 uses ENL, the enable captured while the clock is low (here by a flip-flop on the inverted clock, standing in for the latch of an integrated clock-gating cell).
  • EN changes in the middle of high phases at 6, 22, 38 and 45. Each time, G1 produces a shortened pulse, a glitch that can clock some flip-flops and not others.
  • G2 only ever passes whole clock pulses, because its enable can't change while the clock is high.

Predict

A reset button drives every flip-flop's asynchronous reset directly. What can go wrong when the button is released?

Name it

Generating the clock

A PLL multiplies a stable reference: fout=frefNMP (feedback divider N, reference divider M, output divider P). Its output jitter is the random variation of edge timing. For a link or timing budget at a given bit-error ratio, peak-to-peak random jitter is 2Qσ, with Q = 7.03 for 10−12. Setup analysis subtracts jitter (and skew) from the period as clock uncertainty.

Distributing it

A clock tree of buffers, each driving f loads, reaches N sinks in ⌈logf⁡N⌉ levels using about N−1f−1 buffers. Trees are balanced so every path has the same delay (H-trees, meshes in high-performance chips). Skew and insertion delay vary with process, voltage and temperature, so useful margin goes into the timing budget.

A path launched on the rising edge and captured on the falling edge gets only the high phase, DT for duty cycle D, so duty-cycle distortion matters to such half-cycle paths and to DDR interfaces.

Gating it

Clock gating (lesson 20) must not create glitches. An integrated clock-gating cell latches the enable while the clock is low and ANDs the latched enable with the clock, so the gated clock only ever has whole pulses. Synthesis inserts these cells where a register bank has a common enable.

Resets

  • Synchronous reset: reset is just another input to the D logic; no timing hazards, but it needs a running clock and adds logic on the D path.
  • Asynchronous reset: acts at once, even without a clock, but its release must meet recovery (before the edge) and removal (after the edge) times, like setup and hold.
  • Reset synchronizer: async assert, sync deassert. Two flip-flops with their D chained from 1 and their async resets tied to the raw reset: reset reaches the design immediately and leaves it two clock edges after release, cleanly. Each clock domain gets its own.

Worked example

A design has 100,000 flip-flops and the clock tree uses buffers that each drive 8 loads. How many levels and buffers? And what does a PLL with a 25 MHz reference, N = 96, M = 1, P = 2 give?

Show the solution
  1. Levels. L=⌈log8⁡100,000⌉=⌈5.54⌉=6
  2. Buffers per level. From the flip-flops up: 12,500, 1,563, 196, 25, 4 and 1, for 14,289 in all.
  3. Check with the formula. N−1f−1=14,286 close to the count.
  4. The PLL. 25×962=1200MHz

Answer 6 levels and 14,289 buffers; the PLL gives 1,200 MHz.

Worked example

The 1.2 GHz clock has 1.5 ps rms random jitter. What peak-to-peak jitter should the timing budget allow at 10−12, and how much of the period is left?

Show the solution
  1. Peak-to-peak jitter. At 10−12 the budget allows ±7.03σ: 2×7.03×1.5=21.1ps
  2. What's left. The period is 833 ps, so 833−21.1=812ps remain for clock-to-Q, logic, setup and skew.
  3. Half-cycle paths. At a 48% duty cycle a half-cycle path gets only 0.48×833=400ps

Answer allow 21.1 ps peak to peak, which leaves 812 ps of the 833 ps period.

Worked example

A 64-bit register bank is idle 80% of the time. Each flip-flop's clock pin is 2 fF, and an integrated clock-gating cell would add 5 fF that toggles every cycle. At 1 GHz and 0.8 V, what does gating save?

Show the solution
  1. Ungated. P=64×2fF×0.64×109=81.9µW
  2. Gated. The flip-flops see the clock 20% of the time (16.4 µW), and the gating cell's input always toggles (3.2 µW): 16.4+3.2=19.6µW
  3. Saving. 1−19.681.9=76%
  4. Minimum width. Gating a single flip-flop wouldn't pay, which is why tools gate only banks above a minimum width.

Answer gating cuts the clock power from 81.9 µW to 19.6 µW, a 76% saving.

Check

A PLL has a 25 MHz reference, feedback divider N = 40, reference divider M = 2 and output divider P = 4. What's the output frequency?

Write units the way you normally would: 1.5 MHz, 1500 kHz and 0.0015 GHz are the same answer.

Check

A clock tree uses buffers that each drive 4 loads. How many levels does it need to reach 60000 flip-flops?

Check

About how many buffers does a tree of fanout-4 buffers need to drive 60000 flip-flops?

Check

A clock has 1.5 ps rms random jitter. What peak-to-peak jitter does Q = 7.03 correspond to?

Write units the way you normally would: 1.5 ps and 0.0015 ns are the same answer.

Check

A path launches on the rising edge and captures on the falling edge of an 800 MHz clock with a 0.45 duty cycle. With clock-to-Q 60 ps and setup 30 ps, how much time is left for logic?

Write units the way you normally would: 1.5 ps and 0.0015 ns are the same answer.

Check

A reset synchronizer has 2 flip-flops on a 50 MHz clock. At most how long after the raw reset is released does the design leave reset, counting whole cycles?

Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.

Check

A clock tree must reach 50000 flip-flops with buffers that each drive 4 loads; its PLL takes a 100 MHz reference with N = 64, M = 1, P = 1.

(a)

How many levels does the tree need?

(b)

About how many buffers?

(c)

What frequency does the PLL give?

Write units the way you normally would: 1.5 MHz, 1500 kHz and 0.0015 GHz are the same answer.

Check

A path launches on a rising edge and captures on the falling edge of a clock with period T and duty cycle D; its delay is t.

Step 1

How much time does it get?

Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.

Explain why

Why do reset synchronizers assert reset asynchronously but release it synchronously?

Practice

Keep practicing

10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.