diff --git a/ChangeLog b/ChangeLog index bcc58e94b..3f6c80ad5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2207-10-8 Paolo Nenzi +2007-10-8 Paolo Nenzi + * src/frontend/plotting/plotit.c, src/frontend/{nutimp.c, parse.c}, + src/maths/ni/{niconv.c, niiter.c}, src/spicelib/analysis/dctran.c: + Applied patch from Phil barker, iproved error/warning reporting. + +2007-10-8 Paolo Nenzi * src/frontend/numparam/{general.h, mystring.c, numpaif.h, numparam.h, nupatest.c, spicenum.c, washprog.c, xpressn.c}: Applied patch from Phil Barker that improves the capabilites of numparam library. Now numparam diff --git a/src/frontend/nutinp.c b/src/frontend/nutinp.c index 3aafb7601..52fa573a1 100644 --- a/src/frontend/nutinp.c +++ b/src/frontend/nutinp.c @@ -162,6 +162,7 @@ inp_nutsource(FILE *fp, bool comfile, char *filename) if (deck->li_next) { /* There is something left after the controls. */ fprintf(cp_out, "\nCircuit: %s\n\n", tt); + fprintf(stderr, "\nCircuit: %s\n\n", tt); /* Now expand subcircuit macros. Note that we have to * fix the case before we do this but after we diff --git a/src/frontend/parse.c b/src/frontend/parse.c index 6a7e16a7a..b8f31add7 100644 --- a/src/frontend/parse.c +++ b/src/frontend/parse.c @@ -95,7 +95,7 @@ checkvalid(struct pnode *pn) pn->pn_value->v_name); else fprintf(cp_err, - "Error: %s: no such vector.\n", + "Error(parse.c--checkvalid): %s: no such vector.\n", pn->pn_value->v_name); return (FALSE); } diff --git a/src/frontend/plotting/plotit.c b/src/frontend/plotting/plotit.c index b37b7d7ba..a10445557 100644 --- a/src/frontend/plotting/plotit.c +++ b/src/frontend/plotting/plotit.c @@ -591,7 +591,7 @@ plotit(wordlist *wl, char *hcopy, char *devname) /* Now check for 0-length vectors. */ for (d = vecs; d; d = d->v_link2) if (!d->v_length) { - fprintf(cp_err, "Error: %s: no such vector\n", + fprintf(cp_err, "Error(plotit.c--plotit): %s: no such vector\n", d->v_name); goto quit; } diff --git a/src/maths/ni/niconv.c b/src/maths/ni/niconv.c index 6fac8b5b6..ad77491f8 100644 --- a/src/maths/ni/niconv.c +++ b/src/maths/ni/niconv.c @@ -28,6 +28,13 @@ NIconvTest(CKTcircuit *ckt) node = ckt->CKTnodes; size = SMPmatSize(ckt->CKTmatrix); +#ifdef STEPDEBUG + for (i=1;i<=size;i++) { + new = *((ckt->CKTrhs) + i ) ; + old = *((ckt->CKTrhsOld) + i ) ; + printf("chk for convergence: %s new: %g old: %g\n",CKTnodName(ckt,i),new,old); + } +#endif /* STEPDEBUG */ for (i=1;i<=size;i++) { node = node->next; new = *((ckt->CKTrhs) + i ) ; @@ -37,7 +44,8 @@ NIconvTest(CKTcircuit *ckt) ckt->CKTvoltTol; if (fabs(new-old) >tol ) { #ifdef STEPDEBUG - printf(" non-convergence at node %s\n",CKTnodName(ckt,i)); + printf(" non-convergence at node (type=3) %s (fabs(new-old)>tol --> fabs(%g-%g)>%g)\n",CKTnodName(ckt,i),new,old,tol); + printf(" reltol: %g voltTol: %g (tol=reltol*(MAX(fabs(old),fabs(new))) + voltTol)\n",ckt->CKTreltol,ckt->CKTvoltTol); #endif /* STEPDEBUG */ ckt->CKTtroubleNode = i; ckt->CKTtroubleElt = NULL; @@ -48,7 +56,8 @@ NIconvTest(CKTcircuit *ckt) ckt->CKTabstol; if (fabs(new-old) >tol ) { #ifdef STEPDEBUG - printf(" non-convergence at node %s\n",CKTnodName(ckt,i)); + printf(" non-convergence at node (type=%d) %s (fabs(new-old)>tol --> fabs(%g-%g)>%g)\n",node->type,CKTnodName(ckt,i),new,old,tol); + printf(" reltol: %g abstol: %g (tol=reltol*(MAX(fabs(old),fabs(new))) + abstol)\n",ckt->CKTreltol,ckt->CKTabstol); #endif /* STEPDEBUG */ ckt->CKTtroubleNode = i; ckt->CKTtroubleElt = NULL; diff --git a/src/maths/ni/niiter.c b/src/maths/ni/niiter.c index 9a6978678..1af30c480 100644 --- a/src/maths/ni/niiter.c +++ b/src/maths/ni/niiter.c @@ -184,9 +184,9 @@ NIiter(CKTcircuit *ckt, int maxIter) *ckt->CKTrhsSpare = 0; *ckt->CKTrhsOld = 0; - if(iterno > maxIter) { - /*printf("too many iterations without convergence: %d iter's\n", - iterno);*/ + if(iterno > maxIter) { + /*fprintf(stderr,"too many iterations without convergence: %d iter's (max iter == %d)\n", + iterno,maxIter);*/ ckt->CKTstat->STATnumIter += iterno; errMsg = MALLOC(strlen(msg)+1); strcpy(errMsg,msg); diff --git a/src/spicelib/analysis/dctran.c b/src/spicelib/analysis/dctran.c index 520adc033..fd1c97394 100644 --- a/src/spicelib/analysis/dctran.c +++ b/src/spicelib/analysis/dctran.c @@ -87,6 +87,9 @@ DCtran(CKTcircuit *ckt, if(restart || ckt->CKTtime == 0) { delta=MIN(ckt->CKTfinalTime/200,ckt->CKTstep)/10; +#ifdef STEPDEBUG + printf("delta = %g finalTime/200: %g CKTstep: %g\n",delta,ckt->CKTfinalTime/200,ckt->CKTstep); +#endif /* begin LTRA code addition */ if (ckt->CKTtimePoints != NULL) FREE(ckt->CKTtimePoints); @@ -371,7 +374,7 @@ nextTime: */ #ifdef STEPDEBUG - printf("Delta %g accepted at time %g\n",ckt->CKTdelta,ckt->CKTtime); + printf("Delta %g accepted at time %g (finaltime: %g)\n",ckt->CKTdelta,ckt->CKTtime,ckt->CKTfinalTime); fflush(stdout); #endif /* STEPDEBUG */ ckt->CKTstat->STATaccepted ++; @@ -508,7 +511,7 @@ resume: if(ckt->CKTfinalTime/50CKTmaxStep) { (void)printf("limited by Tstop/50\n"); } else { - (void)printf("limited by Tmax\n"); + (void)printf("limited by Tmax == %g\n",ckt->CKTmaxStep); } } #endif @@ -538,7 +541,8 @@ resume: if( (ckt->CKTdelta >.1* ckt->CKTsaveDelta) || (ckt->CKTdelta > .1*(*(ckt->CKTbreaks+1)-*(ckt->CKTbreaks))) ) { if(ckt->CKTsaveDelta < (*(ckt->CKTbreaks+1)-*(ckt->CKTbreaks))) { - (void)printf("limited by pre-breakpoint delta\n"); + (void)printf("limited by pre-breakpoint delta (saveDelta: %g, nxt_breakpt: %g, curr_breakpt: %g\n", + ckt->CKTsaveDelta, *(ckt->CKTbreaks+1), *(ckt->CKTbreaks)); } else { (void)printf("limited by next breakpoint\n"); } @@ -776,6 +780,7 @@ resume: ckt->CKTtime -= ckt->CKTdelta; ckt->CKTdelta = g_mif_info.breakpoint.current - ckt->CKTtime; g_mif_info.breakpoint.last = ckt->CKTtime + ckt->CKTdelta; + if(firsttime) { ckt->CKTmode = (ckt->CKTmode&MODEUIC)|MODETRAN | MODEINITTRAN; } @@ -869,8 +874,8 @@ resume: #ifdef STEPDEBUG (void)printf( - "delta set to truncation error result: %g. Point accepted\n", - ckt->CKTdelta); + "delta set to truncation error result: %g. Point accepted at CKTtime: %g\n", + ckt->CKTdelta,ckt->CKTtime); fflush(stdout); #endif #ifdef WANT_SENSE2