← Physical Design Interviews

Interview Question · Concept

Setup and Hold Checks

L0 FresherL1 Juniorstasetup hold
  • Likely at Apple

The Question

The interviewer asks

What do the setup and hold checks between two flops say? Why does the clock period appear in only one of them?

Reveal the Model Answer

Setup says data launched at one edge must arrive a setup time before the next capture edge. So it compares the slowest path with the period. Hold says new data from the same edge must not race through and corrupt what the capture flop is sampling. So it compares the fastest path with the hold time. Both launch and capture happen on the same edge in the hold check, so the period cancels. Skew enters both, with opposite signs.

Timing pathSetup of the Two-Flop Path, D FallingThe worst setup path: ff1 → u1 (inv_1) → u2 (nand2_1) → ff2, with 0.05 ns of setup uncertainty.

ff1 → ff2setup check, latest arrival3 cells

  • Clock latency
  • Cell delay
  • Uncertainty
  • Setup time
Setup of the two-flop path, D falling00.10.20.30.40.50.60.70.80.91time (ns)launch clk ↑capture clk ↑Data arrivesRequired byff1/CLK → ff1/Q (dfxtp_1): 0.3082 ns1 dfxtp_1u1/A → u1/Y (inv_1): 0.0376 ns2u2/A → u2/Y (nand2_1): 0.0330 ns3uncertainty −0.0500 nssetup −0.0882 nsslack +0.4829 ns · metarrival 0.3789required 0.8618Setup of the two-flop path, D falling00.20.40.60.81time (ns)launch clk ↑capture clk ↑Data arrivesRequired byff1/CLK → ff1/Q (dfxtp_1): 0.3082 ns1 dfxtp_1u1/A → u1/Y (inv_1): 0.0376 nsu2/A → u2/Y (nand2_1): 0.0330 nsuncertainty −0.0500 nssetup −0.0882 nsslack +0.4829 ns · metarrival 0.3789required 0.8618
  1. Arrival

    Clock-to-Q and two gates: D falls at 0.3789 ns.

  2. Required

    The next edge at 1 ns, minus 0.05 ns of uncertainty and a setup time of 0.0882 ns: required at 0.8618 ns.

  3. Slack

    0.4829 ns. So the smallest period that passes for this transition is 1 − 0.4829 = 0.5171 ns.

Read the path as a table

Launch: clk rise edge at 0.0000 ns, clock latency 0.0000 ns (ideal). Capture: clk rise edge at 1.0000 ns, latency 0.0000 ns, uncertainty −0.0500 ns, library setup time −0.0882 ns.

Arrival 0.3789 ns, required 0.8618 ns, slack 0.4829 ns (met).

CellArcThroughEdgeDelay (ns)Time (ns)Slew (ns)
1ff1/CLK → ff1/Qdfxtp_1fall0.30820.30820.0249
ff1/Q → u1/Awire q1fall0.00000.30820.0249
2u1/A → u1/Yinv_1rise0.03760.34590.0299
u1/Y → u2/Awire n1rise0.00000.34590.0299
3u2/A → u2/Ynand2_1fall0.03300.37890.0233
u2/Y → ff2/Dwire n2fall0.00000.37890.0233
The report
Startpoint: ff1 (rising edge-triggered flip-flop clocked by clk)
Endpoint: ff2 (rising edge-triggered flip-flop clocked by clk)
Path Group: clk
Path Type: max

Fanout       Cap      Slew     Delay      Time   Description
-------------------------------------------------------------------------------------
                    0.1000    0.0000    0.0000   clock clk (rise edge)
                              0.0000    0.0000   clock network delay (ideal)
                    0.1000    0.0000    0.0000 ^ ff1/CLK (sky130_fd_sc_hd__dfxtp_1)
     1    0.0022    0.0249    0.3082    0.3082 v ff1/Q (sky130_fd_sc_hd__dfxtp_1)
                                                 q1 (net)
                    0.0249    0.0000    0.3082 v u1/A (sky130_fd_sc_hd__inv_1)
     1    0.0024    0.0299    0.0376    0.3459 ^ u1/Y (sky130_fd_sc_hd__inv_1)
                                                 n1 (net)
                    0.0299    0.0000    0.3459 ^ u2/A (sky130_fd_sc_hd__nand2_1)
     1    0.0017    0.0233    0.0330    0.3789 v u2/Y (sky130_fd_sc_hd__nand2_1)
                                                 n2 (net)
                    0.0233    0.0000    0.3789 v ff2/D (sky130_fd_sc_hd__dfxtp_1)
                                        0.3789   data arrival time

                    0.1000    1.0000    1.0000   clock clk (rise edge)
                              0.0000    1.0000   clock network delay (ideal)
                             -0.0500    0.9500   clock uncertainty
                              0.0000    0.9500   clock reconvergence pessimism
                                        0.9500 ^ ff2/CLK (sky130_fd_sc_hd__dfxtp_1)
                             -0.0882    0.8618   library setup time
                                        0.8618   data required time
-------------------------------------------------------------------------------------
                                        0.8618   data required time
                                       -0.3789   data arrival time
-------------------------------------------------------------------------------------
                                        0.4829   slack (MET)

One setup check, drawn as two lanes. Data arrives on the top lane. The next edge, less uncertainty and setup time, gives the required time below.

Self-Check

Tick each key point you covered in your answer.

What Interviewers Listen For (Fresher)

A good fresher answer writes both inequalities with clock-to-Q, path delay, setup time and hold time. It points out that only the setup check contains the period T.

Cross-Questions

Where the interviewer goes next. Open a node to practise that follow-up.

WhyWhat IfProve ItCompareScale It

  1. Setup and Hold Checks
  2. WhyWhy the Period Cancels in HoldL0 FresherL1 Junior

    Explain, edge by edge, why the hold check does not depend on the clock period.

    Reveal the Model Answer

    At one clock edge the launch flop sends new data and the capture flop samples old data. Hold asks whether the new data reaches the capture flop before its hold window around that same edge closes. Both events come from the same edge, so the period is not in the inequality at all. Setup is different: it compares this edge with the next one.

    Self-Check

    Tick each key point you covered in your answer.

  3. What IfSlowing the Clock to Fix a FailureL1 Junior

    What if a chip fails on the bench? Does lowering the clock frequency tell you whether it is setup or hold?

    Reveal the Model Answer

    Yes, because hold does not depend on the period. A setup failure goes away at a lower frequency. A hold failure stays at any frequency. It needs a fix to the short path or the skew.

    Self-Check

    Tick each key point you covered in your answer.

    Misconception

    "Slow the clock until the hold failure passes."

    That fixes setup only. Hold compares two events from the same edge, so the period never enters it.

    Source Lesson L2.4 key points

  4. What IfWhat Skew Does to Setup and HoldL1 JuniorL2 Mid-Level

    Asked if they mention clock skew

    The capture flop's clock arrives 0.3 ns after the launch flop's. What happens to setup and hold slack?

    Reveal the Model Answer

    Positive skew, capture later than launch, gives setup that much more time and takes the same amount from hold. In lesson L2.4 each extra buffer in front of the capture flop's clock raised setup slack by about 0.073 ns. Hold slack fell by the same amount, until hold failed at the fifth buffer.

    Measured sweepSetup and Hold Slack Against the Buffers in the Capture ClockA 1 ns clock, propagated, with a 0.1 ns slew at the clock port.
    • setup slack
    • hold slack
    -0.4 ns-0.2 ns00.2 ns0.4 ns0.6 ns0.8 ns1.0 ns1.2 nsSlack01234567Capture-clock buffersslack 0-0.5 ns00.5 ns1.0 ns1.5 nsSlack0246Capture-clock buffersslack 0
    1. Capture-clock buffers 0setup slack = 606.7 ps · hold slack = 333.4 ps

      No skew: setup slack 0.6067 ns, hold slack 0.3334 ns. The flop's own clock-to-Q protects hold.

    2. Capture-clock buffers 4setup slack = 900 ps · hold slack = 33.5 ps

      4 buffers: hold slack 0.0335 ns, still met.

    3. Capture-clock buffers 5setup slack = 973.4 ps · hold slack = -39.9 ps

      5 buffers: hold slack -0.0399 ns. Setup has grown to 0.9734 ns, and a slower clock would add only to that.

    Read the plot as a table
    Capture-clock bufferssetup slackhold slack
    0606.7 ps333.4 ps
    1679.8 ps253.8 ps
    2753.3 ps180.2 ps
    3826.6 ps106.9 ps
    4900 ps33.5 ps
    5973.4 ps-39.9 ps
    61.047 ns-113.3 ps
    71.12 ns-186.6 ps

    Each buffer added to the capture clock raises setup slack and lowers hold slack by the same step. Hold fails at the fifth buffer.

    Self-Check

    Tick each key point you covered in your answer.

  5. Prove ItSolve L2.4.1: The Smallest Hold RepairSimulator-graded

    Show it, don't just say it: this Silicon Lab problem is graded by the simulator.

    Open Problem L2.4.1

  6. CompareWhich Corner Is Worst for Setup and for HoldL1 JuniorL2 Mid-Level

    Compare the corners at which setup and hold are usually worst, and say why you check both everywhere.

    Reveal the Model Answer

    Setup is usually worst where cells are slowest: a slow process at low voltage. Hold is usually worst where they are fastest: a fast process at high voltage. In the lesson's small clock tree the fast cold corner had the smallest hold slack, 0.2397 ns, and the slow corners failed setup. Skew and wire delays do not scale like cell delays, so sign-off still runs both checks at every corner.

    Timing pathHold at ff_n40C_1v95

    ffl → ffchold check, earliest arrival2 cells

    • Clock latency
    • Cell delay
    • Hold time
    Hold at ff_n40C_1v9500.050.10.150.20.250.30.35time (ns)launch and capture clk ↑Data arrivesRequired afterclock 0.1420 nsclock 0.1420ffl/CLK → ffl/Q (dfxtp_1): 0.1879 ns1 dfxtp_1u2/B → u2/Y (nand2_1): 0.0351 ns2clock 0.1420 nshold −0.0167 nsslack +0.2397 ns · metarrival 0.3650required 0.1253Hold at ff_n40C_1v9500.10.20.3time (ns)launch and capture clk ↑Data arrivesRequired afterclock 0.1420 nsclock 0.1420ffl/CLK → ffl/Q (dfxtp_1): 0.1879 ns1 dfxtp_1u2/B → u2/Y (nand2_1): 0.0351 ns2clock 0.1420 nshold −0.0167 nsslack +0.2397 ns · metarrival 0.3650required 0.1253
    Read the path as a table

    Launch: clk rise edge at 0.0000 ns, clock latency 0.1420 ns. Capture: clk rise edge at 0.0000 ns, latency 0.1420 ns, library hold time −0.0167 ns.

    Arrival 0.3650 ns, required 0.1253 ns, slack 0.2397 ns (met).

    CellArcThroughEdgeDelay (ns)Time (ns)Slew (ns)
    1ffl/CLK → ffl/Qdfxtp_1fall0.18790.33000.0247
    ffl/Q → u2/Bwire q1fall0.00000.33000.0247
    2u2/B → u2/Ynand2_1rise0.03510.36500.0210
    u2/Y → ffc/Dwire n2rise0.00000.36500.0210
    The report
    Startpoint: ffl (rising edge-triggered flip-flop clocked by clk)
    Endpoint: ffc (rising edge-triggered flip-flop clocked by clk)
    Path Group: clk
    Path Type: min
    
    Fanout       Cap      Slew     Delay      Time   Description
    -------------------------------------------------------------------------------------
                                  0.0000    0.0000   clock clk (rise edge)
                                  0.0000    0.0000   clock source latency
         1    0.0023    0.1000    0.0000    0.0000 ^ clk (in)
                                                     clk (net)
                        0.1000    0.0000    0.0000 ^ root/A (sky130_fd_sc_hd__clkbuf_4)
         2    0.0045    0.0251    0.0966    0.0966 ^ root/X (sky130_fd_sc_hd__clkbuf_4)
                                                     cr (net)
                        0.0251    0.0000    0.0966 ^ bl/A (sky130_fd_sc_hd__clkbuf_1)
         1    0.0019    0.0260    0.0454    0.1420 ^ bl/X (sky130_fd_sc_hd__clkbuf_1)
                                                     cl (net)
                        0.0260    0.0000    0.1420 ^ ffl/CLK (sky130_fd_sc_hd__dfxtp_1)
         2    0.0044    0.0247    0.1879    0.3300 v ffl/Q (sky130_fd_sc_hd__dfxtp_1)
                                                     q1 (net)
                        0.0247    0.0000    0.3300 v u2/B (sky130_fd_sc_hd__nand2_1)
         1    0.0017    0.0210    0.0351    0.3650 ^ u2/Y (sky130_fd_sc_hd__nand2_1)
                                                     n2 (net)
                        0.0210    0.0000    0.3650 ^ ffc/D (sky130_fd_sc_hd__dfxtp_1)
                                            0.3650   data arrival time
    
                                  0.0000    0.0000   clock clk (rise edge)
                                  0.0000    0.0000   clock source latency
         1    0.0023    0.1000    0.0000    0.0000 ^ clk (in)
                                                     clk (net)
                        0.1000    0.0000    0.0000 ^ root/A (sky130_fd_sc_hd__clkbuf_4)
         2    0.0045    0.0251    0.0966    0.0966 ^ root/X (sky130_fd_sc_hd__clkbuf_4)
                                                     cr (net)
                        0.0251    0.0000    0.0966 ^ bc/A (sky130_fd_sc_hd__clkbuf_1)
         1    0.0019    0.0260    0.0454    0.1420 ^ bc/X (sky130_fd_sc_hd__clkbuf_1)
                                                     cc (net)
                        0.0260    0.0000    0.1420 ^ ffc/CLK (sky130_fd_sc_hd__dfxtp_1)
                                  0.0000    0.1420   clock reconvergence pessimism
                                 -0.0167    0.1253   library hold time
                                            0.1253   data required time
    -------------------------------------------------------------------------------------
                                            0.1253   data required time
                                           -0.3650   data arrival time
    -------------------------------------------------------------------------------------
                                            0.2397   slack (MET)

    Hold at the fast, cold corner: 0.2397 ns, the smallest hold slack of the three corners.

    create_clock -name clk -period 1.0 [get_ports clk]
    set_propagated_clock [all_clocks]
    set_input_transition 0.1 [get_ports clk]
    

    Prints: 0.6973 slack (MET) 0.2397 slack (MET)

    Self-Check

    Tick each key point you covered in your answer.

  7. Scale ItPruning the Mode and Corner MatrixL3 SeniorL4 Staff

    Your chip has five modes and twelve corners. How do you keep sign-off affordable without missing the worst case?

    Reveal the Model Answer

    Start from the full matrix, and drop a view only with evidence that another view always dominates it. Get that evidence by running everything once on an early netlist, for example. Keep every view that is worst for some endpoint group in any check. Optimise on a small set of dominant views, but run the full set at sign-off and after every late change.

    Self-Check

    Tick each key point you covered in your answer.

