diff --git a/ChangeLog b/ChangeLog index 88c9780db..88c2e7e14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2005-09-04 Paolo Nenzi + + * src/spicelib/devices/ltra/{ltraload.c, ltraacld.c, ltratrun.c}: + Applied Hitoshi's patches to fix ltra code. The bug produced a + "Timestep too small" in simulations and uninitialized variables + produced wrong results in some files under MinGW. + + * src/spicelib/parser/inp2d.c: + Fixed a bug that causes an "unknown parameter(save)" error if there + is the expression like the following in the netlist of Cider analysis. + + D1 1 2 M_PN AREA=100 save + (Fix from Hitoshi Tanaka). + + * src/frontend/streams.c: + Fix to a bug that caused crush when I input "listing" command after + loading Cider examples under Ngspice compiled by Visual C++. + (Fix from Hitoshi Tanaka). + + + 2005-08-30 Paolo Nenzi ============================ Rework-17 ================================== diff --git a/src/frontend/streams.c b/src/frontend/streams.c index e91fbd8c4..90e5881ef 100644 --- a/src/frontend/streams.c +++ b/src/frontend/streams.c @@ -18,9 +18,9 @@ char cp_gt = '>'; char cp_lt = '<'; char cp_amp = '&'; -FILE *cp_in; -FILE *cp_out; -FILE *cp_err; +FILE *cp_in = NULL; +FILE *cp_out = NULL; +FILE *cp_err = NULL; /* These are the fps that cp_ioreset resets the cp_* to. They are * changed by the source routines. */ diff --git a/src/spicelib/devices/ltra/ltraacld.c b/src/spicelib/devices/ltra/ltraacld.c index 27465de1d..e6aa75bae 100644 --- a/src/spicelib/devices/ltra/ltraacld.c +++ b/src/spicelib/devices/ltra/ltraacld.c @@ -51,7 +51,8 @@ LTRAacLoad(GENmodel *inModel, CKTcircuit *ckt) y0_r = model->LTRAadmit; y0_i = 0.0; - lambda_i = model->LTRAtd * ckt->CKTomega; + /*lambda_i = model->LTRAtd*ckt->CKTomega;*/ + lambda_i = sqrt(model->LTRAinduct*model->LTRAcapac) * ckt->CKTomega; /*CDHW*/ lambda_r = 0.0; break; diff --git a/src/spicelib/devices/ltra/ltraload.c b/src/spicelib/devices/ltra/ltraload.c index 3643490ff..155e3b784 100644 --- a/src/spicelib/devices/ltra/ltraload.c +++ b/src/spicelib/devices/ltra/ltraload.c @@ -19,11 +19,11 @@ LTRAload(GENmodel *inModel, CKTcircuit *ckt) { LTRAmodel *model = (LTRAmodel *) inModel; LTRAinstance *here; - double t1, t2, t3; - double qf1, qf2, qf3; + double t1=0.0, t2=0.0, t3=0.0; + double qf1=0.0, qf2=0.0, qf3=0.0; double lf2, lf3; double v1d = 0.0, v2d = 0.0, i1d = 0.0, i2d = 0.0; - double dummy1, dummy2; + double dummy1=0.0, dummy2=0.0; int isaved = 0; unsigned tdover = 0; int i; @@ -144,13 +144,16 @@ LTRAload(GENmodel *inModel, CKTcircuit *ckt) if (i == ckt->CKTtimeIndex) i--; -#ifdef LTRADEBUG +/*#ifdef LTRADEBUG*/ if ((i == -1)) { +#ifdef LTRADEBUG printf("LTRAload: mistake: cannot find delayed timepoint\n"); - } + return E_INTERN; + /*}*/ #else return E_INTERN; #endif + } isaved = i; diff --git a/src/spicelib/devices/ltra/ltratrun.c b/src/spicelib/devices/ltra/ltratrun.c index 627208bd1..dc455a04d 100644 --- a/src/spicelib/devices/ltra/ltratrun.c +++ b/src/spicelib/devices/ltra/ltratrun.c @@ -19,7 +19,7 @@ LTRAtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) double i5, i6, d1, d2, d3, d4; double tmp; double tolerance; - double current_lte; + double current_lte=0.0; int maxiter = 2, iterations = 0; double x, y, change, deriv, deriv_delta;