A flat derate treats a single gate and a thirty-stage path alike. Random variation does not behave that way: if each stage varies independently, the variation of the sum is relatively smaller for more stages. Depth-based derating, often called advanced on-chip variation, captures this with a table of derates indexed by stage count (and often by distance).
import math
sigma_rel, k = 0.05, 3.0 # per-stage relative sigma and the number of sigmas the table covers (illustrative)
def derate(n):
return 1.0 + k * sigma_rel / math.sqrt(n)
table = {n: round(derate(n), 4) for n in (1, 4, 9, 16, 25)}
assert table == {1: 1.15, 4: 1.075, 9: 1.05, 16: 1.0375, 25: 1.03}
# a 9-stage path of 0.90 ns: flat 1.15 versus depth-based 1.05
path = 0.90
cost_flat = path * (1.15 - 1.0)
cost_depth = path * (derate(9) - 1.0)
assert round(cost_flat, 3) == 0.135 and round(cost_depth, 3) == 0.045
assert round(cost_flat - cost_depth, 3) == 0.090
print("PASS: derate by depth", table, "; saving on the 9-stage path", round(cost_flat - cost_depth, 3), "ns")Stages | 1 | 4 | 9 | 16 | 25 |
|---|---|---|---|---|---|
Derate (illustrative) | 1.150 | 1.075 | 1.050 | 1.0375 | 1.030 |
The excess over 1 falls as 1 over the square root of the stage count. A flat derate must be set for the worst case, one stage, so it is 1.15 everywhere. On a nine-stage, 0.90 ns path that costs 0.135 ns, against 0.045 ns with the depth-based value: 0.090 ns recovered. Real tables are characterised from library and silicon data, depend on distance across the die as well, and need not follow this formula; the formula only shows the mechanism.
The table's source and version are recorded; a table from a different process or library revision is a different analysis.
Depth is counted the way the table was characterised (record which definition is used) and the same way in every flow.
Early and late tables are both present and used with the right direction for setup and hold.
It is set for the worst case of one stage (1.15 here), while its derate is only 1.03 (an excess of 0.03); the extra 0.12 of derate is margin the path does not need.