2. STA Fundamentals - Setup & Hold with Clock Skew

Building on STA Fundamentals, this post covers how clock skew affects setup and hold timing constraints.

What is Clock Skew?

Clock skew is the difference in clock arrival times at two flip-flops due to variations in clock distribution paths.

flowchart TD
    CLK["Clock Source"] --> B1["Buffer"]
    B1 --> B2["Buffer"]
    B1 --> B3["Buffer"]
    B2 --> B4["Buffer"]
    B3 --> B5["Buffer"]
    B4 --> FF1["FF1\n(Launch)"]
    B5 --> FF2["FF2\n(Capture)"]
    
    style CLK fill:#d1fae5,stroke:#10b981
    style FF1 fill:#dbeafe,stroke:#3b82f6
    style FF2 fill:#dbeafe,stroke:#3b82f6
    style B1 fill:#f3f4f6,stroke:#9ca3af
    style B2 fill:#f3f4f6,stroke:#9ca3af
    style B3 fill:#f3f4f6,stroke:#9ca3af
    style B4 fill:#f3f4f6,stroke:#9ca3af
    style B5 fill:#f3f4f6,stroke:#9ca3af
Clock Skew = Tcapture - Tlaunch

Where:

  • Tlaunch = Clock arrival time at launch FF (FF1)
  • Tcapture = Clock arrival time at capture FF (FF2)

Positive vs Negative Skew

Skew TypeConditionEffect on SetupEffect on Hold
PositiveTcapture > TlaunchHelps (more time)Hurts (less margin)
NegativeTcapture < TlaunchHurts (less time)Helps (more margin)
ZeroTcapture = TlaunchNo effectNo effect

Timing with Clock Skew

flowchart LR
    subgraph CLK_PATH["Clock Paths"]
        direction TB
        SRC(["CLK"]) --> |"T_launch"| FF1
        SRC --> |"T_capture"| FF2
    end
    
    subgraph DATA_PATH["Data Path"]
        FF1["FF1"] -->|"Tc2q + Tcomb"| FF2["FF2"]
    end
    
    style FF1 fill:#dbeafe,stroke:#3b82f6
    style FF2 fill:#dbeafe,stroke:#3b82f6
    style SRC fill:#d1fae5,stroke:#10b981

Setup Time with Skew

Data launched from FF1 must arrive at FF2 before the setup time window of the next clock edge.

{ "signal": [
  { "name": "CLK@FF1", "wave": "p.....|p.....", "node": ".a" },
  { "name": "CLK@FF2", "wave": "0.p...|.p....", "node": "..b....c" },
  { "name": "FF1.Q", "wave": "x..3..|......", "data": ["D"] },
  { "name": "FF2.D", "wave": "x....4|......", "data": ["D"] },
  { "name": "", "wave": "" },
  { "name": "Skew", "wave": "x.=...|......", "data": ["+skew"] }
], "edge": ["a->b +skew", "b<->c Tclk"], "head": { "text": "Positive Skew - Setup Analysis" }, "config": { "hscale": 1.5 } }

Setup Constraint Equation

Tclk + Tskew ≥ Tc2q + Tcomb + Tsetup

Rearranging:

Tclk ≥ Tc2q + Tcomb + Tsetup - Tskew
SkewEffect on SetupExplanation
Positive (+)Relaxes constraintCapture clock arrives later, giving data more time
Negative (-)Tightens constraintCapture clock arrives earlier, reducing available time

Hold Time with Skew

Data must not change too quickly after the clock edge. New data from FF1 must not overwrite the current capture.

{ "signal": [
  { "name": "CLK@FF1", "wave": "p.....|p.....", "node": ".a....d" },
  { "name": "CLK@FF2", "wave": "0.p...|.p....", "node": "..b" },
  { "name": "FF1.Q (old)", "wave": "3.....|......", "data": ["D0"] },
  { "name": "FF1.Q (new)", "wave": "x.....3|.....", "data": ["D1"], "node": "......e" },
  { "name": "Hold Window", "wave": "0.1.0.|......", "node": "..f.g" }
], "edge": ["a->b +skew", "f<->g Thold", "d->e Tc2q"], "head": { "text": "Hold Time Analysis" }, "config": { "hscale": 1.5 } }

Hold Constraint Equation

Tc2q + Tcomb ≥ Thold + Tskew

Rearranging:

