Add variable deltacheck to measure the CKTdelta[0]

(most recent accepted delta time) versus simulation time.
Activated if 'set ngdebug' is given (not forget to set
'.save deltacheck' if other .save commands are given).
This commit is contained in:
Holger Vogt
2026-02-03 14:07:02 +01:00
parent aa1242ac70
commit 4594d5fd91
+15
View File
@@ -280,6 +280,12 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
saves[i].used = 1;
break;
}
else if (ft_ngdebug && refName && eq(refName, "time") && eq(saves[i].name, "deltacheck")) {
addDataDesc(run, "deltacheck", IF_REAL, j, initmem);
savesused[i] = TRUE;
saves[i].used = 1;
break;
}
}
}
}
@@ -307,6 +313,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
/* generate a vector of real time information */
if (ft_ngdebug && refName && eq(refName, "time")) {
addDataDesc(run, "speedcheck", IF_REAL, numNames, initmem);
addDataDesc(run, "deltacheck", IF_REAL, numNames, initmem);
}
}
@@ -582,6 +589,9 @@ OUTpD_memory(runDesc *run, IFvalue *refValue, IFvalue *valuePtr)
double tt = ((double)cl - (double)startclock) / CLOCKS_PER_SEC;
plotAddRealValue(d, tt);
}
else if (ft_ngdebug && d->type == IF_REAL && eq(d->name, "deltacheck")) {
plotAddRealValue(d, ft_curckt->ci_ckt->CKTdeltaOld[0]);
}
else if (d->type == IF_REAL)
plotAddRealValue(d, valuePtr->v.vec.rVec[d->outIndex]);
else if (d->type == IF_COMPLEX)
@@ -693,6 +703,9 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
double tt = ((double)cl - (double)startclock) / CLOCKS_PER_SEC;
fileAddRealValue(run->fp, run->binary, tt);
}
else if (ft_ngdebug && run->data[i].type == IF_REAL && eq(run->data[i].name, "deltacheck")) {
fileAddRealValue(run->fp, run->binary, ft_curckt->ci_ckt->CKTdeltaOld[0]);
}
else if (run->data[i].type == IF_REAL)
fileAddRealValue(run->fp, run->binary,
valuePtr->v.vec.rVec [run->data[i].outIndex]);
@@ -970,6 +983,8 @@ guess_type(const char *name, char* pltypename)
type = SV_TIME;
else if ( cieq(name, "speedcheck"))
type = SV_TIME;
else if ( cieq(name, "deltacheck"))
type = SV_TIME;
else if (cieq(name, "frequency"))
type = SV_FREQUENCY;
else if (ciprefix("inoise", name))