Don't check continuously for autostop, only when option flag is set
This speeds up simulations with simple device evaluation, but many time stepps.
This commit is contained in:
parent
d6418117b6
commit
ad23146544
|
|
@ -532,7 +532,7 @@ check_autostop(char* what)
|
||||||
{
|
{
|
||||||
bool flag = FALSE;
|
bool flag = FALSE;
|
||||||
|
|
||||||
if (cp_getvar("autostop", CP_BOOL, NULL, 0))
|
// if (cp_getvar("autostop", CP_BOOL, NULL, 0))
|
||||||
flag = do_measure(what, TRUE);
|
flag = do_measure(what, TRUE);
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,8 @@ DCtran(CKTcircuit *ckt,
|
||||||
int numNames;
|
int numNames;
|
||||||
double maxstepsize = 0.0;
|
double maxstepsize = 0.0;
|
||||||
|
|
||||||
|
bool have_autostop = FALSE, flag_autostop = FALSE;
|
||||||
|
|
||||||
int ltra_num;
|
int ltra_num;
|
||||||
CKTnode *node;
|
CKTnode *node;
|
||||||
#ifdef XSPICE
|
#ifdef XSPICE
|
||||||
|
|
@ -184,6 +186,8 @@ DCtran(CKTcircuit *ckt,
|
||||||
save_mode = (ckt->CKTmode&MODEUIC) | MODETRANOP | MODEINITJCT;
|
save_mode = (ckt->CKTmode&MODEUIC) | MODETRANOP | MODEINITJCT;
|
||||||
save_order = ckt->CKTorder;
|
save_order = ckt->CKTorder;
|
||||||
|
|
||||||
|
have_autostop = cp_getvar("autostop", CP_BOOL, NULL, 0);
|
||||||
|
|
||||||
/* Add breakpoints here which have been requested by the user setting the
|
/* Add breakpoints here which have been requested by the user setting the
|
||||||
stop command as 'stop when time = xx'.
|
stop command as 'stop when time = xx'.
|
||||||
Get data from the global dbs data base.
|
Get data from the global dbs data base.
|
||||||
|
|
@ -466,8 +470,14 @@ DCtran(CKTcircuit *ckt,
|
||||||
/* gtri - end - wbk - Update event queues/data for accepted timepoint */
|
/* gtri - end - wbk - Update event queues/data for accepted timepoint */
|
||||||
#endif
|
#endif
|
||||||
ckt->CKTstat->STAToldIter = ckt->CKTstat->STATnumIter;
|
ckt->CKTstat->STAToldIter = ckt->CKTstat->STATnumIter;
|
||||||
if (check_autostop("tran") ||
|
/* check for the end of the tran simulation, either by< stop time given,
|
||||||
ckt->CKTfinalTime - ckt->CKTtime < ckt->CKTminBreak) {
|
or final time has been reached. */
|
||||||
|
if (have_autostop)
|
||||||
|
/* time consuming autostop check only, when variable 'autostop' has been set
|
||||||
|
before tran is started.*/
|
||||||
|
flag_autostop = check_autostop("tran");
|
||||||
|
/* If CKTtime and CKTfinalTime are almost equal, then finish */
|
||||||
|
if (flag_autostop || AlmostEqualUlps(ckt->CKTtime, ckt->CKTfinalTime, 100)) {
|
||||||
#ifdef STEPDEBUG
|
#ifdef STEPDEBUG
|
||||||
printf(" done: time is %g, final time is %g, and tol is %g\n",
|
printf(" done: time is %g, final time is %g, and tol is %g\n",
|
||||||
ckt->CKTtime, ckt->CKTfinalTime, ckt->CKTminBreak);
|
ckt->CKTtime, ckt->CKTfinalTime, ckt->CKTminBreak);
|
||||||
|
|
@ -480,6 +490,10 @@ DCtran(CKTcircuit *ckt,
|
||||||
ckt->CKTsenInfo->SENmode = save;
|
ckt->CKTsenInfo->SENmode = save;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (flag_autostop)
|
||||||
|
fprintf(stdout, "\nNote: Autostop after %e s, all measurement conditions are fulfilled\n", ckt->CKTtime);
|
||||||
|
|
||||||
|
/* Final return from tran*/
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
if(SPfrontEnd->IFpauseTest()) {
|
if(SPfrontEnd->IFpauseTest()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue