Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Logic Synthesis Glossary
  • Logic Synthesis Cheatsheet
  • Synthesis Foundations14
  • Logic Optimisation and Mapping20
  • Constraints and Timing15
    • SDC for Synthesis
    • Delay Models and Slack
      • Arrival, Required Time and Slack
      • Setup, Hold and Clock-to-Q
      • Cell Delay Models
      • Wire Delay at Synthesis Time
      • A Static Timing Calculator
    • Timing-Driven Synthesis
  • Sequential, FSM and Memory19
  • Datapath Synthesis14
  • Area, Power and Test14
  • Verification, ECO and Handoff15
  • Flows and Debugging15
  • Interview and Judgment11
Loading lesson

‹Delay Models and Slack
  1. Topics
  2. Logic Synthesis
  3. Constraints and Timing
  4. Delay Models and Slack
  5. A Static Timing Calculator

Part 3 · Constraints and Timing · Intermediate

A Static Timing Calculator

A runnable static timing calculator over a small cell DAG.

On this page

    The example graph

    A five-node DAG stands in for placed cells: source S feeds A and B, both feed C, and C feeds endpoint OUT. Edge labels are EXAMPLE stage delays in ns.

    The endpoint requires 1.50 ns. Every number below is hand-checkable against the diagram.

    Five-node timing graph with stage delays and the required time.
    The example DAG with EXAMPLE stage delays and the endpoint requirement.

    Forward and backward passes

    The forward pass takes the maximum over incoming edges: each arrival is the latest input plus its edge. The backward pass takes the minimum over outgoing edges: each required time is the tightest successor minus its edge.

    Slack at each node is required minus arrival. Nodes with the smallest slack form the critical path.

    Diagram
    EXAMPLE parameters (not real library values), all in ns
    forward (arrival = max over inputs plus edge):
    A = 0.00 + 0.30 = 0.30; B = 0.00 + 0.50 = 0.50
    C = max(0.30 + 0.40, 0.50 + 0.10) = max(0.70, 0.60) = 0.70
    OUT = 0.70 + 0.60 = 1.30
    backward (required = min over successors minus edge), OUT required 1.50:
    C = 1.50 - 0.60 = 0.90; A = 0.90 - 0.40 = 0.50; B = 0.90 - 0.10 = 0.80
    S = min(0.50 - 0.30, 0.80 - 0.50) = min(0.20, 0.30) = 0.20
    slack = required - arrival:
    S 0.20 - 0.00 = 0.20; A 0.50 - 0.30 = 0.20; B 0.80 - 0.50 = 0.30
    C 0.90 - 0.70 = 0.20; OUT 1.50 - 1.30 = 0.20
    critical path: S -> A -> C -> OUT at slack 0.20 ns

    A runnable calculator

    The program below runs both passes on the example graph. Its fifteen self-checks repeat every hand number from the block above plus the critical path.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    import sys
    
    ORDER = ["S", "A", "B", "C", "OUT"]
    PREDS = {
        "S": [],
        "A": [("S", 0.30)],
        "B": [("S", 0.50)],
        "C": [("A", 0.40), ("B", 0.10)],
        "OUT": [("C", 0.60)],
    }
    REQ_OUT = 1.50
    
    SUCCS = {n: [] for n in ORDER}
    for n, plist in PREDS.items():
        for p, d in plist:
            SUCCS[p].append((n, d))
    
    arrival = {"S": 0.0}
    for n in ORDER[1:]:
        arrival[n] = max(arrival[p] + d for p, d in PREDS[n])
    
    required = {"OUT": REQ_OUT}
    for n in reversed(ORDER[:-1]):
        required[n] = min(required[s] - d for s, d in SUCCS[n])
    
    slack = {n: required[n] - arrival[n] for n in ORDER}
    
    cur = "S"
    path = ["S"]
    while cur != "OUT":
        nxt = min(SUCCS[cur], key=lambda pd: (slack[pd[0]], pd[0]))[0]
        path.append(nxt)
        cur = nxt
    
    def close(got, want):
        return abs(got - want) < 1e-9
    
    checks = [
        (arrival["A"], 0.30),
        (arrival["B"], 0.50),
        (arrival["C"], 0.70),
        (arrival["OUT"], 1.30),
        (required["OUT"], 1.50),
        (required["C"], 0.90),
        (required["A"], 0.50),
        (required["B"], 0.80),
        (required["S"], 0.20),
        (slack["S"], 0.20),
        (slack["A"], 0.20),
        (slack["B"], 0.30),
        (slack["C"], 0.20),
        (slack["OUT"], 0.20),
    ]
    
    ok = True
    for i in range(len(checks)):
        got, want = checks[i]
        if not close(got, want):
            print("FAIL: check " + str(i + 1) + " got " + str(got) + " want " + str(want))
            ok = False
    if path != ["S", "A", "C", "OUT"]:
        print("FAIL: critical path " + str(path))
        ok = False
    if not ok:
        sys.exit(1)
    
    print("PASS: calculator matches hand arrival, required and slack on 15 checks")

    Common mistakes

    Common pitfall

    Taking the minimum in the forward pass (or the maximum in the backward pass) reports the fastest path as critical. Arrival propagates the latest input; required propagates the tightest successor.

    Interview

    Likely probes: the two passes and where the critical path comes from.

    • Arrival goes forward with max; required goes backward with min.

    • The critical path joins the nodes with the smallest slack, here S, A, C and OUT.

    • Branch B has 0.30 ns of slack, so it carries 0.10 ns of margin over the critical path.

    Check yourself Node C has inputs arriving at 0.70 and 0.60 ns. What is its arrival, and which branch sets it?

    0.70 ns, set by the A branch. Arrival takes the maximum.

    Check yourself All fifteen program checks pass. What does that prove about the diagram?

    The code agrees with the hand arithmetic on every node and the critical path. It leaves open whether the EXAMPLE delays match any real library.

    Related topics

    • Arrival, Required Time and Slack

    • Timing-Driven Synthesis

    • STA Foundations

    Previous

    46 / 139

    Next: Timing-Driven Synthesis

    Up next

    Up nextTiming-Driven Synthesis

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Arrival, Required Time and Slack
    • Setup, Hold and Clock-to-Q
    • Cell Delay Models