Algorithm Search⌘K

Algorithmadvanced

Devgan noise metric

Also called Devgan coupled noise estimate.

Devgan's upper bound on crosstalk noise peak in an RC tree, the Elmore-like sum of resistances times coupling currents, computable in linear time.

Time
O(n + m) worst
Space
O(n) extra
Where
m = the number of coupling capacitors; n = the number of nodes of the victim tree
Properties
deterministicnot exactofflineiterative
Origin
Anirudh Devgan, 1997

The Devgan noise metric is a fast upper bound on the crosstalk noise that switching neighbor wires couple into a quiet victim net. The victim is an RC tree held at 0 by its driver, and each aggressor couples into it through coupling capacitors. The metric at node ii is Vi=∑kRikIkV_i = \sum_k R_{ik} I_k, where IkI_k is the coupling capacitance at node kk times the aggressor slew rate and RikR_{ik} is the resistance shared by the paths from the driver to ii and to kk. It has the shape of the Elmore delay with currents in place of capacitances, and the same two tree passes compute it in linear time. Under the stated linear model it is a proved upper bound on the peak noise for every aggressor waveform whose slope stays within the given rate.

In plain words

When a wire switches, it pushes a small current into its quiet neighbor through the capacitance between them. That current flows through the neighbor's wire back to its driver and raises the voltage on the way. The bump is crosstalk noise.

The bump is largest when the switching wire keeps changing at its fastest rate for a long time. Then each current is constant, and the bump settles at the current times the resistance it crosses. The metric takes this settled level as the answer.

A real switching wire stops after a short time, so the real bump is lower. The metric is always on the safe side, often by a lot for fast edges. It costs only two passes over the wire, so a tool can check millions of nets and keep the few dangerous ones for an exact analysis.

The problem

The input is a victim tree with nodes 0,…,n−10, \ldots, n-1, where node 0 is the driver output and p(k)<kp(k) < k is the parent of node k≥1k \ge 1. The value r0r_0 is the holding resistance of the quiet driver to ground, and rkr_k is the wire resistance from p(k)p(k) to kk. Node kk has a capacitance ckc_k to ground and coupling capacitances Ck,aC_{k,a} to aggressors aa, and each aggressor voltage ua(t)u_a(t) has slope at most sas_a in absolute value. For a ramp of swing VDDV_{DD} and rise time trt_r, sa=VDD/trs_a = V_{DD} / t_r.

With ideal aggressor sources, Kirchhoff's current law gives the linear system

Cv′(t)+Gv(t)=Bu′(t),v(0)=0,C v'(t) + G v(t) = B u'(t), \qquad v(0) = 0,

where GG is the conductance matrix of the tree, CC is the diagonal matrix of total node capacitance (ground plus coupling), and Bk,a=Ck,aB_{k,a} = C_{k,a}. The output is a vector VV with ∣vi(t)∣≤Vi|v_i(t)| \le V_i for all tt and ii, computed without solving the system in time.

The algorithm

  1. DEVGAN-NOISE(p, r, Cc, s)
  2. 1for k ← 0 to n − 1 do I[k] ← Σ over couplings (C, a) of node k of C · s[a]
  3. 2for k ← n − 1 downto 1 do ▷ children before parents, since p(k) < k
  4. 3I[p(k)] ← I[p(k)] + I[k]
  5. 4V[0] ← r[0] · I[0] ▷ the whole coupling current crosses the driver
  6. 5for k ← 1 to n − 1 do ▷ parents before children
  7. 6V[k] ← V[p(k)] + r[k] · I[k]
  8. 7return V

After line L3, I[k]I[k] is the total coupling current injected in the subtree of kk, which is the current that crosses the resistance rkr_k in the settled state. Line L6 adds the drop across that resistance to the voltage of the parent. This is exactly the downstream form of the Elmore delay, with injected currents in place of downstream capacitances.

Example

Units are kΩ, fF, ps and V, so a current in fF V/ps is in mA. The victim has a driver node 0 with r0=1r_0 = 1 and c0=5c_0 = 5, a branch node 1 with r1=0.5r_1 = 0.5 and c1=10c_1 = 10, and two sinks, node 2 under node 1 with r2=0.5r_2 = 0.5 and c2=10c_2 = 10, and node 3 under node 1 with r3=1r_3 = 1 and c3=15c_3 = 15. One aggressor couples 10 fF into node 1 and 10 fF into node 2. It rises by 1 V in tr=50t_r = 50 ps, so s=0.02s = 0.02 V/ps.

step node 0 node 1 node 2 node 3
L1: Ik=CksI_k = C_{k} s 0 0.2 0.2 0
L2 to L3: subtree current 0.4 0.4 0.2 0
L4 to L6: VV 1⋅0.4=0.41 \cdot 0.4 = 0.4 0.4+0.5⋅0.4=0.60.4 + 0.5 \cdot 0.4 = 0.6 0.6+0.5⋅0.2=0.70.6 + 0.5 \cdot 0.2 = 0.7 0.6+1⋅0=0.60.6 + 1 \cdot 0 = 0.6

The exact peak of ∣vi(t)∣|v_i(t)| comes from the exact solution of the linear system, piece by piece over the ramp and after it. The table compares it with the metric for four rise times. The metric scales as 1/tr1 / t_r.

