From e0998d590caaec71fe103391cf8dc422ddccf412 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Mon, 13 Dec 2021 13:27:58 -0700 Subject: [PATCH] DmpPi::evalDmpEqns nan proofing Signed-off-by: James Cherry --- dcalc/DmpCeff.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dcalc/DmpCeff.cc b/dcalc/DmpCeff.cc index a4bdee88..574697a8 100644 --- a/dcalc/DmpCeff.cc +++ b/dcalc/DmpCeff.cc @@ -960,6 +960,9 @@ DmpPi::evalDmpEqns() double t_vth, t_vl, slew; gateDelays(ceff, t_vth, t_vl, slew); + if (slew == 0.0) + throw DmpError("eqn eval failed: slew = 0"); + double ceff_time = slew / (vh_ - vl_); if (ceff_time > 1.4 * dt) ceff_time = 1.4 * dt;