3.5.9 · D2HDL & Digital Design Flow

Visual walkthrough — Timing analysis basics (static timing)

1,794 words8 min readBack to topic

Step 0 — The two characters and the clock

We have two flip-flops in a row:

  • FF1 = the launcher. It puts a fresh value onto the wire.
  • FF2 = the catcher. It must snapshot that value cleanly.
  • Between them sits combinational logic (gates: AND, OR, ...). It has no memory; it just delays and transforms. Its travel time we call .

Step 1 — When does the new data leave FF1?

WHAT. At the launch rising edge (call its time ), FF1 does not update its output instantly. There is a small internal delay — the clock-to-Q delay, written — before Q actually changes.

WHY this quantity. Real transistors take time to switch. If we pretended we would under-count the total travel time and wrongly declare the circuit fast enough. Honesty about is the first brick.

PICTURE. The output Q of FF1 is flat until after the edge, then it steps to the new value.


Step 2 — When does the data arrive at FF2's door?

WHAT. After leaving FF1, the signal walks through the gates. That walk takes . So arrival time at FF2's input D is the launch time plus the walk.

WHY. The signal is physically real; it cannot teleport across the logic. Adding is just "start time + travel time = finish time."

PICTURE. The red data waveform at FF2's input rises one gap later than at FF1's output — that gap is .


Step 3 — The deadline: setup time before the next edge

WHAT. FF2 will snapshot on the next rising edge, at time . But a mailbox that snaps shut needs the letter already settled a little early. That early margin is the setup time . So the true deadline is before the edge:

WHY exists. Inside FF2 the incoming value must charge internal nodes to a definite or before the edge locks it in. If it is still wiggling at the edge, FF2 can go metastable — stuck halfway (see Metastability). To forbid that, we insist on the margin .

PICTURE. A "no-fly zone" of width is painted just before the capture edge. Data must be flat inside the whole zone.


Step 4 — Win the setup race: arrive ≤ deadline

WHAT. Demand that the arrival (Step 2) is no later than the deadline (Step 3):

Move left to collect all the "costs" on one side:

WHY the longest path. If even the slowest path fits, all faster ones fit too. So setup uses — the critical path (see Critical path and pipelining). Inverting the tight case gives the top speed:

PICTURE. A budget bar of total length ; the three coloured chunks must not overflow it.


Step 5 — The other fear: data arriving too EARLY (hold)

Now switch fears entirely.

WHAT. Look at the same edge (time ) at FF2. FF2 is trying to capture the old value that was already sitting on its input. But the launch edge also fired FF1, sending a new value racing down the logic. If that new value is too quick, it reaches FF2 and overwrites the input while FF2 is still capturing the old one. Corruption.

WHY use the shortest path. The danger is the fastest possible new signal, so here we use . The earliest the disturbance can arrive:

PICTURE. Two edges drawn from the same clock tick. The "old" data must stay put; the "new" data must not sneak in before FF2 is done.


Step 6 — Win the hold race: don't arrive before

WHAT. FF2 needs the old value held steady for a margin hold time after the edge. So the new value must not arrive until at least has passed:

WHY this is a huge deal. Slowing the clock (bigger ) helps setup — Step 4 has on the right. But it does nothing for hold — Step 6 has no . To fix a hold violation you must add delay to the short path (insert buffers), making the new value slower. See Setup and hold time.

PICTURE. A "keep-out after the edge" zone of width ; the new-data arrow must land to the right of it.


Step 7 — Edge case: clock skew shifts the whole board

WHAT. Until now both flops saw the edge at the same instant. In reality the clock reaches FF2 slightly earlier or later than FF1. That difference is clock skew (see Clock skew and clock trees).

  • If the capture edge arrives later → FF2's deadline moves right → more setup room.
  • But that same lateness widens the same-edge hold window → less hold room.

The constraints simply pick up :

WHY the opposite signs. Delaying the catcher's edge relaxes "arrive early enough" (setup) but tightens "don't arrive too early" (hold). One knob, two opposite effects.

Degenerate check. Set and both equations collapse back to Steps 4 and 6 — good, the general form contains the simple one.


Step 8 — Reading pass/fail: slack

WHAT. Slack = (required time) − (arrival time). Positive = pass, negative = violation.

  • Setup slack
  • Hold slack

WHY. Slack turns an inequality into a single signed number a tool can print. It measures how much room you have (or by how much you failed).


The one-picture summary

One clock period, one launch edge, one capture edge:

  • The green journey () must finish before the setup no-fly zone ⇒ setup uses the slow path and cares about .
  • The orange journey () must not finish before the hold keep-out zone ⇒ hold uses the fast path and ignores .
Recall Feynman retelling of the whole walkthrough

Two friends pass a note across desks; the teacher claps at a steady beat. When the teacher claps, FF1 lets go of a new note — but its hand is slow, so the note leaves a moment late (). The note then travels the row of desks, taking time . FF2 is a friend who only glances at the incoming note the instant the teacher claps — and she needs it lying flat a little before the clap () so she can read it. Setup = the note must arrive before that early moment; if the beat is too fast, the slow note is late — so clap slower fixes it. But there's a second danger: the new note FF1 just launched could zip through a short route and land on FF2's desk during the very same clap, smudging the old note she's still reading. She needs the old note undisturbed for a moment after the clap () — that's hold. Clapping slower doesn't help here at all (the collision is at one single clap); instead you send the speedy note the scenic way (add buffers). Skew is the teacher clapping at slightly different times for the two friends — it buys setup room but steals hold room.


Connections

What single number tells setup pass/fail?
Setup slack ; positive passes.
Why does hold ignore ?
Hold is a race at one single (same) clock edge, so the period never enters the equation.
Positive skew effect on setup and hold?
Helps setup (later capture edge = more time), hurts hold (larger keep-out window).