Algorithm Search⌘K

Definitionintro

Setup and hold constraints

Also called setup time, hold time.

A register's data must be stable from the setup time before to the hold time after the clock edge, which bounds the longest and the shortest paths.

An edge-triggered register (a flip-flop) copies its data input DD to its output QQ at each active edge of its clock. It copies the value correctly only if DD is stable during a short window around the edge: from the setup time tsetupt_{\text{setup}} before the edge to the hold time tholdt_{\text{hold}} after it. For a path from one register to another this gives two inequalities: the setup constraint bounds the longest delay of the path from above, and the hold constraint bounds the shortest delay from below. Static timing analysis checks the setup constraint with the late arrival times and the hold constraint with the early ones.

Definition

Consider a launch register R1R_1 and a capture register R2R_2 with a combinational path from QQ of R1R_1 to DD of R2R_2, and a clock with period TT. Let claunchc_{\text{launch}} and ccapturec_{\text{capture}} be the times at which a clock edge reaches the clock pins of R1R_1 and R2R_2. Let dmax⁡d_{\max} and dmin⁡d_{\min} be the largest and the smallest delay from the clock pin of R1R_1 to the data pin of R2R_2, over all paths between them; they include the clock-to-output delay of R1R_1.

Setup constraint. The value launched at an edge must reach R2R_2 at least tsetupt_{\text{setup}} before the next edge at R2R_2:

claunch+dmax⁡+tsetup≤ccapture+T.c_{\text{launch}} + d_{\max} + t_{\text{setup}} \le c_{\text{capture}} + T.

The setup slack is S=ccapture+T−tsetup−(claunch+dmax⁡)S = c_{\text{capture}} + T - t_{\text{setup}} - (c_{\text{launch}} + d_{\max}).

Hold constraint. The value launched at an edge must not reach R2R_2 before tholdt_{\text{hold}} after the same edge at R2R_2, or it would replace the value that R2R_2 is capturing at that edge:

claunch+dmin⁡≥ccapture+thold.c_{\text{launch}} + d_{\min} \ge c_{\text{capture}} + t_{\text{hold}}.

The hold slack is H=claunch+dmin⁡−(ccapture+thold)H = c_{\text{launch}} + d_{\min} - (c_{\text{capture}} + t_{\text{hold}}). A negative SS or HH is a violation.

Late for setup, early for hold. The setup check uses the largest delay and the latest launch, and the hold check uses the smallest delay and the earliest launch. In the words of arrival and required time: the data pin of R2R_2 has the late required time ccapture+T−tsetupc_{\text{capture}} + T - t_{\text{setup}} and the early required time ccapture+tholdc_{\text{capture}} + t_{\text{hold}}. Using the late arrival for the hold check would hide every hold violation.

Skew. Let s=ccapture−claunchs = c_{\text{capture}} - c_{\text{launch}} be the clock skew of the pair. The constraints become

dmax⁡≤T+s−tsetup,dmin⁡≥s+thold.d_{\max} \le T + s - t_{\text{setup}}, \qquad d_{\min} \ge s + t_{\text{hold}}.

A positive skew helps the setup constraint and hurts the hold constraint by the same amount. This is the clock skew between two registers of one chip. The clock skew of distributed systems is the offset between the clocks of two processes, a different idea.

Two facts that follow.

  • The hold constraint does not contain TT. A hold violation stays at every clock period, so it cannot be fixed by a slower clock. It is fixed by more delay on the short path or by less skew.
  • If every register pair meets its hold constraint, the circuit works at every period T≥Tmin⁡T \ge T_{\min}, where Tmin⁡=max⁡(claunch−ccapture+dmax⁡+tsetup)T_{\min} = \max (c_{\text{launch}} - c_{\text{capture}} + d_{\max} + t_{\text{setup}}) over all register pairs joined by a path. With zero skew, Tmin⁡T_{\min} is the longest register-to-register delay plus the setup time.

