Browse Source

Improve error messages.

pre-master-46
Holger Vogt 5 months ago
parent
commit
1390e577fa
  1. 2
      src/main.c
  2. 11
      src/spicelib/analysis/dctran.c

2
src/main.c

@ -1397,7 +1397,7 @@ int main(int argc, char **argv)
tpf = smktemp("sp"); tpf = smktemp("sp");
tempfile = fopen(tpf, "w+bTD"); tempfile = fopen(tpf, "w+bTD");
if (tempfile == NULL) { if (tempfile == NULL) {
fprintf(stderr, "Could not open a temporary file "
fprintf(stderr, "Error: Could not open a temporary file "
"to save and use optional arguments.\n"); "to save and use optional arguments.\n");
sp_shutdown(EXIT_BAD); sp_shutdown(EXIT_BAD);
} }

11
src/spicelib/analysis/dctran.c

@ -131,6 +131,7 @@ DCtran(CKTcircuit *ckt,
int redostep; int redostep;
#endif #endif
if(restart || ckt->CKTtime == 0) { if(restart || ckt->CKTtime == 0) {
/* set the first step time */
delta=MIN(ckt->CKTfinalTime/100,ckt->CKTstep)/10; delta=MIN(ckt->CKTfinalTime/100,ckt->CKTstep)/10;
#ifdef STEPDEBUG #ifdef STEPDEBUG
@ -251,10 +252,10 @@ DCtran(CKTcircuit *ckt,
ckt->CKTdcMaxIter); ckt->CKTdcMaxIter);
if(converged != 0) { if(converged != 0) {
fprintf(stdout,"\nTransient solution failed -\n");
fprintf(stderr,"\nError: Finding the operating point for transient simulation failed \n");
CKTncDump(ckt); CKTncDump(ckt);
fprintf(stdout,"\n");
fflush(stdout);
fprintf(stderr,"\n");
fflush(stderr);
} else if (ckt->CKTmode & MODEUIC && !ft_ngdebug) { } else if (ckt->CKTmode & MODEUIC && !ft_ngdebug) {
fprintf(stdout,"Operating point simulation skipped by 'uic',\n"); fprintf(stdout,"Operating point simulation skipped by 'uic',\n");
fprintf(stdout," now using transient initial conditions.\n"); fprintf(stdout," now using transient initial conditions.\n");
@ -273,6 +274,7 @@ DCtran(CKTcircuit *ckt,
fflush(stdout); fflush(stdout);
} }
/* return upon failure to converge during op */
if (converged != 0) { if (converged != 0) {
SPfrontEnd->OUTendPlot(job->TRANplot); SPfrontEnd->OUTendPlot(job->TRANplot);
return(converged); return(converged);
@ -311,7 +313,7 @@ DCtran(CKTcircuit *ckt,
for(i=0;i<7;i++) { for(i=0;i<7;i++) {
ckt->CKTdeltaOld[i]=ckt->CKTmaxStep; ckt->CKTdeltaOld[i]=ckt->CKTmaxStep;
} }
ckt->CKTdelta = delta;
ckt->CKTdelta = delta; /* delta set in line 135 */
#ifdef STEPDEBUG #ifdef STEPDEBUG
(void)printf("delta initialized to %g\n",ckt->CKTdelta); (void)printf("delta initialized to %g\n",ckt->CKTdelta);
#endif #endif
@ -983,6 +985,7 @@ resume:
SPfrontEnd->OUTendPlot(job->TRANplot); SPfrontEnd->OUTendPlot(job->TRANplot);
job->TRANplot = NULL; job->TRANplot = NULL;
UPDATE_STATS(0); UPDATE_STATS(0);
/* return upon convergence failure */
return(E_TIMESTEP); return(E_TIMESTEP);
} }
} }

Loading…
Cancel
Save