trt_r (ps) metric at node 2 (V) exact peak at nodes 0, 1, 2, 3 (V) peak / metric
10 3.5 0.223, 0.364, 0.458, 0.233 0.08 to 0.13
50 0.7 0.170, 0.260, 0.318, 0.217 0.36 to 0.45
200 0.175 0.088, 0.133, 0.156, 0.130 0.87 to 0.89
1000 0.035 0.020, 0.030, 0.035, 0.030 1.00

The Elmore delay of node 2, with total node capacitances 5, 20, 20 and 15 fF, is 97.5 ps. For a rise time much longer than that, the metric is almost exact. For a rise time much shorter, it is pessimistic by a large factor: at 10 ps the metric at node 2 is 3.5 V, while the true peak is 0.46 V, and a step can never couple more than the charge sharing limit Cc/(Cc+Cg)C_c / (C_c + C_g) of the supply. Node 3 has no coupling of its own, yet its noise is nonzero, because the current of the other nodes crosses the shared resistance r0+r1r_0 + r_1.

Correctness

The full proof has four parts.

The bound. The matrix −C−1G-C^{-1}G has nonnegative entries off the diagonal, so e−C−1Gte^{-C^{-1}G t} has nonnegative entries for every t≥0t \ge 0. The solution is v(t)=∫0te−C−1G(t−τ)C−1Bu′(τ) dτv(t) = \int_0^t e^{-C^{-1}G(t - \tau)} C^{-1} B u'(\tau)\, d\tau. Replacing ∣u′∣|u'| by its bound ss and extending the integral to infinity can only increase each entry, and ∫0∞e−C−1Gσdσ=G−1C\int_0^\infty e^{-C^{-1}G\sigma} d\sigma = G^{-1} C. So ∣v(t)∣≤G−1Bs|v(t)| \le G^{-1} B s entry by entry. With one rising aggressor, also v(t)≥0v(t) \ge 0.

The tree form. G−1G^{-1} is the matrix of shared path resistances RikR_{ik}, so G−1Bs=∑kRikIkG^{-1} B s = \sum_k R_{ik} I_k, and the two passes compute this sum by the same exchange of sums that proves the downstream Elmore formula.

Tightness. For an aggressor whose slope stays at ss forever, v(t)=(I−e−C−1Gt)Vv(t) = (I - e^{-C^{-1}Gt}) V tends to VV. So no bound that uses only the slopes can be smaller. For one node and a ramp of rise time trt_r, the peak is exactly V(1−e−tr/τ)V (1 - e^{-t_r / \tau}) with τ=r0(c0+Cc)\tau = r_0 (c_0 + C_c).

Discrete version. Backward Euler with any step hh keeps the bound exactly. The matrix C+hGC + hG is strictly diagonally dominant with nonpositive entries off the diagonal, so its inverse has nonnegative entries, and ∣vj∣≤V|v_j| \le V implies ∣vj+1∣≤(C+hG)−1(CV+hGV)=V|v_{j+1}| \le (C + hG)^{-1}(CV + hGV) = V.

What is proved is the bound under the linear model. What is measured is the tightness. On 80 random trees of 1 to 5 nodes with two aggressors (seed 1997, toy inputs, not benchmark results), the ratio of exact peak to metric stayed below 0.2 for rise times of 1/50 of the time constant scale, and reached above 0.95 for rise times 50 times that scale.

Proof: Devgan's metric is an upper bound on the noise of an RC tree driven by aggressors of bounded slopefull

Model. The victim net is a tree with nodes 0,1,…,n−10, 1, \ldots, n-1 and p(k)<kp(k) < k for k≥1k \ge 1. Node 0 is joined to ground by the holding resistance r0>0r_0 > 0 of the quiet driver, and node k≥1k \ge 1 is joined to p(k)p(k) by a wire resistance rk>0r_k > 0. Node kk has a capacitance ck≥0c_k \ge 0 to ground and a coupling capacitance Ck,a≥0C_{k,a} \ge 0 to aggressor aa, with cˉk=ck+∑aCk,a>0\bar c_k = c_k + \sum_a C_{k,a} > 0. Each aggressor is an ideal voltage source ua(t)u_a(t), continuous and piecewise continuously differentiable, constant for t≤0t \le 0, with ∣ua′(t)∣≤sa|u_a'(t)| \le s_a. At t=0t = 0 all victim voltages are 0.

Kirchhoff's current law at node kk gives ckvk′+∑aCk,a(vk′−ua′)+(Gv)k=0c_k v_k' + \sum_a C_{k,a}(v_k' - u_a') + (Gv)_k = 0, that is

Cv′(t)+Gv(t)=Bu′(t),v(0)=0,C v'(t) + G v(t) = B u'(t), \qquad v(0) = 0,

with C=diag⁡(cˉk)C = \operatorname{diag}(\bar c_k), Bk,a=Ck,aB_{k,a} = C_{k,a}, and GG the conductance matrix of the tree: GkkG_{kk} is the sum of the conductances at kk (with 1/r01/r_0 at node 0), and Gkj=−1/rjG_{kj} = -1/r_j or −1/rk-1/r_k when jj and kk are joined by a wire. Write Ik=∑aCk,asaI_k = \sum_a C_{k,a} s_a and RikR_{ik} for the total resistance of the part that the paths from ground to ii and to kk share.

