VLSI

Setup and hold time explained

By CourseTron Team ·  8 min read ·  Updated Oct 2026 💬 𝕏 in f
Table of Contents
    ? Print / Save as PDF

    In short: Setup and hold are the two timing constraints a flip-flop imposes on its data input around the clock edge — data must be stable before the edge (setup) and after it (hold), and static timing analysis checks every path against both to prove the chip will clock reliably at its target frequency.

    Ask any VLSI interviewer to separate the candidates who memorized definitions from the ones who actually understand digital timing, and setup and hold is where they start. These two constraints decide whether your 3 GHz SoC runs at 3 GHz or silently corrupts data. Let's build the intuition from the transistor outward, then see exactly how a tool like Synopsys PrimeTime proves the design is safe.

    Why a flip-flop needs a stable window

    A D flip-flop is not instantaneous. Internally it samples the data input into a master latch and the clock edge triggers the handoff to the slave. For that sampling to resolve to a clean 0 or 1, the data cannot be changing right as the edge arrives. The library characterizes two guard bands:

    • Setup time (tsu): how long D must be stable before the active clock edge.
    • Hold time (th): how long D must remain stable after the edge.

    Together they define a keep-out window straddling the clock edge. Violate it and the flop can enter metastability — its output hovers at an undefined voltage for an unbounded time before randomly settling, which is catastrophic for downstream logic.

    Setup and hold keep-out window CLK D old data stable new data stable data may not change here active clock edge setup (tsu) hold (th) CourseTron · coursetron.com
    The setup/hold keep-out window straddles the capturing clock edge. Data must settle before tsu and stay put through th.

    The setup check: can the data arrive in time?

    Setup is a max-delay check. Data launched from one flop on a clock edge must reach the next flop and be stable before that flop's next capturing edge. The classic inequality for a single-cycle path is:

    Tclk + Tskew ≥ tcq + tlogic + tsetup

    Here Tclk is the clock period, tcq is the launch flop's clock-to-Q delay, tlogic is the combinational path delay, and tsetup is the capture flop's setup requirement. The amount by which the left side exceeds the right is the setup slack. Positive slack = pass; negative = violation.

    Concrete example at 2 GHz (Tclk=500 ps), with tcq=60 ps, tlogic=380 ps, tsetup=40 ps, zero skew: required = 480 ps, available = 500 ps, so slack = +20 ps. Comfortable. Push the clock to 2.1 GHz (476 ps) and slack goes negative — the chip fails setup and you must either shorten the logic, resize cells, or slow the clock.

    Because setup depends on the full period, it is fixed by slowing down the clock — which is why a failing part can often still be sold at a lower bin frequency.

    Setup budget at 2 GHz (500 ps period) 0 ps 500 ps = Tclk 60 logic 380 ps 40 tcq = 60 ps (launch flop) tsetup = 40 ps slack = 500 - 480 = +20 ps Required 60 + 380 + 40 = 480 ps CourseTron · coursetron.com
    Worked example: 60 ps clock-to-Q, 380 ps logic and 40 ps setup consume 480 ps of a 500 ps period, leaving +20 ps of setup slack.

    The hold check: can the data arrive too soon?

    Hold is a min-delay check, and it trips up newcomers because it has nothing to do with clock frequency. The danger is a fast path: new data races through so quickly that it corrupts the same edge that was supposed to capture the old data. The constraint:

    tcq(min) + tlogic(min) ≥ thold + Tskew

    Notice Tclk is absent. You cannot fix a hold violation by changing the clock period — slowing the clock does nothing. Instead EDA tools fix hold by adding delay: inserting buffers or delay cells on the data path. This is why hold fixing happens late in place-and-route, after clock-tree synthesis has pinned down the real skew.

    SetupHold
    Check typeMax delay (slowest path)Min delay (fastest path)
    Depends on Tclk?YesNo
    Capturing edgeNext edgeSame edge
    Typical fixSlow clock, resize/retime logicInsert buffers/delay cells
    PVT cornerSlow (hot, low-V)Fast (cold, high-V)

    How STA checks every path automatically

    You cannot hand-compute millions of paths. Static Timing Analysis (STA) does it exhaustively without simulation vectors. Tools like Synopsys PrimeTime, Cadence Tempus, and the signoff engines in Siemens flows read the netlist, the .lib timing models, parasitic extraction (SPEF), and your constraints (SDC) and compute arrival and required times at every pin.

    For each endpoint STA derives slack = required time − arrival time for setup, and the mirror comparison for hold. It evaluates these across multiple PVT corners and operating modes (MMMC — multi-mode multi-corner), because the worst setup corner is slow silicon while the worst hold corner is fast silicon. A design is signed off only when the worst negative slack (WNS) and total negative slack (TNS) are both non-negative in every corner.

    One timing path: launch, logic, capture FF1 launch comb logic FF2 capture launch edge capture edge setup: arrive before next edge hold: do not race the same edge CourseTron · coursetron.com
    One timing path in motion: FF1 launches a bit on its clock edge; it must settle through the logic cloud before FF2's next edge (setup) without racing through so fast it corrupts FF2's current edge (hold).

    The role of clock skew and uncertainty

    Skew — the difference in clock arrival time between launch and capture flops — cuts both ways. Positive skew (capture clock arrives later) helps setup but hurts hold; it effectively steals time from the same-edge race. This coupling is why a clock tree that looks balanced on paper can still create hold storms, and it is explored in depth in our companion article on clock skew in VLSI. STA also folds in clock uncertainty (jitter plus margin) and on-chip variation (OCV/AOCV/POCV) to keep signoff pessimistic enough to survive real silicon.

    Rule of thumb: if you slow the clock and the violation disappears, it was setup. If slowing the clock changes nothing, it is hold.

    If you want to see how these constraints feed the broader implementation loop, our walkthrough of static timing analysis basics connects setup/hold checks to synthesis and place-and-route decisions. Teams building full signoff flows often pair this knowledge with hands-on PD training — the design-services engineers at Avecas run production STA closure on exactly these corners every day.

    Common pitfalls engineers hit

    • Checking hold at the slow corner — wrong. Hold is worst at the fast corner.
    • Forgetting the min library — if SPEF or .lib min data is missing, hold slack looks falsely healthy.
    • Treating uncertainty as free — reclaiming aggressive setup margin can erase a real guard band.
    • Ignoring multicycle and false paths — unconstrained async crossings produce bogus violations that mask real ones.

    Ready to master timing closure the way interviewers probe it? CourseTron's VLSI Physical Design & STA track takes you from flip-flop internals to full MMMC signoff with real PrimeTime and Tempus labs. Start free today.

    Frequently Asked Questions

    Can a design pass setup but fail hold?

    Absolutely, and it is common. Setup and hold are independent checks on opposite ends of the delay range. A path can comfortably meet the next-edge deadline (setup) yet race through so fast it corrupts the current edge (hold). Hold fixing with buffer insertion is a routine late-stage step.

    Why can't I fix a hold violation by lowering the clock frequency?

    Because the hold inequality contains no clock-period term. Hold is a same-edge race between data and clock; the period cancels out. Lowering frequency only helps setup. Hold is fixed by adding delay to the data path.

    What is negative slack and why does it matter?

    Slack is the margin between when a signal is required and when it actually arrives. Negative slack means the constraint is violated — the chip is not guaranteed to work at that frequency or corner. Signoff requires non-negative worst-negative-slack across all corners and modes.

    Which tools perform setup and hold analysis?

    Industry-standard signoff STA engines are Synopsys PrimeTime and Cadence Tempus, with Siemens EDA flows covering related analysis. They read netlist, Liberty timing models, SPEF parasitics, and SDC constraints to compute slack at every endpoint.

    Advertisement