A library delay table gives cell delay against input slew and load capacitance. This lesson fixes the slew and reads delay against load only.
The EXAMPLE table below is linear: delay equals a base plus a slope times load. Real tables curve, so this form is a teaching stand-in.
Load (EXAMPLE fF) | Delay (EXAMPLE ns) |
|---|---|
1 | 0.5 |
2 | 0.7 |
4 | 1.1 |
8 | 1.9 |
Take 2 fF of wire plus 1 fF per sink. The calc block compares 1 sink against 8 sinks.
EXAMPLE table at fixed input slew: d = 0.3 + 0.2 x C, EXAMPLE ns and EXAMPLE fF
1 sink: C = 2 + 1 x 1 = 3 fF, d = 0.3 + 0.2 x 3 = 0.9 ns
8 sinks: C = 2 + 8 x 1 = 10 fF, d = 0.3 + 0.2 x 10 = 2.3 ns
extra delay from 7 more sinks = 2.3 - 0.9 = 1.4 nsThe program below implements the EXAMPLE table. Its five self-checks replay the rows and the worked driver.
import sys
D0 = 0.3
K = 0.2
def driver_delay(load_ff):
return D0 + K * load_ff
def close(got, want):
return abs(got - want) < 1e-9
checks = [
(driver_delay(1), 0.5),
(driver_delay(3), 0.9),
(driver_delay(4), 1.1),
(driver_delay(8), 1.9),
(driver_delay(10), 2.3),
]
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))
sys.exit(1)
print("PASS: delay model matches the table on 5 loads")1.1 EXAMPLE ns: 0.3 + 0.8. That row sits in both the table and the program checks.
It proves the code agrees with the hand-worked rows. It leaves open whether the EXAMPLE slope matches any real library.