From cfba8a5cd3dbfed6ead54675f62ac3501fda7823 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 20 Sep 2022 22:50:17 +0200 Subject: [PATCH] Note: ix: dc value used for op instead of transient time=0 value Former warning message or note only issued when dc value and value at transient time=0 differ. --- src/spicelib/devices/isrc/isrctemp.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/spicelib/devices/isrc/isrctemp.c b/src/spicelib/devices/isrc/isrctemp.c index 77e5a8145..207ed69a8 100644 --- a/src/spicelib/devices/isrc/isrctemp.c +++ b/src/spicelib/devices/isrc/isrctemp.c @@ -41,10 +41,21 @@ ISRCtemp(GENmodel *inModel, CKTcircuit *ckt) "%s: has no value, DC 0 assumed", here->ISRCname); } - else if (here->ISRCdcGiven && here->ISRCfuncTGiven) { - SPfrontEnd->IFerrorf(ERR_INFO, - "%s: dc value used for op instead of transient time 0 value.", - here->ISRCname); + else if (here->ISRCdcGiven && here->ISRCfuncTGiven + && here->ISRCfunctionType != TRNOISE && here->ISRCfunctionType != TRRANDOM) { + /* DC value and transient time 0 values given */ + double time0value; + /* determine transient time 0 value */ + if (here->ISRCfunctionType == AM || here->ISRCfunctionType == PWL) + time0value = here->ISRCcoeffs[1]; + else + time0value = here->ISRCcoeffs[0]; + /* No warning issued if DC value and transient time 0 value are the same */ + if (!AlmostEqualUlps(time0value, here->ISRCdcValue, 3)) { + SPfrontEnd->IFerrorf(ERR_INFO, + "%s: dc value used for op instead of transient time=0 value.", + here->ISRCname); + } } if(!here->ISRCmGiven) here->ISRCmValue = 1;