Lemma 1 (the resistance matrix). GG is symmetric positive definite and G−1=(Rik)G^{-1} = (R_{ik}).

Proof. For any xx, xTGx=x02/r0+∑k≥1(xk−xp(k))2/rkx^T G x = x_0^2 / r_0 + \sum_{k \ge 1} (x_k - x_{p(k)})^2 / r_k. This is 0 only if x0=0x_0 = 0 and xk=xp(k)x_k = x_{p(k)} for all kk, so only if x=0x = 0. For the inverse, inject a unit current at node kk with all other injections 0. By current conservation the whole unit flows from kk to ground along the path from kk, and no current flows elsewhere. The voltage at ii is the drop from ii to ground, which is the sum of rjr_j over the edges of the path of ii that carry current, that is RikR_{ik}. So column kk of G−1G^{-1} is (Rik)i(R_{ik})_i. The RC tree page gives the same fact. □\square

Lemma 2 (positivity of the propagator). Let M=C−1GM = C^{-1} G. For every t≥0t \ge 0, all entries of e−Mte^{-Mt} are nonnegative, and e−Mt→0e^{-Mt} \to 0 as t→∞t \to \infty.

Proof. The off-diagonal entries of −M-M are −Gkj/cˉk≥0-G_{kj} / \bar c_k \ge 0. Let μ=max⁡kMkk\mu = \max_k M_{kk} and N=μI−MN = \mu I - M, a matrix with nonnegative entries. Since μI\mu I commutes with NN, e−Mt=e−μteNt=e−μt∑m≥0(Nt)m/m!e^{-Mt} = e^{-\mu t} e^{N t} = e^{-\mu t} \sum_{m \ge 0} (N t)^m / m!, a sum of nonnegative matrices. Next, M=C−1/2SC1/2M = C^{-1/2} S C^{1/2} with S=C−1/2GC−1/2S = C^{-1/2} G C^{-1/2} symmetric positive definite by Lemma 1. So MM has positive real eigenvalues λ1,…,λn\lambda_1, \ldots, \lambda_n and is diagonalizable, and e−Mt=C−1/2Qdiag⁡(e−λmt)QTC1/2→0e^{-Mt} = C^{-1/2} Q \operatorname{diag}(e^{-\lambda_m t}) Q^T C^{1/2} \to 0. □\square

Lemma 3. ∫0∞e−Mσ dσ=M−1\int_0^\infty e^{-M\sigma}\, d\sigma = M^{-1}.

Proof. ddσ(−M−1e−Mσ)=e−Mσ\frac{d}{d\sigma}\left(-M^{-1} e^{-M\sigma}\right) = e^{-M\sigma}, so ∫0Te−Mσdσ=M−1(I−e−MT)\int_0^T e^{-M\sigma} d\sigma = M^{-1}(I - e^{-MT}), which tends to M−1M^{-1} by Lemma 2. □\square

Theorem 1 (the bound). For all t≥0t \ge 0 and every node ii,

∣vi(t)∣  ≤  Vi  =  ∑kRikIk  =  (G−1Bs)i.|v_i(t)| \;\le\; V_i \;=\; \sum_k R_{ik} I_k \;=\; (G^{-1} B s)_i .

If there is one aggressor and 0≤u′(t)≤s0 \le u'(t) \le s, then 0≤vi(t)≤Vi0 \le v_i(t) \le V_i.

Proof. By variation of constants, v(t)=∫0te−M(t−τ)C−1Bu′(τ) dτv(t) = \int_0^t e^{-M(t-\tau)} C^{-1} B u'(\tau)\, d\tau. Take absolute values entry by entry. Since e−M(t−τ)e^{-M(t-\tau)} and C−1BC^{-1} B have nonnegative entries (Lemma 2),

∣v(t)∣≤∫0te−M(t−τ)C−1B ∣u′(τ)∣ dτ≤∫0te−Mσdσ  C−1Bs≤∫0∞e−Mσdσ  C−1Bs.|v(t)| \le \int_0^t e^{-M(t-\tau)} C^{-1} B\, |u'(\tau)|\, d\tau \le \int_0^t e^{-M\sigma} d\sigma\; C^{-1} B s \le \int_0^\infty e^{-M\sigma} d\sigma\; C^{-1} B s .

The last step adds the integral over (t,∞)(t, \infty) of a vector with nonnegative entries. By Lemma 3 the right side is M−1C−1Bs=G−1CC−1Bs=G−1BsM^{-1} C^{-1} B s = G^{-1} C C^{-1} B s = G^{-1} B s, and Lemma 1 gives the form ∑kRikIk\sum_k R_{ik} I_k. With one aggressor and u′≥0u' \ge 0, the integrand of v(t)v(t) has nonnegative entries, so v(t)≥0v(t) \ge 0. □\square

Theorem 2 (the bound is the best one that depends only on the slopes). For one aggressor with u′(t)=su'(t) = s for all t≥0t \ge 0, v(t)=(I−e−Mt)V→Vv(t) = (I - e^{-Mt}) V \to V. For a ramp of rise time trt_r, v(tr)=(I−e−Mtr)Vv(t_r) = (I - e^{-M t_r}) V. For one node (n=1n = 1) the peak is V0(1−e−tr/τ)V_0 (1 - e^{-t_r / \tau}) with τ=r0cˉ0\tau = r_0 \bar c_0.

