From 99c1f901e3a83c5e622b604c1b7dba7e8ac90041 Mon Sep 17 00:00:00 2001 From: pnenzi Date: Sun, 13 Nov 2005 21:22:37 +0000 Subject: [PATCH] Added fixes from Hitoshi Tanaka and Dietmar Warning over original code. --- ChangeLog | 19 +++++++++++++++++++ src/spicelib/devices/bsim4/b4ld.c | 8 ++++---- src/spicelib/devices/bsim4/b4set.c | 1 - src/spicelib/devices/bsim4/b4temp.c | 2 ++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6f4671fe..8a0905fe8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,25 @@ - Added NodeSet for internal nodes. - Removed #ifdef STDC and non STDC function prototypes - Added missing "pParam->BSIM4ku0we" to fprintf in b4temp.c. + + * src/spicelib/devices/bsim4/b4temp.c: fixed the following bug (Dietmar + Warning): + + - Freed old node adding FREE(model->pSizeDependParamKnot); near line 146. + + * src/spicelib/devices/bsim4/b4set.c: fixed the following bug (Dietmar + Warning): + + - Removed double testing for model->BSIM4prtGiven. + + * src/spicelib/devices/bsim4/b4ld.c: fixed the following bugs: + + - In the computation of ggts and ggtd near line 4014 here->BSIM4gcrgd + and here->BSIM4gcrgs were exchanged. (Dietmar Warning). + + - In the computation of gcqdb and gcqsb near line 4019 here->BSIM4cqsb + and here->BSIM4cqdb were exchanged (Hitoshi Tanaka). + 2005-11-07 Paolo Nenzi diff --git a/src/spicelib/devices/bsim4/b4ld.c b/src/spicelib/devices/bsim4/b4ld.c index 519b357af..ebbfa9d2b 100644 --- a/src/spicelib/devices/bsim4/b4ld.c +++ b/src/spicelib/devices/bsim4/b4ld.c @@ -4011,14 +4011,14 @@ line755: * pParam->BSIM4leffCV; T0 = qdef * ScalingFactor / CoxWL; ggtg = here->BSIM4gtg = T0 * here->BSIM4gcrgg; - ggts = here->BSIM4gts = T0 * here->BSIM4gcrgd; - ggtd = here->BSIM4gtd = T0 * here->BSIM4gcrgs; + ggts = here->BSIM4gts = T0 * here->BSIM4gcrgs; + ggtd = here->BSIM4gtd = T0 * here->BSIM4gcrgd; ggtb = here->BSIM4gtb = T0 * here->BSIM4gcrgb; gqdef = ScalingFactor * ag0; gcqgb = here->BSIM4cqgb * ag0; - gcqdb = here->BSIM4cqsb * ag0; - gcqsb = here->BSIM4cqdb * ag0; + gcqdb = here->BSIM4cqdb * ag0; + gcqsb = here->BSIM4cqsb * ag0; gcqbb = here->BSIM4cqbb * ag0; if (fabs(qcheq) <= 1.0e-5 * CoxWL) diff --git a/src/spicelib/devices/bsim4/b4set.c b/src/spicelib/devices/bsim4/b4set.c index bef502c0c..babcd21ad 100644 --- a/src/spicelib/devices/bsim4/b4set.c +++ b/src/spicelib/devices/bsim4/b4set.c @@ -326,7 +326,6 @@ JOB *job; model->BSIM4prwg = 1.0; /* in 1/V */ if (!model->BSIM4prwbGiven) model->BSIM4prwb = 0.0; - if (!model->BSIM4prtGiven) if (!model->BSIM4prtGiven) model->BSIM4prt = 0.0; if (!model->BSIM4eta0Given) diff --git a/src/spicelib/devices/bsim4/b4temp.c b/src/spicelib/devices/bsim4/b4temp.c index 1a2385c1c..db8034a03 100644 --- a/src/spicelib/devices/bsim4/b4temp.c +++ b/src/spicelib/devices/bsim4/b4temp.c @@ -142,6 +142,8 @@ int Size_Not_Found, i; } if (!model->BSIM4cgboGiven) model->BSIM4cgbo = 2.0 * model->BSIM4dwc * model->BSIM4coxe; + /* va: was memory leakage - free old node, (or better use again?) */ + FREE(model->pSizeDependParamKnot); model->pSizeDependParamKnot = NULL; pLastKnot = NULL;