Hold fixes are usually found on very short paths, where relative variation is greatest. Setup problems are usually on long paths, where a flat derate is most wasteful. Putting both on one scale shows where each method matters.
import math
def spread(n, k=3.0, s=0.05):
return k * s / math.sqrt(n) # relative derate from depth (same model as the depth lesson)
# Hold: 2-stage path of 0.20 ns; hold requirement including skew 0.10 ns.
hold_path, hold_req, flat_early = 0.20, 0.10, 0.85
slack_nominal = hold_path - hold_req
slack_flat = hold_path * flat_early - hold_req
slack_depth = hold_path * (1 - spread(2)) - hold_req
assert round(slack_nominal, 3) == 0.10 and round(slack_flat, 3) == 0.07 and round(slack_depth, 4) == 0.0788
# Setup: 20-stage path of 2.00 ns.
setup_path = 2.00
cost_flat = setup_path * 0.15
cost_depth = setup_path * spread(20)
assert round(cost_flat, 3) == 0.300 and round(cost_depth, 3) == 0.067
assert round(cost_flat - cost_depth, 3) == 0.233
print("PASS: hold slack nominal/flat/depth", round(slack_nominal, 3), round(slack_flat, 3), round(slack_depth, 4), "; setup cost flat/depth", round(cost_flat, 3), round(cost_depth, 3))Path | Method | Effect |
|---|---|---|
Hold, 2 stages, 0.20 ns | Nominal | Slack 0.100 ns |
Hold, 2 stages, 0.20 ns | Flat early 0.85 | Slack 0.070 ns |
Hold, 2 stages, 0.20 ns | Depth-based (0.894) | Slack 0.079 ns |
Setup, 20 stages, 2.00 ns | Flat late 1.15 | Costs 0.300 ns |
Setup, 20 stages, 2.00 ns | Depth-based (1.034) | Costs 0.067 ns |
On the short hold path the derate is large in relative terms (10.6% for two stages) but small in absolute terms because the path is short: 0.021 ns against 0.030 ns for flat. On the deep setup path the same two methods differ by 0.233 ns, which is a large part of a typical margin budget. Depth-based analysis therefore matters most for setup closure on long paths, while hold closure is dominated by how small the absolute slack already is.
Hold analysis uses the early derate on the launch path and the late derate on the capture clock; setup the reverse.
Short paths are reviewed for absolute slack, because a small relative derate can still consume a small margin.
Setup paths with large derate cost are the first to benefit from a method change; show the saving before proposing one.
The 20-stage setup path, which gains 0.233 ns; the 2-stage hold path gains only about 0.009 ns.