Proof. With constant u′=su' = s, v(t)=∫0te−Mσdσ C−1Bs=M−1(I−e−Mt)C−1Bs=(I−e−Mt)Vv(t) = \int_0^t e^{-M\sigma} d\sigma\, C^{-1} B s = M^{-1}(I - e^{-Mt}) C^{-1} B s = (I - e^{-Mt}) V, since M−1M^{-1} and e−Mte^{-Mt} commute. Lemma 2 gives the limit. For n=1n = 1, vv rises as V0(1−e−t/τ)V_0(1 - e^{-t/\tau}) until trt_r, and after trt_r the input is constant and vv decays as e−(t−tr)/τe^{-(t - t_r)/\tau}. So the peak is at trt_r. □\square

So no bound that uses only the slope ss can be smaller than VV at any node, since the bound must also hold for longer and longer ramps. For a given finite ramp, the ratio of the true peak to VV is below 1, and it tends to 0 as tr/τ→0t_r / \tau \to 0.

Lemma 4 (the two passes compute VV). After lines L1 to L3, I[k]=Dk=∑j∈T(k)IjI[k] = D_k = \sum_{j \in T(k)} I_j, where T(k)T(k) is the subtree of kk. After lines L4 to L6, V[i]=∑j∈P(i)rjDj=∑kRikIkV[i] = \sum_{j \in P(i)} r_j D_j = \sum_k R_{ik} I_k, where P(i)P(i) is the set of nodes on the path from node 0 to ii, with r0r_0 for the driver.

Proof. L1 sets I[k]=IkI[k] = I_k. Lines L2 and L3 visit k=n−1,…,1k = n-1, \ldots, 1. Every proper descendant of kk has a larger index, so when the loop reaches kk, every child cc of kk has already been visited, and by strong induction on decreasing index I[c]=DcI[c] = D_c when it was added to I[k]I[k]. Nothing is added to I[k]I[k] after the loop visits it, because later indices are smaller and are not children of kk. So I[k]=Ik+∑cDc=DkI[k] = I_k + \sum_{c} D_c = D_k. Lines L4 to L6 visit nodes in increasing order, so V[p(k)]V[p(k)] is final when V[k]V[k] is set, and by induction V[i]=∑j∈P(i)rjDjV[i] = \sum_{j \in P(i)} r_j D_j. Finally, k∈T(j)k \in T(j) if and only if j∈P(k)j \in P(k), so

∑j∈P(i)rjDj=∑j∈P(i)rj∑k:j∈P(k)Ik=∑kIk∑j∈P(i)∩P(k)rj=∑kRikIk.  □\sum_{j \in P(i)} r_j D_j = \sum_{j \in P(i)} r_j \sum_{k : j \in P(k)} I_k = \sum_k I_k \sum_{j \in P(i) \cap P(k)} r_j = \sum_k R_{ik} I_k . \;\square

Theorem 3 (the bound survives backward Euler). Let h>0h > 0, tj=jht_j = j h, v0=0v_0 = 0 and (C+hG)vj+1=Cvj+B(u(tj+1)−u(tj))(C + hG) v_{j+1} = C v_j + B (u(t_{j+1}) - u(t_j)). Then ∣vj∣≤V|v_j| \le V for every jj.

Proof. A=C+hGA = C + hG has positive diagonal entries dkd_k, nonpositive off-diagonal entries, and row kk has dk−∑j≠k∣Akj∣=cˉk+hGkk−h∑j≠k∣Gkj∣≥cˉk>0d_k - \sum_{j \ne k} |A_{kj}| = \bar c_k + h G_{kk} - h \sum_{j \ne k} |G_{kj}| \ge \bar c_k > 0. Write A=D−NA = D - N with DD the diagonal and N≥0N \ge 0. The row sums of D−1ND^{-1} N are below 1, so ∥D−1N∥∞<1\|D^{-1}N\|_\infty < 1 and A−1=∑m≥0(D−1N)mD−1A^{-1} = \sum_{m \ge 0} (D^{-1} N)^m D^{-1} has nonnegative entries. Now ∣ua(tj+1)−ua(tj)∣≤hsa|u_a(t_{j+1}) - u_a(t_j)| \le h s_a. If ∣vj∣≤V|v_j| \le V, then

∣vj+1∣≤A−1(C∣vj∣+hBs)≤A−1(CV+hGV)=A−1AV=V,|v_{j+1}| \le A^{-1} \left( C |v_j| + h B s \right) \le A^{-1}(C V + h G V) = A^{-1} A V = V,

using Bs=GVB s = G V. Induction on jj ends the proof. □\square

Theorem 3 is why the tests can check the bound with no rounding at all: they run backward Euler in exact rational arithmetic and compare each state with VV.

Scope. Theorem 1 uses only that GG is symmetric positive definite with nonpositive off-diagonal entries and that CC is diagonal and positive. So ∣v∣≤G−1Bs|v| \le G^{-1} B s also holds for an RC mesh with grounded capacitors and at least one resistive path to ground. Only the form ∑kRikIk\sum_k R_{ik} I_k and the two linear passes need a tree. The theorem needs ideal aggressor sources, a linear holding resistance for the victim driver and no inductance. It says nothing about a nonlinear driver, about aggressors whose waveform is changed by the victim, or about RLC lines, where the response can overshoot.