What People Get Wrong

Common wrong answers and why they fail. Run It shows the wrong belief failing on a real simulator.

Misconception

"If hold fails, slow the clock down."

The hold check compares the launch and capture of one edge, so the period never enters it. This hold failure reads -0.0399 ns at 1 ns and at 2 ns; a delay cell on the data path fixes it.

Run It

The two-flop shift register from lesson L2.4 at a 2 ns clock, with ff2's clock behind five buffers.

create_clock -name clk -period 2 [get_ports clk]
set_propagated_clock [all_clocks]
set_input_transition 0.1 [get_ports clk]

Prints: 1.9734 slack (MET) -0.0399 slack (VIOLATED)

See the Fix
create_clock -name clk -period 1.0 [get_ports clk]
set_propagated_clock [all_clocks]
set_input_transition 0.1 [get_ports clk]

Prints: 0.4336 slack (MET) 0.4835 slack (MET)

Missed Corner

"Setup and hold times in the library are fixed positive numbers."

They are tables indexed by the data and clock slews, and hold can be negative. This flop's hold time in the twin's report is -0.0300 ns.

Source sky130_fd_sc_hd__tt_025C_1v80.lib, dfxtp_1 hold_rising tables; ASIC Point lesson L2.4 (measured)

Buzzword Without Mechanism

Defines setup as "data must be stable before the clock" and stops.

That names the window but not the path. The interviewer wants the inequality: which delays are summed on each side, and which edges are compared.

Learn It, Then Prove It