The values tsetupt_{\text{setup}} and tholdt_{\text{hold}} are properties of the register cell, given in its library, and can depend on the slews of the data and clock signals. Either one can be negative, but their sum, the width of the window in which DD must be stable, is positive for a real register.

Examples and non-examples

One register pair. Let T=10T = 10, claunch=0c_{\text{launch}} = 0, ccapture=1c_{\text{capture}} = 1, dmax⁡=7d_{\max} = 7, dmin⁡=2d_{\min} = 2, tsetup=1t_{\text{setup}} = 1 and thold=1.5t_{\text{hold}} = 1.5. The setup slack is 1+10−1−(0+7)=31 + 10 - 1 - (0 + 7) = 3, so the path meets setup, and it would meet setup at every period T≥7T \ge 7. The hold slack is 0+2−(1+1.5)=−0.50 + 2 - (1 + 1.5) = -0.5, a violation at every period. A delay buffer of 0.50.5 on the short path only gives dmin⁡=2.5d_{\min} = 2.5 and hold slack 0. If the buffer also lies on the long path, dmax⁡d_{\max} becomes 7.57.5 and the setup slack 2.52.5.

A shift register. Let the output QQ of R1R_1 drive DD of R2R_2 by a wire with no delay, with clock-to-output delay 0.30.3, so dmin⁡=dmax⁡=0.3d_{\min} = d_{\max} = 0.3. With thold=0.2t_{\text{hold}} = 0.2 and a skew s=0.2s = 0.2, the hold slack is 0.3−0.2−0.2=−0.10.3 - 0.2 - 0.2 = -0.1. Short paths between neighboring registers are where hold violations appear, and they become worse when the clock reaches the capture register later.

Non-example: a latch. A level-sensitive latch is transparent while its clock is high. Data that arrives late during the transparent phase passes through and uses time of the next stage (time borrowing). The two inequalities above, with a single edge per register, do not describe it; latch timing needs a constraint per phase.

Non-example: the delay of one path. dmax⁡d_{\max} and dmin⁡d_{\min} range over all paths from R1R_1 to R2R_2. Checking only the path that a simulation happens to excite is not a setup or hold check. A path that no input can excite may be excluded, but only as a declared false path.

  • Multicycle path. If the design captures the data of a path only every kk cycles, the setup constraint uses kTkT in place of TT, and the hold check moves by k−1k - 1 cycles too. Tools need both settings, and forgetting the hold setting is a known mistake.
  • Clock skew scheduling. If the clock times cic_i are variables, all setup and hold inequalities are difference constraints ci−cj≤wijc_i - c_j \le w_{ij}. Clock skew scheduling chooses the cic_i, and retiming moves the registers instead.
  • Clock tree synthesis. The skews ss come from the clock tree, which is built for zero or bounded skew.
  • Recovery and removal. For an asynchronous reset pin, the same two checks against the clock edge are called recovery (like setup) and removal (like hold).
  • Metastability. When DD changes inside the window, the register may stay between 0 and 1 for an unbounded time. Setup and hold constraints are the condition under which this does not happen for synchronous paths.

References

  1. J. Bhasker and Rakesh Chadha, Static Timing Analysis for Nanometer Designs, A Practical Approach, Springer, 2009, Chapter 8, Timing Verification (the setup and hold timing checks, multicycle paths and false paths)
  2. John P. Fishburn, Clock skew optimization, IEEE Transactions on Computers 39(7), 945 to 951, 1990, the two constraints on each pair of registers (zero clocking for the long paths and double clocking for the short paths)
  3. Andrew B. Kahng, Jens Lienig, Igor L. Markov and Jin Hu, VLSI Physical Design, From Graph Partitioning to Timing Closure, Springer, 1st edition, 2011, Chapter 8, Timing Closure, Section 8.2 (timing analysis and performance constraints)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/D3XRM3/text.yaml