Complexity

Line L1 reads each coupling capacitor once, and lines L2 to L6 do constant work per node, so the time is O(n+m)O(n + m) for nn nodes and mm coupling capacitors. The extra space is the two arrays II and VV, O(n)O(n). For a chip, the cost is linear in the size of the extracted parasitic network, which is why the metric can screen every net. An exact transient solve of one net costs a sparse factorization and one solve per time step, and a moment-matching model such as AWE or PRIMA costs a few solves with the full network.

Properties

  • Upper bound, not an estimate. Under the linear model with ideal aggressors, ∣vi(t)∣≤Vi|v_i(t)| \le V_i for all tt, with no condition on alignment of aggressors, their direction or the shape of their waveform, other than the slope bound.
  • Linear in the aggressors. VV is a sum of one term per coupling capacitor, so the metric of several aggressors is the sum of their separate metrics, which is the worst case when they switch at the same time in the worst directions.
  • Insensitive to grounded capacitance. ckc_k does not enter VV. Adding ground capacitance slows the response and lowers the true peak, but not the bound.
  • Monotone in resistance and coupling. VV grows with every rkr_k and every Ck,aC_{k,a}, and grows as 1/tr1 / t_r.
  • Exact for slow aggressors. When trt_r is much longer than the time constants of the victim, the true peak is close to VV.

Variants and improvements

  • RC meshes. The bound ∣v∣≤G−1Bs|v| \le G^{-1} B s holds for any resistive network with grounded capacitors and a path to ground, for example a net with a loop. It then needs one linear solve with GG in place of the two passes.
  • Finite rise time corrections. Many later metrics multiply ViV_i by a factor such as 1−e−tr/Ti1 - e^{-t_r / T_i} with an Elmore time constant TiT_i, or fit two poles to the first moments. These are closer to the true peak for fast edges. They are estimates, and they are no longer proved bounds in general.
  • Pulse width. Noise checks also need the width of the bump, because a gate filters a short pulse. Moment-based metrics estimate the width; the Devgan metric gives only the height.
  • Exact reduced models. PRIMA gives a passive reduced model of the coupled network, and its transient solve gives the waveform with an error that can be controlled, at a much higher cost.
  • Timing windows. In a static timing analysis flow, aggressors that cannot switch together inside the victim's sensitive window are dropped from the sum, which removes much of the pessimism of the worst case alignment.
  • Effect on delay. When the victim also switches, coupling changes its delay. That effect is usually modeled with the Miller coupling factor and is a different question.

When to use it

Use it as the first filter in a chip-level noise check: compute VV for every net from the extracted parasitics, accept the nets whose bound is below the noise margin of their receivers, and send only the others to a more accurate analysis. Use it also inside routing and buffering tools, where a cheap and safe measure guides spacing, shielding and repeater insertion. Do not use it to sign off a net that fails the bound: the failure may be only pessimism, especially for fast aggressors on long couplings.

Pitfalls

  • Fast edges. The bound grows as 1/tr1 / t_r without limit, while the real peak cannot exceed the charge sharing level. With sharp edges the metric can report several times the supply voltage, as in the example at 10 ps.
  • The driver is not a resistor. The holding resistance r0r_0 is a linearization of a transistor. A weak driver or a driver in a state with high output resistance gives much larger noise, and the bound is only as good as r0r_0.
  • Ideal aggressors. The model treats aggressor voltages as given. In reality the victim loads the aggressor, which usually lowers the noise, so this is a safe simplification, but a model that drives the aggressor through its own resistance needs a different analysis.
  • Inductance. For long wide wires the response can overshoot, and an RC bound does not apply.
  • Noise on noise. The metric gives the noise at the victim wire. Whether the noise flips a latch depends on the receiver, the pulse width and the propagation through gates, which this metric does not model.
  • Units. Coupling capacitance times slew rate is a current. Mixing fF with ns and kΩ gives values off by factors of 1000.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

devgan_noise_metric.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/devgan-noise-metric/. The authors are listed in prov/6FQBVC.jsonl.
"""Devgan's coupled noise metric on an RC tree (Devgan, ICCAD 1997).

The victim net is a tree of n nodes. Node 0 is the driver output and the
others satisfy parent[k] < k. r[0] is the holding resistance of the quiet
driver to ground, and r[k] for k > 0 is the wire resistance from parent[k]
to k. coupling[k] is a list of pairs (cc, a): a coupling capacitance cc from
node k to aggressor a. slope[a] is the largest absolute slew rate |du_a/dt|
of aggressor a.

devgan_noise(...) returns V with V[i] = sum over k of R_ik I_k, where R_ik is
the resistance of the common part of the paths from ground to i and to k,
and I_k = sum of cc * slope[a] over the couplings of node k. Under the model
on the page, |v_i(t)| <= V[i] for all t. Two passes, O(n + couplings) time.
"""


def devgan_noise(parent, r, coupling, slope):
    n = len(parent)
    current = [0] * n
    for k in range(n):  # @line L1
        current[k] = sum((cc * slope[a] for cc, a in coupling[k]), 0)
    for k in range(n - 1, 0, -1):  # @line L2
        current[parent[k]] += current[k]  # @line L3
    noise = [0] * n
    noise[0] = r[0] * current[0]  # @line L4
    for k in range(1, n):  # @line L5
        noise[k] = noise[parent[k]] + r[k] * current[k]  # @line L6
    return noise  # @line L7


