From a6f530b95cddcfbc6832386b3a564490c8897c5b Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 9 Jul 2016 21:23:15 +0200 Subject: [PATCH] USE_OMP, cleanup initialisation of local variable `model' --- src/spicelib/devices/bsim3/b3ld.c | 6 +----- src/spicelib/devices/bsim4/b4ld.c | 6 +----- src/spicelib/devices/bsim4v6/b4v6ld.c | 6 +----- src/spicelib/devices/bsim4v7/b4v7ld.c | 6 +----- src/spicelib/devices/bsimsoi/b4soild.c | 6 +----- src/spicelib/devices/hisim2/hsm2ld.c | 3 +-- 6 files changed, 6 insertions(+), 27 deletions(-) diff --git a/src/spicelib/devices/bsim3/b3ld.c b/src/spicelib/devices/bsim3/b3ld.c index 25d01ffa5..4cffbf032 100644 --- a/src/spicelib/devices/bsim3/b3ld.c +++ b/src/spicelib/devices/bsim3/b3ld.c @@ -65,7 +65,7 @@ CKTcircuit *ckt) int BSIM3LoadOMP(BSIM3instance *here, CKTcircuit *ckt) { -BSIM3model *model; +BSIM3model *model = here->BSIM3modPtr; #else BSIM3model *model = (BSIM3model*)inModel; BSIM3instance *here; @@ -173,10 +173,6 @@ struct bsim3SizeDependParam *pParam; int ByPass, Check, ChargeComputationNeeded, error; /* double junk[50]; */ -#ifdef USE_OMP -model = here->BSIM3modPtr; -#endif - ScalingFactor = 1.0e-9; ChargeComputationNeeded = ((ckt->CKTmode & (MODEDCTRANCURVE | MODEAC | MODETRAN | MODEINITSMSIG)) || diff --git a/src/spicelib/devices/bsim4/b4ld.c b/src/spicelib/devices/bsim4/b4ld.c index 4ffb21e99..912d865f4 100644 --- a/src/spicelib/devices/bsim4/b4ld.c +++ b/src/spicelib/devices/bsim4/b4ld.c @@ -95,7 +95,7 @@ CKTcircuit *ckt) int BSIM4LoadOMP(BSIM4instance *here, CKTcircuit *ckt) { -BSIM4model *model; +BSIM4model *model = here->BSIM4modPtr; #else BSIM4model *model = (BSIM4model*)inModel; BSIM4instance *here; @@ -243,10 +243,6 @@ int ByPass, ChargeComputationNeeded, error, Check, Check1, Check2; double m; -#ifdef USE_OMP -model = here->BSIM4modPtr; -#endif - ScalingFactor = 1.0e-9; ChargeComputationNeeded = ((ckt->CKTmode & (MODEDCTRANCURVE | MODEAC | MODETRAN | MODEINITSMSIG)) || diff --git a/src/spicelib/devices/bsim4v6/b4v6ld.c b/src/spicelib/devices/bsim4v6/b4v6ld.c index c1e67e2f5..3c82d56fb 100644 --- a/src/spicelib/devices/bsim4v6/b4v6ld.c +++ b/src/spicelib/devices/bsim4v6/b4v6ld.c @@ -95,7 +95,7 @@ CKTcircuit *ckt) int BSIM4v6LoadOMP(BSIM4v6instance *here, CKTcircuit *ckt) { -BSIM4v6model *model; +BSIM4v6model *model = here->BSIM4v6modPtr; #else BSIM4v6model *model = (BSIM4v6model*)inModel; BSIM4v6instance *here; @@ -241,10 +241,6 @@ int ByPass, ChargeComputationNeeded, error, Check, Check1, Check2; double m; -#ifdef USE_OMP -model = here->BSIM4v6modPtr; -#endif - ScalingFactor = 1.0e-9; ChargeComputationNeeded = ((ckt->CKTmode & (MODEAC | MODETRAN | MODEINITSMSIG)) || diff --git a/src/spicelib/devices/bsim4v7/b4v7ld.c b/src/spicelib/devices/bsim4v7/b4v7ld.c index 0813a1c5f..7d71d476a 100644 --- a/src/spicelib/devices/bsim4v7/b4v7ld.c +++ b/src/spicelib/devices/bsim4v7/b4v7ld.c @@ -93,7 +93,7 @@ CKTcircuit *ckt) int BSIM4v7LoadOMP(BSIM4v7instance *here, CKTcircuit *ckt) { -BSIM4v7model *model; +BSIM4v7model *model = here->BSIM4v7modPtr; #else BSIM4v7model *model = (BSIM4v7model*)inModel; BSIM4v7instance *here; @@ -241,10 +241,6 @@ int ByPass, ChargeComputationNeeded, error, Check, Check1, Check2; double m; -#ifdef USE_OMP -model = here->BSIM4v7modPtr; -#endif - ScalingFactor = 1.0e-9; ChargeComputationNeeded = ((ckt->CKTmode & (MODEDCTRANCURVE | MODEAC | MODETRAN | MODEINITSMSIG)) || diff --git a/src/spicelib/devices/bsimsoi/b4soild.c b/src/spicelib/devices/bsimsoi/b4soild.c index a1d144f26..29ab52378 100644 --- a/src/spicelib/devices/bsimsoi/b4soild.c +++ b/src/spicelib/devices/bsimsoi/b4soild.c @@ -127,7 +127,7 @@ B4SOIload( } int B4SOILoadOMP(B4SOIinstance *here, CKTcircuit *ckt) { - B4SOImodel *model; + B4SOImodel *model = here->B4SOImodPtr; #else register B4SOImodel *model = (B4SOImodel*)inModel; register B4SOIinstance *here; @@ -488,10 +488,6 @@ int B4SOILoadOMP(B4SOIinstance *here, CKTcircuit *ckt) { double eggbcp2, eggdep, agb1, bgb1, agb2, bgb2, agbc2n, agbc2p, bgbc2n, bgbc2p, Vtm00; /* v4.3.1 bugfix for mtrlMod=1 -Tanvir */ double m; -#ifdef USE_OMP - model = here->B4SOImodPtr; -#endif - #ifndef USE_OMP for (; model != NULL; model = model->B4SOInextModel) { for (here = model->B4SOIinstances; here != NULL; diff --git a/src/spicelib/devices/hisim2/hsm2ld.c b/src/spicelib/devices/hisim2/hsm2ld.c index a42b59fe4..ce41a6e52 100644 --- a/src/spicelib/devices/hisim2/hsm2ld.c +++ b/src/spicelib/devices/hisim2/hsm2ld.c @@ -247,7 +247,7 @@ int HSM2load( int HSM2LoadOMP(HSM2instance *here, CKTcircuit *ckt) { - HSM2model *model; + HSM2model *model = here->HSM2modPtr; #else HSM2model *model = (HSM2model*)inModel; HSM2instance *here; @@ -300,7 +300,6 @@ tm0 = gtodsecld() ; #endif #ifdef USE_OMP - model = here->HSM2modPtr; reltol = ckt->CKTreltol * BYP_TOL_FACTOR ; abstol = ckt->CKTabstol * BYP_TOL_FACTOR ; voltTol= ckt->CKTvoltTol* BYP_TOL_FACTOR ;