From 9c6fe3f8e4177b38c68248cbf12f9e2a5c805602 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sat, 18 Feb 2023 18:54:54 +0100 Subject: [PATCH] Definitely exclude A devices from power probing (and others with less than 2 pins). --- src/frontend/inpc_probe.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/frontend/inpc_probe.c b/src/frontend/inpc_probe.c index 112b1208d..8a7a79f47 100644 --- a/src/frontend/inpc_probe.c +++ b/src/frontend/inpc_probe.c @@ -874,6 +874,12 @@ void inp_probe(struct card* deck) else numnodes = get_number_terminals(thisline); + if (numnodes < 2) { + fprintf(stderr, "Warning: Power mesasurement not available,\n .probe %s will be ignored\n", wltmp->wl_word); + tfree(instname); + continue; + } + int err = 0; /* call fcn with power requested */ err = setallvsources(tmpcard, instances, instname, numnodes, haveall, TRUE); @@ -1266,7 +1272,7 @@ void modprobenames(INPtables* tab) { If .probe p(Q1) is found, flag power is true, then do additional power calculations: Define a reference voltage of an n-terminal device as Vref = (V(1) + V(2) +...+ V(n)) / n with terminal (node) voltages V(n). Calculate power PQ1 = (v(1) - Vref) * i1 + (V(2) - Vref) * i2 + ... + (V(n) - Vref) * in) with terminal currents in. - See "Quantities of a Multiterminal Circuit Determined on the Basis of Kirchhoff’s Laws", M. Depenbrock, + See "Quantities of a Multiterminal Circuit Determined on the Basis of Kirchhoff�s Laws", M. Depenbrock, ETEP Vol. 8, No. 4, July/August 1998. probe_int_ is used to trigger supressing the vectors when saving the results. Internal vectors thus are not saved. */