def ramp_slopes(swing, rise_times):
    """Slew rates of ramp aggressors: swing / rise time for each aggressor."""
    return [swing / t for t in rise_times]
rc_transient.py 164 lines
# SPDX-License-Identifier: MIT
# Shared helper of the pr3 eda pages of https://algorithm.tamnd.com/. The authors are listed in prov/.
"""Reference transient solvers for a victim RC tree with coupling capacitors.

The tree uses the layout of devgan_noise_metric.py: parent[k] < k, r[0] is
the driver resistance to ground, r[k] the wire resistance from parent[k] to
k, cground[k] the grounded capacitance and coupling[k] a list of (cc, a).
Kirchhoff's current law at each node gives the linear system

    C v'(t) + G v(t) = B u'(t),

with G the conductance matrix of the tree, C the diagonal matrix of total
node capacitance (ground plus coupling) and B[k][a] the coupling from node
k to aggressor a. The aggressor voltages u_a(t) are ideal sources.

backward_euler: exact rational arithmetic, any aggressor waveform.
ramp_peaks: the exact solution for piecewise linear ramps, by a symmetric
eigendecomposition, with a sampled and refined peak search in floats.
"""

import math


def matrices(parent, r, cground, coupling, aggressors):
    n = len(parent)
    g = [[0] * n for _ in range(n)]
    g[0][0] += 1 / r[0]  # pass Fractions for exact arithmetic
    for k in range(1, n):
        y = 1 / r[k]
        p = parent[k]
        g[k][k] += y
        g[p][p] += y
        g[k][p] -= y
        g[p][k] -= y
    b = [[0] * aggressors for _ in range(n)]
    cap = list(cground)
    for k in range(n):
        for cc, a in coupling[k]:
            b[k][a] += cc
            cap[k] = cap[k] + cc
    return g, cap, b


def solve(a, y):
    """Gaussian elimination with partial pivoting; exact for Fractions."""
    n = len(a)
    m = [list(a[i]) + [y[i]] for i in range(n)]
    for c in range(n):
        p = max(range(c, n), key=lambda i: abs(m[i][c]))
        m[c], m[p] = m[p], m[c]
        for i in range(c + 1, n):
            f = m[i][c] / m[c][c]
            if f:
                for j in range(c, n + 1):
                    m[i][j] -= f * m[c][j]
    x = [0] * n
    for i in range(n - 1, -1, -1):
        s = m[i][n] - sum(m[i][j] * x[j] for j in range(i + 1, n))
        x[i] = s / m[i][i]
    return x


def backward_euler(g, cap, b, waves, h, steps):
    """Backward Euler states v_0 = 0, v_1, ..., v_steps at times j h.

    waves[a](t) is the aggressor voltage at time t. Each step solves
    (C + h G) v_{j+1} = C v_j + B (u(t_{j+1}) - u(t_j)).
    """
    n = len(g)
    m = [[h * g[i][j] + (cap[i] if i == j else 0) for j in range(n)] for i in range(n)]
    v = [0] * n
    out = [v]
    u = [w(0) for w in waves]
    for j in range(1, steps + 1):
        un = [w(j * h) for w in waves]
        rhs = [cap[i] * v[i] + sum(b[i][a] * (un[a] - u[a]) for a in range(len(waves))) for i in range(n)]
        v = solve(m, rhs)
        out.append(v)
        u = un
    return out


def _jacobi_eigen(s):
    n = len(s)
    a = [row[:] for row in s]
    q = [[1.0 if i == j else 0.0 for j in range(n)] for i in range(n)]
    for _ in range(100):
        off = sum(a[i][j] ** 2 for i in range(n) for j in range(n) if i != j)
        if off < 1e-30:
            break
        for p in range(n):
            for k in range(p + 1, n):
                if abs(a[p][k]) < 1e-300:
                    continue
                theta = (a[k][k] - a[p][p]) / (2 * a[p][k])
                t = math.copysign(1.0, theta) / (abs(theta) + math.sqrt(theta * theta + 1))
                c = 1 / math.sqrt(t * t + 1)
                sn = t * c
                for i in range(n):
                    aip, aik = a[i][p], a[i][k]
                    a[i][p], a[i][k] = c * aip - sn * aik, sn * aip + c * aik
                for i in range(n):
                    api, aki = a[p][i], a[k][i]
                    a[p][i], a[k][i] = c * api - sn * aki, sn * api + c * aki
                for i in range(n):
                    qip, qik = q[i][p], q[i][k]
                    q[i][p], q[i][k] = c * qip - sn * qik, sn * qip + c * qik
    return [a[i][i] for i in range(n)], q


