From 2a2a488f7d04c9235604dc297642cd1b70ccc50a Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 19 Jan 2021 18:51:23 +0100 Subject: [PATCH] If 'set ngdebug', and if transient simulation, create a vector speedcheck in the tran plot which contains the real time versus simulated time, to check for obstacles during the course of the transient simulation. If command 'save' is given, one has to add speedcheck to obtain this vector. --- src/frontend/outitf.c | 22 +++++++++++++++++++++- src/winmain.c | 7 ------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/frontend/outitf.c b/src/frontend/outitf.c index 5e9e2f7a5..93eaa6ce5 100644 --- a/src/frontend/outitf.c +++ b/src/frontend/outitf.c @@ -255,6 +255,13 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam saves[i].used = 1; break; } + /* generate a vector of real time information */ + else if (ft_ngdebug && eq(refName, "time") && eq(saves[i].name, "speedcheck")) { + addDataDesc(run, "speedcheck", IF_REAL, j, initmem); + savesused[i] = TRUE; + saves[i].used = 1; + break; + } } else { for (i = 0; i < numNames; i++) if (!refName || !name_eq(dataNames[i], refName)) @@ -268,6 +275,10 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam { addDataDesc(run, dataNames[i], dataType, i, initmem); } + /* generate a vector of real time information */ + if (ft_ngdebug && eq(refName, "time")) { + addDataDesc(run, "speedcheck", IF_REAL, numNames, initmem); + } } /* Pass 1 and a bit. @@ -422,6 +433,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam sh_vecinit(run); #endif + lastclock = clock(); return (OK); } @@ -532,7 +544,13 @@ OUTpD_memory(runDesc *run, IFvalue *refValue, IFvalue *valuePtr) else if (d->type == IF_COMPLEX) plotAddComplexValue(d, refValue->cValue); } else if (d->regular) { - if (d->type == IF_REAL) + if (ft_ngdebug && d->type == IF_REAL && eq(d->name, "speedcheck")) { + /* current time */ + clock_t cl = clock(); + double tt = ((double)cl - (double)lastclock) / CLOCKS_PER_SEC; + plotAddRealValue(d, tt); + } + else if (d->type == IF_REAL) plotAddRealValue(d, valuePtr->v.vec.rVec[d->outIndex]); else if (d->type == IF_COMPLEX) plotAddComplexValue(d, valuePtr->v.vec.cVec[d->outIndex]); @@ -905,6 +923,8 @@ guess_type(const char *name) type = SV_CURRENT; else if (cieq(name, "time")) type = SV_TIME; + else if ( cieq(name, "speedcheck")) + type = SV_TIME; else if (cieq(name, "frequency")) type = SV_FREQUENCY; else if (ciprefix("inoise", name)) diff --git a/src/winmain.c b/src/winmain.c index a70faa593..e9d49fdab 100644 --- a/src/winmain.c +++ b/src/winmain.c @@ -229,13 +229,6 @@ SetAnalyse(char *Analyse, /* in: analysis type */ ftime(&timenow); timediff(&timenow, &timebefore, &diffsec, &diffmillisec); - /* info every one percent of progress: - actual time, progress, - to catch linearity of progress of simulation */ - if (ft_ngdebug && !strcmp(Analyse, "tran")) - if ((int)((double)DecaPercent/10.) > (int)((double)OldPercent/10.)) - win_x_printf("%3.1f%% percent progress after %4.2f seconds.\n", (double)DecaPercent/10., seconds()); - OldPercent = DecaPercent; /* output only into hwAnalyse window and if time elapsed is larger than DELTATIME given value, or if analysis has changed, else return */