Tc2q + Tcomb - Tskew ≥ Thold
SkewEffect on HoldExplanation
Positive (+)Tightens constraintCapture clock delayed, new data may arrive during hold window
Negative (-)Relaxes constraintCapture clock earlier, more margin before new data arrives

Setup vs Hold: Skew Trade-off

flowchart LR
    subgraph POSITIVE["Positive Skew"]
        PS_SETUP["Setup: ✓ Helps"]
        PS_HOLD["Hold: ✗ Hurts"]
    end
    
    subgraph NEGATIVE["Negative Skew"]
        NS_SETUP["Setup: ✗ Hurts"]
        NS_HOLD["Hold: ✓ Helps"]
    end
    
    style PS_SETUP fill:#d1fae5,stroke:#10b981
    style PS_HOLD fill:#fee2e2,stroke:#ef4444
    style NS_SETUP fill:#fee2e2,stroke:#ef4444
    style NS_HOLD fill:#d1fae5,stroke:#10b981

Key insight: You cannot optimize for both setup and hold using skew alone. Clock Tree Synthesis (CTS) aims for minimal, balanced skew.

Example Calculation

Given:

  • Tc2q = 0.3 ns
  • Tcomb = 2.0 ns
  • Tsetup = 0.2 ns
  • Thold = 0.1 ns
  • Tskew = +0.5 ns (positive)
// Setup Analysis
Tclk_min = Tc2q + Tcomb + Tsetup - Tskew
         = 0.3 + 2.0 + 0.2 - 0.5
         = 2.0 ns
Fmax = 500 MHz  // Better than without skew!

// Hold Analysis  
Hold_margin = Tc2q + Tcomb - Tskew - Thold
            = 0.3 + 2.0 - 0.5 - 0.1
            = 1.7 ns  // Positive = OK

// With negative skew (-0.5 ns):
Tclk_min = 0.3 + 2.0 + 0.2 - (-0.5) = 3.0 ns  // Worse!
Hold_margin = 0.3 + 2.0 - (-0.5) - 0.1 = 2.7 ns  // Better!

Slack Equations Summary

ConstraintSlack FormulaRequirement
SetupTclk + Tskew - Tc2q - Tcomb - Tsetup≥ 0
HoldTc2q + Tcomb - Tskew - Thold≥ 0

Clock Uncertainty

In real designs, additional factors affect timing:

FactorDescriptionAffects
JitterCycle-to-cycle clock variationSetup
OCVOn-Chip Variation (process/voltage/temp)Both
SkewSpatial clock arrival differenceBoth
Clock Uncertainty = Jitter + Skew + OCV margin

Fixing Timing Violations

Setup Violations

  • Reduce combinational delay (faster cells, logic optimization)
  • Pipeline the path (add registers)
  • Increase clock period (reduce frequency)
  • Useful skew (intentionally delay capture clock)

Hold Violations

  • Add delay buffers in data path
  • Use slower cells
  • Cannot be fixed by changing clock frequency!
flowchart LR
    FF1["FF1"] --> BUF1["Delay\nBuffer"] --> BUF2["Delay\nBuffer"] --> COMB["Comb"] --> FF2["FF2"]
    
    style FF1 fill:#dbeafe,stroke:#3b82f6
    style FF2 fill:#dbeafe,stroke:#3b82f6
    style BUF1 fill:#fef3c7,stroke:#f59e0b
    style BUF2 fill:#fef3c7,stroke:#f59e0b
    style COMB fill:#f3f4f6,stroke:#9ca3af

Key Takeaways

  • Clock skew = Tcapture - Tlaunch
  • Positive skew helps setup, hurts hold
  • Negative skew hurts setup, helps hold
  • Setup violations can be fixed by reducing frequency
  • Hold violations are frequency-independent (more critical!)
  • CTS aims for balanced, minimal skew across the design

STA Commands (Synopsys PrimeTime)

# Report setup timing
report_timing -delay_type max -path_type full

# Report hold timing  
report_timing -delay_type min -path_type full

# Set clock uncertainty
set_clock_uncertainty -setup 0.1 [get_clocks clk]
set_clock_uncertainty -hold 0.05 [get_clocks clk]

# Report clock skew
report_clock_timing -type skew
Author
Mayur Kubavat
VLSI Design and Verification Engineer sharing knowledge about SystemVerilog, UVM, and hardware verification methodologies.

Comments (0)

Leave a Comment