def ramp_peaks(g, cap, b, ramps, samples=400):
    """Peak |v_i(t)| over t >= 0 for ramp aggressors, in floats.

    ramps[a] = (start, rise, swing): u_a goes linearly from 0 to swing over
    [start, start + rise] and is constant outside. The solution is exact on
    each interval where all slopes are constant; the peak is found by
    sampling and a golden-section refinement around the best sample.
    """
    n = len(g)
    g = [[float(x) for x in row] for row in g]
    cap = [float(x) for x in cap]
    b = [[float(x) for x in row] for row in b]
    half = [1 / math.sqrt(c) for c in cap]
    s = [[half[i] * g[i][j] * half[j] for j in range(n)] for i in range(n)]
    lam, q = _jacobi_eigen(s)
    events = sorted({0.0} | {float(t0) for t0, _, _ in ramps} | {float(t0 + tr) for t0, tr, _ in ramps})
    tail = 12 / min(lam)

    def to_z(v):
        return [sum(q[i][m] * v[i] / half[i] for i in range(n)) for m in range(n)]

    def to_v(z):
        return [half[i] * sum(q[i][m] * z[m] for m in range(n)) for i in range(n)]

    pieces = []
    v = [0.0] * n
    for idx, t0 in enumerate(events):
        t1 = events[idx + 1] if idx + 1 < len(events) else t0 + tail
        du = [sw / tr if st <= t0 < st + tr else 0.0 for st, tr, sw in ramps]
        f = [sum(b[i][a] * du[a] for a in range(len(ramps))) for i in range(n)]
        w = solve(g, f)
        zw, zj = to_z(w), to_z(v)
        pieces.append((t0, t1, zw, zj))

        def at(t, t0=t0, zw=zw, zj=zj):
            return to_v([zw[m] + math.exp(-lam[m] * (t - t0)) * (zj[m] - zw[m]) for m in range(n)])

        v = at(t1)
        pieces[-1] = (t0, t1, at)
    peak = [0.0] * n
    for i in range(n):
        for t0, t1, at in pieces:
            grid = [t0 + (t1 - t0) * j / samples for j in range(samples + 1)]
            vals = [abs(at(t)[i]) for t in grid]
            j = max(range(len(vals)), key=vals.__getitem__)
            lo, hi = grid[max(j - 1, 0)], grid[min(j + 1, samples)]
            for _ in range(60):
                m1, m2 = lo + (hi - lo) * 0.382, lo + (hi - lo) * 0.618
                if abs(at(m1)[i]) < abs(at(m2)[i]):
                    lo = m1
                else:
                    hi = m2
            peak[i] = max(peak[i], vals[j], abs(at((lo + hi) / 2)[i]))
    return peak
test_devgan_noise_metric.py 123 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/devgan-noise-metric/. The authors are listed in prov/6FQBVC.jsonl.

import math
import random
from fractions import Fraction as F

from devgan_noise_metric import devgan_noise, ramp_slopes
from rc_transient import backward_euler, matrices, ramp_peaks, solve

# The tree of the page: units kOhm, fF, ps and V, so a current is in mA.
PARENT = [-1, 0, 1, 1]
R = [F(1), F(1, 2), F(1, 2), F(1)]
CG = [F(5), F(10), F(10), F(15)]
COUPLING = [[], [(F(10), 0)], [(F(10), 0)], []]


def random_tree(rng, n, aggressors, exact):
    num = (lambda lo, hi: F(rng.randint(lo, hi), rng.randint(1, 4))) if exact else (lambda lo, hi: rng.uniform(lo, hi))
    parent = [-1] + [rng.randrange(k) for k in range(1, n)]
    r = [num(1, 8) for _ in range(n)]
    cg = [num(1, 20) for _ in range(n)]
    coupling = []
    for _ in range(n):
        coupling.append([(num(1, 20), rng.randrange(aggressors)) for _ in range(rng.randint(0, 2))])
    return parent, r, cg, coupling


def test_worked_example():
    v = devgan_noise(PARENT, R, COUPLING, ramp_slopes(F(1), [F(50)]))
    assert v == [F(2, 5), F(3, 5), F(7, 10), F(3, 5)]
    g, cap, b = matrices(PARENT, [float(x) for x in R], [float(x) for x in CG], [[(float(c), a) for c, a in cp] for cp in COUPLING], 1)
    peak = ramp_peaks(g, cap, b, [(0.0, 50.0, 1.0)])
    assert [round(p, 3) for p in peak] == [0.170, 0.260, 0.318, 0.217]


def test_equals_resistance_matrix_product():
    # V = G^-1 B s, solved exactly, is the matrix form of the two passes.
    rng = random.Random(1)
    for _ in range(300):
        n = rng.randint(1, 7)
        parent, r, cg, coupling = random_tree(rng, n, 2, True)
        slope = [F(rng.randint(1, 9), rng.randint(1, 9)) for _ in range(2)]
        g, cap, b = matrices(parent, r, cg, coupling, 2)
        want = solve(g, [sum(b[i][a] * slope[a] for a in range(2)) for i in range(n)])
        assert devgan_noise(parent, r, coupling, slope) == want


def test_common_path_resistance_form():
    # V_i = sum_k R_ik I_k with R_ik the resistance shared by the root paths of i and k.
    rng = random.Random(2)
    for _ in range(200):
        n = rng.randint(1, 8)
        parent, r, cg, coupling = random_tree(rng, n, 1, True)
        path = []
        for k in range(n):
            p = {k} | (path[parent[k]] if k else set())
            path.append(p)
        cur = [sum(c for c, _ in coupling[k]) for k in range(n)]
        want = [sum(sum(r[j] for j in path[i] & path[k]) * cur[k] for k in range(n)) for i in range(n)]
        assert devgan_noise(parent, r, coupling, [F(1)]) == want


