HomeSTA CourseDay 2
DAY 2 · STA FUNDAMENTALS

Setup Time & Hold Time — The Physics and the Math

By EcrioniX · Updated June 2026

Setup time and hold time are the two constraints every flip-flop imposes on the data arriving at its D pin. Getting these wrong — even by a few picoseconds — causes metastability: the flip-flop output goes to an undefined voltage level and can corrupt an entire chip. This lesson explains what they mean physically, derives the slack equations from first principles, and shows how to fix violations.

1. Inside a flip-flop — what actually happens

A flip-flop is built from two cross-coupled latches (master and slave). When the clock is low, the master latch is transparent and tracks the D input. When the clock goes high, the master latch closes (locks the value) and the slave latch opens (propagates Q).

For the master latch to close reliably, D must have settled to a stable logic level before the clock rises. Setup time (Tsu) is how long before the clock edge D must be stable. After the clock rises, D must hold stable long enough for the feedback inside the master latch to fully resolve. Hold time (Th) is how long after the clock edge D must remain unchanged.

Setup time and hold time timing diagram CLK DATA T_setup T_hold Data changes here Data stable Clock edge DANGER ZONE
Figure — Setup and hold time windows around the active clock edge. Data must be stable throughout the shaded regions.

2. The slack equations

STA computes two slack values at each flip-flop: setup slack and hold slack. Both must be non-negative for the design to meet timing.

Setup Slack = (Tclk + Tcapture_clk − Tsu) − (Tlaunch_clk + Tclk2q + Tcomb)
— simplified as —
Setup Slack = Required Time − Arrival Time
Hold Slack = (Tlaunch_clk + Tclk2q + Tcomb) − (Tcapture_clk + Th)
— simplified as —
Hold Slack = Arrival Time − (Hold Required Time)

Term definitions

TermWhat it means
TclkClock period (e.g. 2 ns for a 500 MHz clock)
Tlaunch_clkClock latency to the launch flip-flop (source clock + clock tree delay to FF1)
Tcapture_clkClock latency to the capture flip-flop (source clock + clock tree delay to FF2)
Tclk2qClock-to-Q propagation delay of the launch FF (Q stable after clock edge)
TcombCombinational logic delay between FF1 output and FF2 data input
TsuSetup time requirement of the capture FF (from Liberty library)
ThHold time requirement of the capture FF (from Liberty library)

Clock skew changes both slacks simultaneously

Clock skew = Tcapture_clk − Tlaunch_clk. Positive skew (capture clock arrives later) helps setup slack but hurts hold slack. Negative skew (capture clock arrives earlier) hurts setup but helps hold. This is why setup and hold violations cannot both be fixed by changing clock arrival times — fixing one can break the other.

3. Worked example

A register-to-register path with the following parameters:

ParameterValue
Clock period (Tclk)4 ns
Launch clock latency (Tlaunch_clk)0.5 ns
Capture clock latency (Tcapture_clk)0.6 ns
Clock-to-Q delay (Tclk2q)0.2 ns
Combinational delay (Tcomb)2.8 ns
Setup time (Tsu)0.15 ns
Hold time (Th)0.05 ns
Setup slack calculation
Arrival Time  = T_launch_clk + T_clk2q + T_comb
              = 0.5 + 0.2 + 2.8 = 3.5 ns

Required Time = T_clk + T_capture_clk - T_su
              = 4.0 + 0.6 - 0.15 = 4.45 ns

Setup Slack   = Required Time - Arrival Time
              = 4.45 - 3.5 = +0.95 ns  ✓ PASS
Hold slack calculation
Arrival Time      = T_launch_clk + T_clk2q + T_comb
                  = 0.5 + 0.2 + 2.8 = 3.5 ns

Hold Required     = T_capture_clk + T_h
                  = 0.6 + 0.05 = 0.65 ns

Hold Slack        = Arrival Time - Hold Required
                  = 3.5 - 0.65 = +2.85 ns  ✓ PASS

4. What causes violations

Setup violations

Data arrives too late at the capture FF. The combinational path is too slow — too many logic levels, large fanout, long wires, slow cells, or a high PVT (slow process corner, low voltage, high temperature) operating condition.

Classic sign: negative setup slack on the longest combinational paths. Worsens as frequency increases.

Hold violations

Data arrives too fast at the capture FF — before the capture clock edge has settled the previous value. Common after CTS when real clock tree delays replace ideal zero-latency clocks. Short paths between consecutive FFs are most at risk.

Classic sign: negative hold slack on very short data paths. Hold violations are frequency-independent — they exist at any clock speed.

5. Fix strategies

Fixing setup violations

  • Upsize cells on the critical path to faster/stronger variants
  • Switch to LVT cells (Low-Vt threshold — faster but higher leakage)
  • Remove logic levels via synthesis re-mapping or manual restructuring
  • Pipeline the path — add a register to break a long combinational chain
  • Reduce fanout by cloning or buffering high-fanout nets
  • Useful skew — delay the capture clock slightly to give data more time

Fixing hold violations

  • Insert delay buffers (or delay cells) on the short data path
  • Downsize cells to slower HVT variants
  • Add wire detours to increase net delay (last resort)
  • Fix clock skew — balance the clock tree so capture clock arrives earlier
  • PnR tool auto-fixes most hold violations post-CTS via ECO buffer insertion

Hold violations must never be waived

A setup violation means the chip may fail at high frequency — you can reduce the clock. A hold violation causes corruption at any frequency and cannot be fixed by slowing down. Every hold violation must be fixed before tapeout, no exceptions.

6. Checking setup and hold in PrimeTime

report_timing — setup and hold checks
## Setup check (max delay analysis) -- worst 5 violating paths
report_timing -delay_type max \
              -max_paths 5 \
              -slack_lesser_than 0 \
              -path_type full_clock_expanded

## Hold check (min delay analysis) -- worst 5 violating paths
report_timing -delay_type min \
              -max_paths 5 \
              -slack_lesser_than 0 \
              -path_type full_clock_expanded

## Quick summary: WNS and TNS for both checks
report_timing_summary

## Check a specific path from FF1/CK to FF2/D
report_timing -from FF1/CK -to FF2/D -delay_type max

Reading the timing report

The timing report lists: startpoint (launch FF clock pin), endpoint (capture FF data pin), path type (max=setup / min=hold), arrival time, required time, and slack. Negative slack = violation. The path with the worst (most negative) slack is the critical path. Day 11 covers reading full PrimeTime reports line-by-line.

Day 2 Key Takeaways

Frequently Asked Questions

What is setup time in a flip-flop?

Setup time (Tsu) is the minimum time the D input must be stable before the active clock edge. If data arrives inside this window, the flip-flop may enter metastability — its output goes to an undefined voltage and may take nanoseconds to resolve. Setup time is specified per cell in the Liberty library.

What is hold time in a flip-flop?

Hold time (Th) is the minimum time D must remain stable after the active clock edge. Violating hold causes the same metastability problem as setup. Hold time is independent of clock period — it must be met at any frequency, which is why hold violations cannot be fixed by reducing clock speed.

Why does positive clock skew help setup but hurt hold?

Positive skew means the capture FF's clock arrives later than the launch FF's clock. This gives the data path more time to propagate (improving setup margin). But it also means the capture FF's clock edge is delayed relative to the data path — making it easier for a new data value (from the next cycle) to arrive before the current one is safely captured (degrading hold margin).

What is the difference between setup time and propagation delay?

Propagation delay is the time for a signal to travel through a logic gate or wire — it adds to the data arrival time. Setup time is a requirement on the flip-flop's data pin — it reduces the time budget available for the data path. Both appear in the setup slack equation: a longer propagation delay or a larger setup time requirement both reduce setup slack.

At what stage are hold violations typically introduced?

Hold violations are frequently introduced during Clock Tree Synthesis (CTS). Before CTS, STA uses ideal (zero-latency) clocks, which makes all paths appear symmetric. After CTS, real clock tree delays mean some paths have large clock skew. Short data paths between FFs with high positive skew are the most common hold violation source post-CTS.

← Previous
Day 1: What is Static Timing Analysis?