def test_backward_euler_never_exceeds_bound_exactly():
    # In exact arithmetic, every backward Euler state satisfies |v_j| <= V.
    rng = random.Random(3)
    for _ in range(25):
        n = rng.randint(1, 3)
        parent, r, cg, coupling = random_tree(rng, n, 2, True)
        rise = [F(rng.randint(1, 30)), F(rng.randint(1, 30))]
        swing = [F(1), F(-1) if rng.random() < 0.5 else F(1)]
        start = [F(0), F(rng.randint(0, 10))]
        waves = [lambda t, a=a: swing[a] * min(max((t - start[a]) / rise[a], F(0)), F(1)) for a in range(2)]
        bound = devgan_noise(parent, r, coupling, [abs(swing[a]) / rise[a] for a in range(2)])
        g, cap, b = matrices(parent, r, cg, coupling, 2)
        h = F(rng.randint(1, 6), 2)
        for v in backward_euler(g, cap, b, waves, h, 24):
            assert all(abs(v[i]) <= bound[i] for i in range(n))


def test_backward_euler_single_rising_aggressor_is_nonnegative():
    rng = random.Random(4)
    for _ in range(20):
        n = rng.randint(1, 3)
        parent, r, cg, coupling = random_tree(rng, n, 1, True)
        rise = F(rng.randint(1, 20))
        bound = devgan_noise(parent, r, coupling, [1 / rise])
        g, cap, b = matrices(parent, r, cg, coupling, 1)
        for v in backward_euler(g, cap, b, [lambda t: min(t / rise, F(1))], F(1), 24):
            assert all(0 <= v[i] <= bound[i] for i in range(n))


def test_one_node_closed_form():
    # One node: peak = s R Cc (1 - exp(-tr / tau)), tau = R (Cg + Cc).
    for rr, cg, cc, tr in [(1.0, 10.0, 10.0, 5.0), (2.0, 3.0, 7.0, 40.0), (0.5, 20.0, 1.0, 300.0)]:
        g, cap, b = matrices([-1], [rr], [cg], [[(cc, 0)]], 1)
        peak = ramp_peaks(g, cap, b, [(0.0, tr, 1.0)])[0]
        metric = devgan_noise([-1], [rr], [[(cc, 0)]], [1.0 / tr])[0]
        tau = rr * (cg + cc)
        assert math.isclose(peak, metric * (1 - math.exp(-tr / tau)), rel_tol=1e-9)
        assert peak <= cc / (cg + cc)  # the charge sharing limit of a step


def test_exact_solution_bound_and_tightness():
    # Exact solution of the linear ODE on random trees: the bound holds,
    # it is loose for fast ramps and tight for slow ones.
    rng = random.Random(1997)
    ratios = {"fast": [], "slow": []}
    for _ in range(80):
        n = rng.randint(1, 5)
        parent, r, cg, coupling = random_tree(rng, n, 2, False)
        g, cap, b = matrices(parent, r, cg, coupling, 2)
        tau = sum(r) * sum(cap)  # at least the slowest time constant
        for kind, tr in (("fast", tau / 50), ("slow", 50 * tau)):
            ramps = [(0.0, tr, 1.0), (rng.uniform(0, tr), tr, -1.0)]
            bound = devgan_noise(parent, r, coupling, [1 / tr, 1 / tr])
            peak = ramp_peaks(g, cap, b, ramps, samples=60)
            for p, v in zip(peak, bound):
                assert p <= v * (1 + 1e-9) + 1e-15
                if v > 0:
                    ratios[kind].append(p / v)
    assert max(ratios["fast"]) < 0.2
    assert max(ratios["slow"]) > 0.95

History

Before the metric, designers bounded coupling noise by the charge sharing ratio Cc/(Cc+Cg)C_c / (C_c + C_g), which ignores the driver that holds the victim, or by closed forms for one pair of uniform lines such as those of Sakurai (1993). Shepard and Narayanan (1996) described the static noise analysis of whole chips, which needs a fast and safe measure for each net. Devgan (1997) gave the metric for RC trees, explained it as the steady state of an infinitely long ramp, and noted that it is an upper bound for RC circuits that is pessimistic for fast aggressors. The metric became a standard screen in noise analysis tools, and later work refined it with time constants and pulse widths.

References

  1. Anirudh Devgan, Efficient coupled noise estimation for on-chip interconnects, Proceedings of the IEEE/ACM International Conference on Computer-Aided Design (ICCAD), 147 to 151, 1997, the metric for RC trees and its claim to be an upper bound for RC circuits (DBLP gives pages 147 to 151, and some citations give 147 to 153; the section numbers were not checked)
  2. Kenneth L. Shepard and Vinod Narayanan, Noise in deep submicron digital design, Proceedings of the IEEE/ACM International Conference on Computer-Aided Design (ICCAD), 524 to 531, 1996, the static noise analysis setting in which a fast noise bound per net is used
  3. Takayasu Sakurai, Closed-form expressions for interconnection delay, coupling, and crosstalk in VLSIs, IEEE Transactions on Electron Devices 40(1), 118 to 124, January 1993, the closed-form crosstalk height of two coupled distributed RC lines, an earlier estimate for one pair of lines

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example