diff --git a/src/include/ngspice/sensdefs.h b/src/include/ngspice/sensdefs.h index e25e023a3..43bf72f94 100644 --- a/src/include/ngspice/sensdefs.h +++ b/src/include/ngspice/sensdefs.h @@ -80,17 +80,12 @@ extern int sens_sens(CKTcircuit *,int); #define SENS_STOP 11 #define SENS_STEPS 12 -#define SENS_DEC 13 -#define SENS_OCT 14 -#define SENS_LIN 15 - #define SENS_DECADE 13 #define SENS_OCTAVE 14 #define SENS_LINEAR 15 #define SENS_DC 16 #define SENS_DEFTOL 17 -#define SENS_DEFPERT 18 #define SENS_DEFPERTURB 18 #define SENS_DEVDEFTOL 19 #define SENS_DEVDEFPERT 20 diff --git a/src/spicelib/analysis/sensaskq.c b/src/spicelib/analysis/sensaskq.c index 74c26f5ab..55fc04102 100644 --- a/src/spicelib/analysis/sensaskq.c +++ b/src/spicelib/analysis/sensaskq.c @@ -31,9 +31,9 @@ SENSask(CKTcircuit *ckt, JOB *anal, int which, IFvalue *value) value->iValue = job->n_freq_steps; break; - case SENS_DEC: - case SENS_OCT: - case SENS_LIN: + case SENS_DECADE: + case SENS_OCTAVE: + case SENS_LINEAR: case SENS_DC: value->iValue = job->step_type == which; break; diff --git a/src/spicelib/analysis/senssetp.c b/src/spicelib/analysis/senssetp.c index 835be0c8b..916a838a5 100644 --- a/src/spicelib/analysis/senssetp.c +++ b/src/spicelib/analysis/senssetp.c @@ -53,15 +53,15 @@ SENSsetParam(CKTcircuit *ckt, JOB *anal, int which, IFvalue *value) job->n_freq_steps = value->iValue; break; - case SENS_DEC: + case SENS_DECADE: job->step_type = SENS_DECADE; break; - case SENS_OCT: + case SENS_OCTAVE: job->step_type = SENS_OCTAVE; break; - case SENS_LIN: + case SENS_LINEAR: job->step_type = SENS_LINEAR; break; @@ -97,9 +97,9 @@ static IFparm SENSparms[] = { { "stop", SENS_STOP, IF_SET|IF_ASK|IF_REAL, "ending frequency" }, { "numsteps", SENS_STEPS,IF_SET|IF_ASK|IF_INTEGER, "number of frequencies"}, - { "dec", SENS_DEC, IF_SET|IF_FLAG, "step by decades" }, - { "oct", SENS_OCT, IF_SET|IF_FLAG, "step by octaves" }, - { "lin", SENS_LIN, IF_SET|IF_FLAG, "step linearly" }, + { "dec", SENS_DECADE, IF_SET|IF_FLAG, "step by decades" }, + { "oct", SENS_OCTAVE, IF_SET|IF_FLAG, "step by octaves" }, + { "lin", SENS_LINEAR, IF_SET|IF_FLAG, "step linearly" }, { "dc", SENS_DC, IF_SET|IF_FLAG, "analysis at DC" }, }; diff --git a/src/spicelib/devices/asrc/Makefile.am b/src/spicelib/devices/asrc/Makefile.am index e97fa7cdd..f733ed914 100644 --- a/src/spicelib/devices/asrc/Makefile.am +++ b/src/spicelib/devices/asrc/Makefile.am @@ -16,7 +16,6 @@ libasrc_la_SOURCES = \ asrcinit.c \ asrcinit.h \ asrcload.c \ - asrcmdel.c \ asrcpar.c \ asrcpzld.c \ asrcset.c \ diff --git a/src/spicelib/devices/asrc/asrcext.h b/src/spicelib/devices/asrc/asrcext.h index ee6d30081..77b401388 100644 --- a/src/spicelib/devices/asrc/asrcext.h +++ b/src/spicelib/devices/asrc/asrcext.h @@ -9,7 +9,6 @@ extern int ASRCdelete(GENinstance *); extern void ASRCdestroy(void); extern int ASRCfindBr(CKTcircuit *, GENmodel *, IFuid); extern int ASRCload(GENmodel *, CKTcircuit *); -extern int ASRCmDelete(GENmodel *); extern int ASRCparam(int, IFvalue *, GENinstance *, IFvalue *); extern int ASRCpzLoad(GENmodel *, CKTcircuit *, SPcomplex *); extern int ASRCacLoad(GENmodel *, CKTcircuit *); diff --git a/src/spicelib/devices/asrc/asrcinit.c b/src/spicelib/devices/asrc/asrcinit.c index 05f8c2f7b..cfc00310c 100644 --- a/src/spicelib/devices/asrc/asrcinit.c +++ b/src/spicelib/devices/asrc/asrcinit.c @@ -43,7 +43,7 @@ SPICEdev ASRCinfo = { .DEVacLoad = ASRCacLoad, .DEVaccept = NULL, .DEVdestroy = ASRCdestroy, - .DEVmodDelete = ASRCmDelete, + .DEVmodDelete = NULL, .DEVdelete = ASRCdelete, .DEVsetic = NULL, .DEVask = ASRCask, diff --git a/src/spicelib/devices/asrc/asrcmdel.c b/src/spicelib/devices/asrc/asrcmdel.c deleted file mode 100644 index 16cbe36f4..000000000 --- a/src/spicelib/devices/asrc/asrcmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1987 Kanwar Jit Singh -**********/ - -#include "ngspice/ngspice.h" -#include "asrcdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -ASRCmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/bjt/Makefile.am b/src/spicelib/devices/bjt/Makefile.am index e1ddb2a9d..a7a792f34 100644 --- a/src/spicelib/devices/bjt/Makefile.am +++ b/src/spicelib/devices/bjt/Makefile.am @@ -9,7 +9,6 @@ libbjt_la_SOURCES = \ bjtconv.c \ bjtdefs.h \ bjtdel.c \ - bjtdest.c \ bjtdisto.c \ bjtdset.c \ bjtdset.h \ @@ -20,7 +19,6 @@ libbjt_la_SOURCES = \ bjtitf.h \ bjtload.c \ bjtmask.c \ - bjtmdel.c \ bjtmpar.c \ bjtnoise.c \ bjtparam.c \ diff --git a/src/spicelib/devices/bjt/bjtdefs.h b/src/spicelib/devices/bjt/bjtdefs.h index f3fdd675a..30d819f2c 100644 --- a/src/spicelib/devices/bjt/bjtdefs.h +++ b/src/spicelib/devices/bjt/bjtdefs.h @@ -14,6 +14,18 @@ Author: 1985 Thomas L. Quarles /* structures to describe Bipolar Junction Transistors */ +/* indices to array of BJT noise sources */ + +#define BJTRCNOIZ 0 +#define BJTRBNOIZ 1 +#define BJT_RE_NOISE 2 +#define BJTICNOIZ 3 +#define BJTIBNOIZ 4 +#define BJTFLNOIZ 5 +#define BJTTOTNOIZ 6 + +#define BJTNSRCS 7 /* the number of BJT noise sources */ + /* data needed to describe a single instance */ typedef struct sBJTinstance { @@ -266,17 +278,6 @@ typedef struct sBJTinstance { #endif -/* indices to array of BJT noise sources */ - -#define BJTRCNOIZ 0 -#define BJTRBNOIZ 1 -#define BJT_RE_NOISE 2 -#define BJTICNOIZ 3 -#define BJTIBNOIZ 4 -#define BJTFLNOIZ 5 -#define BJTTOTNOIZ 6 - -#define BJTNSRCS 7 /* the number of BJT noise sources */ #ifndef NONOISE double BJTnVar[NSTATVARS][BJTNSRCS]; diff --git a/src/spicelib/devices/bjt/bjtdest.c b/src/spicelib/devices/bjt/bjtdest.c deleted file mode 100644 index f308c6787..000000000 --- a/src/spicelib/devices/bjt/bjtdest.c +++ /dev/null @@ -1,19 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -/* - * This routine deletes all BJTs from the circuit and frees - * all storage they were using. - */ - -#include "ngspice/ngspice.h" -#include "bjtdefs.h" -#include "ngspice/suffix.h" - - -void -BJTdestroy(void) -{ -} diff --git a/src/spicelib/devices/bjt/bjtext.h b/src/spicelib/devices/bjt/bjtext.h index 60f1c5689..e2eb186b5 100644 --- a/src/spicelib/devices/bjt/bjtext.h +++ b/src/spicelib/devices/bjt/bjtext.h @@ -11,11 +11,9 @@ extern int BJTacLoad(GENmodel *,CKTcircuit*); extern int BJTask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int BJTconvTest(GENmodel*,CKTcircuit*); extern int BJTdelete(GENinstance*); -extern void BJTdestroy(void); extern int BJTgetic(GENmodel*,CKTcircuit*); extern int BJTload(GENmodel*,CKTcircuit*); extern int BJTmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int BJTmDelete(GENmodel*); extern int BJTmParam(int,IFvalue*,GENmodel*); extern int BJTparam(int,IFvalue*,GENinstance*,IFvalue*); extern int BJTpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/bjt/bjtinit.c b/src/spicelib/devices/bjt/bjtinit.c index 0ead9b7b6..18f094d6d 100644 --- a/src/spicelib/devices/bjt/bjtinit.c +++ b/src/spicelib/devices/bjt/bjtinit.c @@ -42,8 +42,8 @@ SPICEdev BJTinfo = { .DEVfindBranch = NULL, .DEVacLoad = BJTacLoad, .DEVaccept = NULL, - .DEVdestroy = BJTdestroy, - .DEVmodDelete = BJTmDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = BJTdelete, .DEVsetic = BJTgetic, .DEVask = BJTask, diff --git a/src/spicelib/devices/bjt/bjtmdel.c b/src/spicelib/devices/bjt/bjtmdel.c deleted file mode 100644 index 6d8bbdb23..000000000 --- a/src/spicelib/devices/bjt/bjtmdel.c +++ /dev/null @@ -1,23 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -/* - * This routine deletes a BJT model from the circuit and frees - * the storage it was using. - * returns an error if the model has instances - */ - -#include "ngspice/ngspice.h" -#include "bjtdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -BJTmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/bjt/bjtsetup.c b/src/spicelib/devices/bjt/bjtsetup.c index 6c34fd1e2..cb2995660 100644 --- a/src/spicelib/devices/bjt/bjtsetup.c +++ b/src/spicelib/devices/bjt/bjtsetup.c @@ -371,7 +371,7 @@ BJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) here->BJTstate = *states; *states += BJTnumStates; if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & TRANSEN) ){ - *states += 8 * (ckt->CKTsenInfo->SENparms); + *states += BJTnumSenStates * (ckt->CKTsenInfo->SENparms); } if(model->BJTcollectorResist == 0) { diff --git a/src/spicelib/devices/bsim1/Makefile.am b/src/spicelib/devices/bsim1/Makefile.am index d08915b4c..4492996d8 100644 --- a/src/spicelib/devices/bsim1/Makefile.am +++ b/src/spicelib/devices/bsim1/Makefile.am @@ -7,15 +7,12 @@ libbsim1_la_SOURCES = \ b1acld.c \ b1ask.c \ b1cvtest.c \ - b1del.c \ - b1dest.c \ b1disto.c \ b1dset.c \ b1eval.c \ b1getic.c \ b1ld.c \ b1mask.c \ - b1mdel.c \ b1moscap.c \ b1mpar.c \ b1par.c \ diff --git a/src/spicelib/devices/bsim1/b1del.c b/src/spicelib/devices/bsim1/b1del.c deleted file mode 100644 index 53f4e57d1..000000000 --- a/src/spicelib/devices/bsim1/b1del.c +++ /dev/null @@ -1,18 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Hong J. Park, Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "bsim1def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -B1delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim1/b1dest.c b/src/spicelib/devices/bsim1/b1dest.c deleted file mode 100644 index be7f72943..000000000 --- a/src/spicelib/devices/bsim1/b1dest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Hong J. Park, Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "bsim1def.h" -#include "ngspice/suffix.h" - - -void -B1destroy(void) -{ -} diff --git a/src/spicelib/devices/bsim1/b1mdel.c b/src/spicelib/devices/bsim1/b1mdel.c deleted file mode 100644 index 3969637a7..000000000 --- a/src/spicelib/devices/bsim1/b1mdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Hong J. Park, Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "bsim1def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -B1mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/bsim1/bsim1ext.h b/src/spicelib/devices/bsim1/bsim1ext.h index 6cece2341..ec4065112 100644 --- a/src/spicelib/devices/bsim1/bsim1ext.h +++ b/src/spicelib/devices/bsim1/bsim1ext.h @@ -8,12 +8,9 @@ Modified: 2000 AlansFixes extern int B1acLoad(GENmodel *,CKTcircuit*); extern int B1ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int B1convTest(GENmodel *,CKTcircuit*); -extern int B1delete(GENinstance*); -extern void B1destroy(void); extern int B1getic(GENmodel*,CKTcircuit*); extern int B1load(GENmodel*,CKTcircuit*); extern int B1mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int B1mDelete(GENmodel*); extern int B1mParam(int,IFvalue*,GENmodel*); extern void B1mosCap(CKTcircuit*, double, double, double, double*, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim1/bsim1init.c b/src/spicelib/devices/bsim1/bsim1init.c index ef9316862..c088734c4 100644 --- a/src/spicelib/devices/bsim1/bsim1init.c +++ b/src/spicelib/devices/bsim1/bsim1init.c @@ -42,9 +42,9 @@ SPICEdev B1info = { .DEVfindBranch = NULL, .DEVacLoad = B1acLoad, .DEVaccept = NULL, - .DEVdestroy = B1destroy, - .DEVmodDelete = B1mDelete, - .DEVdelete = B1delete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = B1getic, .DEVask = B1ask, .DEVmodAsk = B1mAsk, diff --git a/src/spicelib/devices/bsim2/Makefile.am b/src/spicelib/devices/bsim2/Makefile.am index 97597da11..bd24598ce 100644 --- a/src/spicelib/devices/bsim2/Makefile.am +++ b/src/spicelib/devices/bsim2/Makefile.am @@ -7,13 +7,10 @@ libbsim2_la_SOURCES = \ b2acld.c \ b2ask.c \ b2cvtest.c \ - b2del.c \ - b2dest.c \ b2eval.c \ b2getic.c \ b2ld.c \ b2mask.c \ - b2mdel.c \ b2moscap.c \ b2mpar.c \ b2noi.c \ diff --git a/src/spicelib/devices/bsim2/b2del.c b/src/spicelib/devices/bsim2/b2del.c deleted file mode 100644 index 9eb62f373..000000000 --- a/src/spicelib/devices/bsim2/b2del.c +++ /dev/null @@ -1,18 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Hong J. Park, Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "bsim2def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -B2delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim2/b2dest.c b/src/spicelib/devices/bsim2/b2dest.c deleted file mode 100644 index bc4e7ea0a..000000000 --- a/src/spicelib/devices/bsim2/b2dest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Hong J. Park, Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "bsim2def.h" -#include "ngspice/suffix.h" - - -void -B2destroy(void) -{ -} diff --git a/src/spicelib/devices/bsim2/b2mdel.c b/src/spicelib/devices/bsim2/b2mdel.c deleted file mode 100644 index 2cf186a9a..000000000 --- a/src/spicelib/devices/bsim2/b2mdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Hong J. Park, Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "bsim2def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -B2mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/bsim2/bsim2ext.h b/src/spicelib/devices/bsim2/bsim2ext.h index 0205d64a5..160183a50 100644 --- a/src/spicelib/devices/bsim2/bsim2ext.h +++ b/src/spicelib/devices/bsim2/bsim2ext.h @@ -6,12 +6,9 @@ Author: 1988 Min-Chie Jeng, Hong June Park, Thomas L. Quarles extern int B2acLoad(GENmodel *,CKTcircuit*); extern int B2ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int B2convTest(GENmodel *,CKTcircuit*); -extern int B2delete(GENinstance*); -extern void B2destroy(void); extern int B2getic(GENmodel*,CKTcircuit*); extern int B2load(GENmodel*,CKTcircuit*); extern int B2mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int B2mDelete(GENmodel*); extern int B2mParam(int,IFvalue*,GENmodel*); extern void B2mosCap(CKTcircuit*, double, double, double, double*, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim2/bsim2init.c b/src/spicelib/devices/bsim2/bsim2init.c index 2cc2109c0..b3e61f5a8 100644 --- a/src/spicelib/devices/bsim2/bsim2init.c +++ b/src/spicelib/devices/bsim2/bsim2init.c @@ -42,9 +42,9 @@ SPICEdev B2info = { .DEVfindBranch = NULL, .DEVacLoad = B2acLoad, .DEVaccept = NULL, - .DEVdestroy = B2destroy, - .DEVmodDelete = B2mDelete, - .DEVdelete = B2delete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = B2getic, .DEVask = B2ask, .DEVmodAsk = B2mAsk, diff --git a/src/spicelib/devices/bsim3/Makefile.am b/src/spicelib/devices/bsim3/Makefile.am index 397e19595..b5212d165 100644 --- a/src/spicelib/devices/bsim3/Makefile.am +++ b/src/spicelib/devices/bsim3/Makefile.am @@ -8,8 +8,6 @@ libbsim3_la_SOURCES = \ b3ask.c \ b3check.c \ b3cvtest.c \ - b3del.c \ - b3dest.c \ b3getic.c \ b3ld.c \ b3mask.c \ diff --git a/src/spicelib/devices/bsim3/b3del.c b/src/spicelib/devices/bsim3/b3del.c deleted file mode 100644 index 780c0c8a4..000000000 --- a/src/spicelib/devices/bsim3/b3del.c +++ /dev/null @@ -1,24 +0,0 @@ -/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b3del.c of BSIM3v3.3.0 - * Author: 1995 Min-Chie Jeng and Mansun Chan - * Author: 1997-1999 Weidong Liu. - * Author: 2001 Xuemei Xi - * Modified by Xuemei Xi, 10/05, 12/14, 2001. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim3def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -BSIM3delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim3/b3dest.c b/src/spicelib/devices/bsim3/b3dest.c deleted file mode 100644 index 5be833512..000000000 --- a/src/spicelib/devices/bsim3/b3dest.c +++ /dev/null @@ -1,19 +0,0 @@ -/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b3dest.c of BSIM3v3.3.0 - * Author: 1995 Min-Chie Jeng and Mansun Chan. - * Author: 1997-1999 Weidong Liu. - * Author: 2001 Xuemei Xi - **********/ - -#include "ngspice/ngspice.h" -#include "bsim3def.h" -#include "ngspice/suffix.h" - - -void -BSIM3destroy(void) -{ -} diff --git a/src/spicelib/devices/bsim3/bsim3ext.h b/src/spicelib/devices/bsim3/bsim3ext.h index a33cf2c3f..7e171a0e9 100644 --- a/src/spicelib/devices/bsim3/bsim3ext.h +++ b/src/spicelib/devices/bsim3/bsim3ext.h @@ -8,8 +8,6 @@ File: bsim3ext.h extern int BSIM3acLoad(GENmodel *,CKTcircuit*); extern int BSIM3ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int BSIM3convTest(GENmodel *,CKTcircuit*); -extern int BSIM3delete(GENinstance*); -extern void BSIM3destroy(void); extern int BSIM3getic(GENmodel*,CKTcircuit*); extern int BSIM3load(GENmodel*,CKTcircuit*); extern int BSIM3mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); diff --git a/src/spicelib/devices/bsim3/bsim3init.c b/src/spicelib/devices/bsim3/bsim3init.c index 271d429b3..dd42f19b4 100644 --- a/src/spicelib/devices/bsim3/bsim3init.c +++ b/src/spicelib/devices/bsim3/bsim3init.c @@ -42,9 +42,9 @@ SPICEdev BSIM3info = { .DEVfindBranch = NULL, .DEVacLoad = BSIM3acLoad, .DEVaccept = NULL, - .DEVdestroy = BSIM3destroy, + .DEVdestroy = NULL, .DEVmodDelete = BSIM3mDelete, - .DEVdelete = BSIM3delete, + .DEVdelete = NULL, .DEVsetic = BSIM3getic, .DEVask = BSIM3ask, .DEVmodAsk = BSIM3mAsk, diff --git a/src/spicelib/devices/bsim3soi_dd/Makefile.am b/src/spicelib/devices/bsim3soi_dd/Makefile.am index df3b14beb..9d65168f0 100644 --- a/src/spicelib/devices/bsim3soi_dd/Makefile.am +++ b/src/spicelib/devices/bsim3soi_dd/Makefile.am @@ -8,12 +8,9 @@ libbsim3soidd_la_SOURCES = \ b3soiddask.c \ b3soiddcheck.c \ b3soiddcvtest.c \ - b3soidddel.c \ - b3soidddest.c \ b3soiddgetic.c \ b3soiddld.c \ b3soiddmask.c \ - b3soiddmdel.c \ b3soiddmpar.c \ b3soiddnoi.c \ b3soiddpar.c \ diff --git a/src/spicelib/devices/bsim3soi_dd/b3soidddel.c b/src/spicelib/devices/bsim3soi_dd/b3soidddel.c deleted file mode 100644 index 2608d2fcb..000000000 --- a/src/spicelib/devices/bsim3soi_dd/b3soidddel.c +++ /dev/null @@ -1,25 +0,0 @@ -/********** -Copyright 1999 Regents of the University of California. All rights reserved. -Author: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang -File: b3soidddel.c 98/5/01 -Modified by Paolo Nenzi 2002 -**********/ - -/* - * Revision 2.1 99/9/27 Pin Su - * BSIMDD2.1 release - */ - -#include "ngspice/ngspice.h" -#include "b3soidddef.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -B3SOIDDdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim3soi_dd/b3soidddest.c b/src/spicelib/devices/bsim3soi_dd/b3soidddest.c deleted file mode 100644 index 10042914b..000000000 --- a/src/spicelib/devices/bsim3soi_dd/b3soidddest.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** -Copyright 1999 Regents of the University of California. All rights reserved. -Author: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang -File: b3soidddest.c 98/5/01 -Modified by Paolo Nenzi 2002 -**********/ - -/* - * Revision 2.1 99/9/27 Pin Su - * BSIMDD2.1 release - */ - -#include "ngspice/ngspice.h" -#include "b3soidddef.h" -#include "ngspice/suffix.h" - - -void -B3SOIDDdestroy(void) -{ -} diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddext.h b/src/spicelib/devices/bsim3soi_dd/b3soiddext.h index edb74c31c..1121ae107 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddext.h +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddext.h @@ -8,12 +8,9 @@ Modifed by Paolo Nenzi 2002 extern int B3SOIDDacLoad(GENmodel *,CKTcircuit*); extern int B3SOIDDask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int B3SOIDDconvTest(GENmodel *,CKTcircuit*); -extern int B3SOIDDdelete(GENinstance*); -extern void B3SOIDDdestroy(void); extern int B3SOIDDgetic(GENmodel*,CKTcircuit*); extern int B3SOIDDload(GENmodel*,CKTcircuit*); extern int B3SOIDDmAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int B3SOIDDmDelete(GENmodel*); extern int B3SOIDDmParam(int,IFvalue*,GENmodel*); extern void B3SOIDDmosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddinit.c b/src/spicelib/devices/bsim3soi_dd/b3soiddinit.c index b69381214..a6e2c0686 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddinit.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddinit.c @@ -40,9 +40,9 @@ SPICEdev B3SOIDDinfo = { .DEVfindBranch = NULL, .DEVacLoad = B3SOIDDacLoad, .DEVaccept = NULL, - .DEVdestroy = B3SOIDDdestroy, - .DEVmodDelete = B3SOIDDmDelete, - .DEVdelete = B3SOIDDdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = B3SOIDDgetic, .DEVask = B3SOIDDask, .DEVmodAsk = B3SOIDDmAsk, diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c b/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c deleted file mode 100644 index 235262bf6..000000000 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c +++ /dev/null @@ -1,25 +0,0 @@ -/********** -Copyright 1999 Regents of the University of California. All rights reserved. -Author: Weidong Liu and Pin Su Feb 1999 -Author: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang -File: b3soiddmdel.c 98/5/01 -Modified by Paolo Nenzi 2002 -**********/ - -/* - * Revision 2.1 99/9/27 Pin Su - * BSIMDD2.1 release - */ - -#include "ngspice/ngspice.h" -#include "b3soidddef.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -B3SOIDDmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/bsim3soi_fd/Makefile.am b/src/spicelib/devices/bsim3soi_fd/Makefile.am index dad13649e..0e06b8e95 100644 --- a/src/spicelib/devices/bsim3soi_fd/Makefile.am +++ b/src/spicelib/devices/bsim3soi_fd/Makefile.am @@ -8,12 +8,9 @@ libbsim3soifd_la_SOURCES = \ b3soifdask.c \ b3soifdcheck.c \ b3soifdcvtest.c \ - b3soifddel.c \ - b3soifddest.c \ b3soifdgetic.c \ b3soifdld.c \ b3soifdmask.c \ - b3soifdmdel.c \ b3soifdmpar.c \ b3soifdnoi.c \ b3soifdpar.c \ diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifddel.c b/src/spicelib/devices/bsim3soi_fd/b3soifddel.c deleted file mode 100644 index 1faf4c3c3..000000000 --- a/src/spicelib/devices/bsim3soi_fd/b3soifddel.c +++ /dev/null @@ -1,25 +0,0 @@ -/********** -Copyright 1999 Regents of the University of California. All rights reserved. -Author: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang -Modified by Paolo Nenzi 2002 -File: b3soifddel.c 98/5/01 -**********/ - -/* - * Revision 2.1 99/9/27 Pin Su - * BSIMFD2.1 release - */ - -#include "ngspice/ngspice.h" -#include "b3soifddef.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -B3SOIFDdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifddest.c b/src/spicelib/devices/bsim3soi_fd/b3soifddest.c deleted file mode 100644 index b7fbc744d..000000000 --- a/src/spicelib/devices/bsim3soi_fd/b3soifddest.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** -Copyright 1999 Regents of the University of California. All rights reserved. -Author: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang -Modified by Paolo Nenzi 2002 -File: b3soifddest.c 98/5/01 -**********/ - -/* - * Revision 2.1 99/9/27 Pin Su - * BSIMFD2.1 release - */ - -#include "ngspice/ngspice.h" -#include "b3soifddef.h" -#include "ngspice/suffix.h" - - -void -B3SOIFDdestroy(void) -{ -} diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdext.h b/src/spicelib/devices/bsim3soi_fd/b3soifdext.h index 51974ca5e..3cc66bde6 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdext.h +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdext.h @@ -8,12 +8,9 @@ File: b3soifdext.h extern int B3SOIFDacLoad(GENmodel *,CKTcircuit*); extern int B3SOIFDask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int B3SOIFDconvTest(GENmodel *,CKTcircuit*); -extern int B3SOIFDdelete(GENinstance*); -extern void B3SOIFDdestroy(void); extern int B3SOIFDgetic(GENmodel*,CKTcircuit*); extern int B3SOIFDload(GENmodel*,CKTcircuit*); extern int B3SOIFDmAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int B3SOIFDmDelete(GENmodel*); extern int B3SOIFDmParam(int,IFvalue*,GENmodel*); extern void B3SOIFDmosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdinit.c b/src/spicelib/devices/bsim3soi_fd/b3soifdinit.c index d1c40835a..a4b0a0606 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdinit.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdinit.c @@ -40,9 +40,9 @@ SPICEdev B3SOIFDinfo = { .DEVfindBranch = NULL, .DEVacLoad = B3SOIFDacLoad, .DEVaccept = NULL, - .DEVdestroy = B3SOIFDdestroy, - .DEVmodDelete = B3SOIFDmDelete, - .DEVdelete = B3SOIFDdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = B3SOIFDgetic, .DEVask = B3SOIFDask, .DEVmodAsk = B3SOIFDmAsk, diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c b/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c deleted file mode 100644 index 45f82ada1..000000000 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c +++ /dev/null @@ -1,24 +0,0 @@ -/********** -Copyright 1999 Regents of the University of California. All rights reserved. -Author: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang -Modified by Paolo Nenzi 2002 -File: b3soifdmdel.c 98/5/01 -**********/ - -/* - * Revision 2.1 99/9/27 Pin Su - * BSIMFD2.1 release - */ - -#include "ngspice/ngspice.h" -#include "b3soifddef.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -B3SOIFDmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/bsim3soi_pd/Makefile.am b/src/spicelib/devices/bsim3soi_pd/Makefile.am index 5c426c521..bbb416c20 100644 --- a/src/spicelib/devices/bsim3soi_pd/Makefile.am +++ b/src/spicelib/devices/bsim3soi_pd/Makefile.am @@ -8,12 +8,9 @@ libbsim3soipd_la_SOURCES = \ b3soipdask.c \ b3soipdcheck.c \ b3soipdcvtest.c \ - b3soipddel.c \ - b3soipddest.c \ b3soipdgetic.c \ b3soipdld.c \ b3soipdmask.c \ - b3soipdmdel.c \ b3soipdmpar.c \ b3soipdnoi.c \ b3soipdpar.c \ diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipddel.c b/src/spicelib/devices/bsim3soi_pd/b3soipddel.c deleted file mode 100644 index 97b4fb4f4..000000000 --- a/src/spicelib/devices/bsim3soi_pd/b3soipddel.c +++ /dev/null @@ -1,25 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang -File: b3soipddel.c 98/5/01 -Modified by Paolo Nenzi 2002 -**********/ - -/* - * Revision 2.2.3 02/3/5 Pin Su - * BSIMPD2.2.3 release - */ - -#include "ngspice/ngspice.h" -#include "b3soipddef.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -B3SOIPDdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipddest.c b/src/spicelib/devices/bsim3soi_pd/b3soipddest.c deleted file mode 100644 index 6ddbedc51..000000000 --- a/src/spicelib/devices/bsim3soi_pd/b3soipddest.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang -File: b3soipddest.c 98/5/01 -Modified by Paolo Nenzi 2002 -**********/ - -/* - * Revision 2.2.3 02/3/5 Pin Su - * BSIMPD2.2.3 release - */ - -#include "ngspice/ngspice.h" -#include "b3soipddef.h" -#include "ngspice/suffix.h" - - -void -B3SOIPDdestroy(void) -{ -} diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdext.h b/src/spicelib/devices/bsim3soi_pd/b3soipdext.h index 2ca5f109f..b8b787ed5 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdext.h +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdext.h @@ -8,12 +8,9 @@ Modified by Paolo Nenzi 2002 extern int B3SOIPDacLoad(GENmodel *,CKTcircuit*); extern int B3SOIPDask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int B3SOIPDconvTest(GENmodel *,CKTcircuit*); -extern int B3SOIPDdelete(GENinstance*); -extern void B3SOIPDdestroy(void); extern int B3SOIPDgetic(GENmodel*,CKTcircuit*); extern int B3SOIPDload(GENmodel*,CKTcircuit*); extern int B3SOIPDmAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int B3SOIPDmDelete(GENmodel*); extern int B3SOIPDmParam(int,IFvalue*,GENmodel*); extern void B3SOIPDmosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdinit.c b/src/spicelib/devices/bsim3soi_pd/b3soipdinit.c index e8590bb56..c4f4fbbf0 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdinit.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdinit.c @@ -41,9 +41,9 @@ SPICEdev B3SOIPDinfo = { .DEVfindBranch = NULL, .DEVacLoad = B3SOIPDacLoad, .DEVaccept = NULL, - .DEVdestroy = B3SOIPDdestroy, - .DEVmodDelete = B3SOIPDmDelete, - .DEVdelete = B3SOIPDdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = B3SOIPDgetic, .DEVask = B3SOIPDask, .DEVmodAsk = B3SOIPDmAsk, diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c b/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c deleted file mode 100644 index 01ab0dd62..000000000 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c +++ /dev/null @@ -1,24 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang -File: b3soipdmdel.c 98/5/01 -Modified by Paolo Nenzi 2002 -**********/ - -/* - * Revision 2.2.3 02/3/5 Pin Su - * BSIMPD2.2.3 release - */ - -#include "ngspice/ngspice.h" -#include "b3soipddef.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -B3SOIPDmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/bsim3v0/Makefile.am b/src/spicelib/devices/bsim3v0/Makefile.am index 8273566bf..2fdd30da6 100644 --- a/src/spicelib/devices/bsim3v0/Makefile.am +++ b/src/spicelib/devices/bsim3v0/Makefile.am @@ -7,12 +7,9 @@ libbsim3v0_la_SOURCES = \ b3v0acld.c \ b3v0ask.c \ b3v0cvtest.c \ - b3v0del.c \ - b3v0dest.c \ b3v0getic.c \ b3v0ld.c \ b3v0mask.c \ - b3v0mdel.c \ b3v0mpar.c \ b3v0noi.c \ b3v0par.c \ diff --git a/src/spicelib/devices/bsim3v0/b3v0del.c b/src/spicelib/devices/bsim3v0/b3v0del.c deleted file mode 100644 index ca91728c8..000000000 --- a/src/spicelib/devices/bsim3v0/b3v0del.c +++ /dev/null @@ -1,19 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1995 Min-Chie Jeng and Mansun Chan. -File: b3v0del.c -**********/ - -#include "ngspice/ngspice.h" -#include "bsim3v0def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -BSIM3v0delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim3v0/b3v0dest.c b/src/spicelib/devices/bsim3v0/b3v0dest.c deleted file mode 100644 index 333422e0e..000000000 --- a/src/spicelib/devices/bsim3v0/b3v0dest.c +++ /dev/null @@ -1,15 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1995 Min-Chie Jeng and Mansun Chan. -File: b3v0dest.c -**********/ - -#include "ngspice/ngspice.h" -#include "bsim3v0def.h" -#include "ngspice/suffix.h" - - -void -BSIM3v0destroy(void) -{ -} diff --git a/src/spicelib/devices/bsim3v0/b3v0mdel.c b/src/spicelib/devices/bsim3v0/b3v0mdel.c deleted file mode 100644 index 35830f3f2..000000000 --- a/src/spicelib/devices/bsim3v0/b3v0mdel.c +++ /dev/null @@ -1,18 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1995 Min-Chie Jeng and Mansun Chan. -File: b3v0mdel.c -**********/ - -#include "ngspice/ngspice.h" -#include "bsim3v0def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -BSIM3v0mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/bsim3v0/bsim3v0ext.h b/src/spicelib/devices/bsim3v0/bsim3v0ext.h index 6d56a3b73..768ba71fa 100644 --- a/src/spicelib/devices/bsim3v0/bsim3v0ext.h +++ b/src/spicelib/devices/bsim3v0/bsim3v0ext.h @@ -7,12 +7,9 @@ File: bsim3v0ext.h extern int BSIM3v0acLoad(GENmodel *,CKTcircuit*); extern int BSIM3v0ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int BSIM3v0convTest(GENmodel *,CKTcircuit*); -extern int BSIM3v0delete(GENinstance*); -extern void BSIM3v0destroy(void); extern int BSIM3v0getic(GENmodel*,CKTcircuit*); extern int BSIM3v0load(GENmodel*,CKTcircuit*); extern int BSIM3v0mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int BSIM3v0mDelete(GENmodel*); extern int BSIM3v0mParam(int,IFvalue*,GENmodel*); extern void BSIM3v0mosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim3v0/bsim3v0init.c b/src/spicelib/devices/bsim3v0/bsim3v0init.c index 69d75373d..e149bcdbb 100644 --- a/src/spicelib/devices/bsim3v0/bsim3v0init.c +++ b/src/spicelib/devices/bsim3v0/bsim3v0init.c @@ -41,9 +41,9 @@ SPICEdev B3v0info = { .DEVfindBranch = NULL, .DEVacLoad = BSIM3v0acLoad, .DEVaccept = NULL, - .DEVdestroy = BSIM3v0destroy, - .DEVmodDelete = BSIM3v0mDelete, - .DEVdelete = BSIM3v0delete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = BSIM3v0getic, .DEVask = BSIM3v0ask, .DEVmodAsk = BSIM3v0mAsk, diff --git a/src/spicelib/devices/bsim3v1/Makefile.am b/src/spicelib/devices/bsim3v1/Makefile.am index 3b22e68ce..51dd196e1 100644 --- a/src/spicelib/devices/bsim3v1/Makefile.am +++ b/src/spicelib/devices/bsim3v1/Makefile.am @@ -8,12 +8,9 @@ libbsim3v1_la_SOURCES = \ b3v1ask.c \ b3v1check.c \ b3v1cvtest.c \ - b3v1del.c \ - b3v1dest.c \ b3v1getic.c \ b3v1ld.c \ b3v1mask.c \ - b3v1mdel.c \ b3v1mpar.c \ b3v1noi.c \ b3v1par.c \ diff --git a/src/spicelib/devices/bsim3v1/b3v1del.c b/src/spicelib/devices/bsim3v1/b3v1del.c deleted file mode 100644 index 1f8486b0d..000000000 --- a/src/spicelib/devices/bsim3v1/b3v1del.c +++ /dev/null @@ -1,25 +0,0 @@ -/********** - * Copyright 1990 Regents of the University of California. All rights reserved. - * File: b3v1del.c - * Author: 1995 Min-Chie Jeng and Mansun Chan. - * Modified by Paolo Nenzi 2002 - **********/ - -/* - * Release Notes: - * BSIM3v3.1, Released by yuhua 96/12/08 - */ - -#include "ngspice/ngspice.h" -#include "bsim3v1def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -BSIM3v1delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim3v1/b3v1dest.c b/src/spicelib/devices/bsim3v1/b3v1dest.c deleted file mode 100644 index 73d7626ea..000000000 --- a/src/spicelib/devices/bsim3v1/b3v1dest.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** - * Copyright 1990 Regents of the University of California. All rights reserved. - * File: b3v1dest.c - * Author: 1995 Min-Chie Jeng and Mansun Chan. - * Modified by Paolo Nenzi 2002 - **********/ - -/* - * Release Notes: - * BSIM3v3.1, Released by yuhua 96/12/08 - */ - -#include "ngspice/ngspice.h" -#include "bsim3v1def.h" -#include "ngspice/suffix.h" - - -void -BSIM3v1destroy(void) -{ -} diff --git a/src/spicelib/devices/bsim3v1/b3v1mdel.c b/src/spicelib/devices/bsim3v1/b3v1mdel.c deleted file mode 100644 index 66cc6205a..000000000 --- a/src/spicelib/devices/bsim3v1/b3v1mdel.c +++ /dev/null @@ -1,24 +0,0 @@ -/********** - * Copyright 1990 Regents of the University of California. All rights reserved. - * File: b3v1mdel.c - * Author: 1995 Min-Chie Jeng and Mansun Chan. - * Modified by Paolo Nenzi 2002 - **********/ - -/* - * Release Notes: - * BSIM3v3.1, Released by yuhua 96/12/08 - */ - -#include "ngspice/ngspice.h" -#include "bsim3v1def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -BSIM3v1mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/bsim3v1/bsim3v1ext.h b/src/spicelib/devices/bsim3v1/bsim3v1ext.h index e001f8eb3..6178967a1 100644 --- a/src/spicelib/devices/bsim3v1/bsim3v1ext.h +++ b/src/spicelib/devices/bsim3v1/bsim3v1ext.h @@ -8,12 +8,9 @@ File: bsim3v1ext.h extern int BSIM3v1acLoad(GENmodel *, CKTcircuit *); extern int BSIM3v1ask(CKTcircuit *, GENinstance *, int, IFvalue *, IFvalue *); extern int BSIM3v1convTest(GENmodel *, CKTcircuit *); -extern int BSIM3v1delete(GENinstance *); -extern void BSIM3v1destroy(void); extern int BSIM3v1getic(GENmodel *, CKTcircuit *); extern int BSIM3v1load(GENmodel *, CKTcircuit *); extern int BSIM3v1mAsk(CKTcircuit *, GENmodel *, int, IFvalue *); -extern int BSIM3v1mDelete(GENmodel *); extern int BSIM3v1mParam(int, IFvalue *, GENmodel *); extern void BSIM3v1mosCap(CKTcircuit *, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim3v1/bsim3v1init.c b/src/spicelib/devices/bsim3v1/bsim3v1init.c index 30fd4ebf7..7ee332de1 100644 --- a/src/spicelib/devices/bsim3v1/bsim3v1init.c +++ b/src/spicelib/devices/bsim3v1/bsim3v1init.c @@ -41,9 +41,9 @@ SPICEdev BSIM3v1info = { .DEVfindBranch = NULL, .DEVacLoad = BSIM3v1acLoad, .DEVaccept = NULL, - .DEVdestroy = BSIM3v1destroy, - .DEVmodDelete = BSIM3v1mDelete, - .DEVdelete = BSIM3v1delete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = BSIM3v1getic, .DEVask = BSIM3v1ask, .DEVmodAsk = BSIM3v1mAsk, diff --git a/src/spicelib/devices/bsim3v32/Makefile.am b/src/spicelib/devices/bsim3v32/Makefile.am index dccdb398f..ad8063cf6 100644 --- a/src/spicelib/devices/bsim3v32/Makefile.am +++ b/src/spicelib/devices/bsim3v32/Makefile.am @@ -8,8 +8,6 @@ libbsim3v32_la_SOURCES = \ b3v32ask.c \ b3v32check.c \ b3v32cvtest.c \ - b3v32del.c \ - b3v32dest.c \ b3v32getic.c \ b3v32ld.c \ b3v32mask.c \ diff --git a/src/spicelib/devices/bsim3v32/b3v32del.c b/src/spicelib/devices/bsim3v32/b3v32del.c deleted file mode 100644 index ccbcd7d58..000000000 --- a/src/spicelib/devices/bsim3v32/b3v32del.c +++ /dev/null @@ -1,25 +0,0 @@ -/**** BSIM3v3.2.4, Released by Xuemei Xi 12/14/2001 ****/ - -/********** - * Copyright 2001 Regents of the University of California. All rights reserved. - * File: b3del.c of BSIM3v3.2.4 - * Author: 1995 Min-Chie Jeng and Mansun Chan - * Author: 1997-1999 Weidong Liu. - * Author: 2001 Xuemei Xi - * Modified by Xuemei Xi, 10/05, 12/14, 2001. - * Modified by Paolo Nenzi 2002 - **********/ - -#include "ngspice/ngspice.h" -#include "bsim3v32def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -BSIM3v32delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim3v32/b3v32dest.c b/src/spicelib/devices/bsim3v32/b3v32dest.c deleted file mode 100644 index 805748613..000000000 --- a/src/spicelib/devices/bsim3v32/b3v32dest.c +++ /dev/null @@ -1,20 +0,0 @@ -/**** BSIM3v3.2.4, Released by Xuemei Xi 12/14/2001 ****/ - -/********** - * Copyright 2001 Regents of the University of California. All rights reserved. - * File: b3dest.c of BSIM3v3.2.4 - * Author: 1995 Min-Chie Jeng and Mansun Chan. - * Author: 1997-1999 Weidong Liu. - * Author: 2001 Xuemei Xi - * Modified by Paolo Nenzi 2002 - **********/ - -#include "ngspice/ngspice.h" -#include "bsim3v32def.h" -#include "ngspice/suffix.h" - - -void -BSIM3v32destroy (void) -{ -} diff --git a/src/spicelib/devices/bsim3v32/bsim3v32ext.h b/src/spicelib/devices/bsim3v32/bsim3v32ext.h index f4c115aea..93978a66e 100644 --- a/src/spicelib/devices/bsim3v32/bsim3v32ext.h +++ b/src/spicelib/devices/bsim3v32/bsim3v32ext.h @@ -9,8 +9,6 @@ File: bsim3ext.h extern int BSIM3v32acLoad(GENmodel *,CKTcircuit*); extern int BSIM3v32ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int BSIM3v32convTest(GENmodel *,CKTcircuit*); -extern int BSIM3v32delete(GENinstance*); -extern void BSIM3v32destroy(void); extern int BSIM3v32getic(GENmodel*,CKTcircuit*); extern int BSIM3v32load(GENmodel*,CKTcircuit*); extern int BSIM3v32mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); diff --git a/src/spicelib/devices/bsim3v32/bsim3v32init.c b/src/spicelib/devices/bsim3v32/bsim3v32init.c index 4863a3e92..207c03e5f 100644 --- a/src/spicelib/devices/bsim3v32/bsim3v32init.c +++ b/src/spicelib/devices/bsim3v32/bsim3v32init.c @@ -42,9 +42,9 @@ SPICEdev BSIM3v32info = { .DEVfindBranch = NULL, .DEVacLoad = BSIM3v32acLoad, .DEVaccept = NULL, - .DEVdestroy = BSIM3v32destroy, + .DEVdestroy = NULL, .DEVmodDelete = BSIM3v32mDelete, - .DEVdelete = BSIM3v32delete, + .DEVdelete = NULL, .DEVsetic = BSIM3v32getic, .DEVask = BSIM3v32ask, .DEVmodAsk = BSIM3v32mAsk, diff --git a/src/spicelib/devices/bsim4/Makefile.am b/src/spicelib/devices/bsim4/Makefile.am index 179c92759..114deb7bb 100644 --- a/src/spicelib/devices/bsim4/Makefile.am +++ b/src/spicelib/devices/bsim4/Makefile.am @@ -8,8 +8,6 @@ libbsim4_la_SOURCES = \ b4ask.c \ b4check.c \ b4cvtest.c \ - b4del.c \ - b4dest.c \ b4geo.c \ b4getic.c \ b4ld.c \ diff --git a/src/spicelib/devices/bsim4/b4del.c b/src/spicelib/devices/bsim4/b4del.c deleted file mode 100644 index a72953039..000000000 --- a/src/spicelib/devices/bsim4/b4del.c +++ /dev/null @@ -1,73 +0,0 @@ -/* ****************************************************************************** - * BSIM4 4.8.1 released by Chetan Kumar Dabhi 2/15/2017 * - * BSIM4 Model Equations * - ****************************************************************************** - - ****************************************************************************** - * Copyright 2017 Regents of the University of California. * - * All rights reserved. * - * * - * Project Director: Prof. Chenming Hu. * - * Authors: Gary W. Ng, Weidong Liu, Xuemei Xi, Mohan Dunga, Wenwei Yang * - * Ali Niknejad, Shivendra Singh Parihar, Chetan Kumar Dabhi * - * Yogesh Singh Chauhan, Sayeef Salahuddin, Chenming Hu * - ****************************************************************************** - - ****************************************************************************** - * CMC In-Code Statement * - * * - * The Developer agrees that the following statement will appear in the * - * model code that has been adopted as a CMC Standard. * - * * - * Software is distributed as is, completely without warranty or service * - * support. The University of California and its employees are not liable * - * for the condition or performance of the software. * - * * - * The University of California owns the copyright and grants users a * - * perpetual, irrevocable, worldwide, non-exclusive, royalty-free license * - * with respect to the software as set forth below. * - * * - * The University of California hereby disclaims all implied warranties. * - * * - * The University of California grants the users the right to modify, * - * copy, and redistribute the software and documentation, both within * - * the user's organization and externally, subject to the following * - * restrictions: * - * * - * 1. The users agree not to charge for the University of California code * - * itself but may charge for additions, extensions, or support. * - * * - * 2. In any product based on the software, the users agree to * - * acknowledge the University of California that developed the * - * software. This acknowledgment shall appear in the product * - * documentation. * - * * - * 3. Redistributions to others of source code and documentation must * - * retain the copyright notice, disclaimer, and list of conditions. * - * * - * 4. Redistributions to others in binary form must reproduce the * - * copyright notice, disclaimer, and list of conditions in the * - * documentation and/or other materials provided with the * - * distribution. * - * * - * Agreed to on ______Feb. 15, 2017______________ * - * * - * By: ____University of California, Berkeley___ * - * ____Chenming Hu__________________________ * - * ____Professor in Graduate School ________ * - * * - ****************************************************************************** */ - -#include "ngspice/ngspice.h" -#include "bsim4def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -BSIM4delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim4/b4dest.c b/src/spicelib/devices/bsim4/b4dest.c deleted file mode 100644 index bb75d330a..000000000 --- a/src/spicelib/devices/bsim4/b4dest.c +++ /dev/null @@ -1,69 +0,0 @@ -/* ****************************************************************************** - * BSIM4 4.8.1 released by Chetan Kumar Dabhi 2/15/2017 * - * BSIM4 Model Equations * - ****************************************************************************** - - ****************************************************************************** - * Copyright 2017 Regents of the University of California. * - * All rights reserved. * - * * - * Project Director: Prof. Chenming Hu. * - * Authors: Gary W. Ng, Weidong Liu, Xuemei Xi, Mohan Dunga, Wenwei Yang * - * Ali Niknejad, Shivendra Singh Parihar, Chetan Kumar Dabhi * - * Yogesh Singh Chauhan, Sayeef Salahuddin, Chenming Hu * - ****************************************************************************** - - ****************************************************************************** - * CMC In-Code Statement * - * * - * The Developer agrees that the following statement will appear in the * - * model code that has been adopted as a CMC Standard. * - * * - * Software is distributed as is, completely without warranty or service * - * support. The University of California and its employees are not liable * - * for the condition or performance of the software. * - * * - * The University of California owns the copyright and grants users a * - * perpetual, irrevocable, worldwide, non-exclusive, royalty-free license * - * with respect to the software as set forth below. * - * * - * The University of California hereby disclaims all implied warranties. * - * * - * The University of California grants the users the right to modify, * - * copy, and redistribute the software and documentation, both within * - * the user's organization and externally, subject to the following * - * restrictions: * - * * - * 1. The users agree not to charge for the University of California code * - * itself but may charge for additions, extensions, or support. * - * * - * 2. In any product based on the software, the users agree to * - * acknowledge the University of California that developed the * - * software. This acknowledgment shall appear in the product * - * documentation. * - * * - * 3. Redistributions to others of source code and documentation must * - * retain the copyright notice, disclaimer, and list of conditions. * - * * - * 4. Redistributions to others in binary form must reproduce the * - * copyright notice, disclaimer, and list of conditions in the * - * documentation and/or other materials provided with the * - * distribution. * - * * - * Agreed to on ______Feb. 15, 2017______________ * - * * - * By: ____University of California, Berkeley___ * - * ____Chenming Hu__________________________ * - * ____Professor in Graduate School ________ * - * * - ****************************************************************************** */ - -#include "ngspice/ngspice.h" -#include "bsim4def.h" -#include "ngspice/suffix.h" - - -void -BSIM4destroy(void) -{ -} diff --git a/src/spicelib/devices/bsim4/bsim4ext.h b/src/spicelib/devices/bsim4/bsim4ext.h index 18653fb30..ac8f623f1 100644 --- a/src/spicelib/devices/bsim4/bsim4ext.h +++ b/src/spicelib/devices/bsim4/bsim4ext.h @@ -61,8 +61,6 @@ extern int BSIM4acLoad(GENmodel *,CKTcircuit*); extern int BSIM4ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int BSIM4convTest(GENmodel *,CKTcircuit*); -extern int BSIM4delete(GENinstance*); -extern void BSIM4destroy(void); extern int BSIM4getic(GENmodel*,CKTcircuit*); extern int BSIM4load(GENmodel*,CKTcircuit*); extern int BSIM4mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); diff --git a/src/spicelib/devices/bsim4/bsim4init.c b/src/spicelib/devices/bsim4/bsim4init.c index 85ac7b60d..f83738858 100644 --- a/src/spicelib/devices/bsim4/bsim4init.c +++ b/src/spicelib/devices/bsim4/bsim4init.c @@ -42,9 +42,9 @@ SPICEdev BSIM4info = { .DEVfindBranch = NULL, .DEVacLoad = BSIM4acLoad, .DEVaccept = NULL, - .DEVdestroy = BSIM4destroy, + .DEVdestroy = NULL, .DEVmodDelete = BSIM4mDelete, - .DEVdelete = BSIM4delete, + .DEVdelete = NULL, .DEVsetic = BSIM4getic, .DEVask = BSIM4ask, .DEVmodAsk = BSIM4mAsk, diff --git a/src/spicelib/devices/bsim4v5/Makefile.am b/src/spicelib/devices/bsim4v5/Makefile.am index 7941bbdd5..d717a241e 100644 --- a/src/spicelib/devices/bsim4v5/Makefile.am +++ b/src/spicelib/devices/bsim4v5/Makefile.am @@ -8,8 +8,6 @@ libbsim4v5_la_SOURCES = \ b4v5ask.c \ b4v5check.c \ b4v5cvtest.c \ - b4v5del.c \ - b4v5dest.c \ b4v5geo.c \ b4v5getic.c \ b4v5ld.c \ diff --git a/src/spicelib/devices/bsim4v5/b4v5del.c b/src/spicelib/devices/bsim4v5/b4v5del.c deleted file mode 100644 index 13624afee..000000000 --- a/src/spicelib/devices/bsim4v5/b4v5del.c +++ /dev/null @@ -1,23 +0,0 @@ -/**** BSIM4.5.0 Released by Xuemei (Jane) Xi 07/29/2005 ****/ - -/********** - * Copyright 2005 Regents of the University of California. All rights reserved. - * File: b4del.c of BSIM4.5.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim4v5def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -BSIM4v5delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim4v5/b4v5dest.c b/src/spicelib/devices/bsim4v5/b4v5dest.c deleted file mode 100644 index 7bfa2b5fd..000000000 --- a/src/spicelib/devices/bsim4v5/b4v5dest.c +++ /dev/null @@ -1,19 +0,0 @@ -/**** BSIM4.5.0 Released by Xuemei (Jane) Xi 07/29/2005 ****/ - -/********** - * Copyright 2005 Regents of the University of California. All rights reserved. - * File: b4dest.c of BSIM4.5.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim4v5def.h" -#include "ngspice/suffix.h" - - -void -BSIM4v5destroy(void) -{ -} diff --git a/src/spicelib/devices/bsim4v5/bsim4v5ext.h b/src/spicelib/devices/bsim4v5/bsim4v5ext.h index 2ef1f38df..1589ba0fc 100644 --- a/src/spicelib/devices/bsim4v5/bsim4v5ext.h +++ b/src/spicelib/devices/bsim4v5/bsim4v5ext.h @@ -8,8 +8,6 @@ File: bsim4v5ext.h extern int BSIM4v5acLoad(GENmodel *,CKTcircuit*); extern int BSIM4v5ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int BSIM4v5convTest(GENmodel *,CKTcircuit*); -extern int BSIM4v5delete(GENinstance*); -extern void BSIM4v5destroy(void); extern int BSIM4v5getic(GENmodel*,CKTcircuit*); extern int BSIM4v5load(GENmodel*,CKTcircuit*); extern int BSIM4v5mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); diff --git a/src/spicelib/devices/bsim4v5/bsim4v5init.c b/src/spicelib/devices/bsim4v5/bsim4v5init.c index 6efef398d..d5f029649 100644 --- a/src/spicelib/devices/bsim4v5/bsim4v5init.c +++ b/src/spicelib/devices/bsim4v5/bsim4v5init.c @@ -42,9 +42,9 @@ SPICEdev BSIM4v5info = { .DEVfindBranch = NULL, .DEVacLoad = BSIM4v5acLoad, .DEVaccept = NULL, - .DEVdestroy = BSIM4v5destroy, + .DEVdestroy = NULL, .DEVmodDelete = BSIM4v5mDelete, - .DEVdelete = BSIM4v5delete, + .DEVdelete = NULL, .DEVsetic = BSIM4v5getic, .DEVask = BSIM4v5ask, .DEVmodAsk = BSIM4v5mAsk, diff --git a/src/spicelib/devices/bsim4v6/Makefile.am b/src/spicelib/devices/bsim4v6/Makefile.am index a8277ad2c..b8036b965 100644 --- a/src/spicelib/devices/bsim4v6/Makefile.am +++ b/src/spicelib/devices/bsim4v6/Makefile.am @@ -8,8 +8,6 @@ libbsim4v6_la_SOURCES = \ b4v6ask.c \ b4v6check.c \ b4v6cvtest.c \ - b4v6del.c \ - b4v6dest.c \ b4v6geo.c \ b4v6getic.c \ b4v6ld.c \ diff --git a/src/spicelib/devices/bsim4v6/b4v6del.c b/src/spicelib/devices/bsim4v6/b4v6del.c deleted file mode 100644 index a165c5783..000000000 --- a/src/spicelib/devices/bsim4v6/b4v6del.c +++ /dev/null @@ -1,25 +0,0 @@ -/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/ - -/********** - * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4del.c of BSIM4.6.2. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. - * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu - * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu - * Project Director: Prof. Chenming Hu. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim4v6def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -BSIM4v6delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim4v6/b4v6dest.c b/src/spicelib/devices/bsim4v6/b4v6dest.c deleted file mode 100644 index 422d2b25f..000000000 --- a/src/spicelib/devices/bsim4v6/b4v6dest.c +++ /dev/null @@ -1,21 +0,0 @@ -/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/ - -/********** - * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4dest.c of BSIM4.6.2. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. - * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu - * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu - * Project Director: Prof. Chenming Hu. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim4v6def.h" -#include "ngspice/suffix.h" - - -void -BSIM4v6destroy(void) -{ -} diff --git a/src/spicelib/devices/bsim4v6/bsim4v6ext.h b/src/spicelib/devices/bsim4v6/bsim4v6ext.h index 00dab9d70..b96b2558d 100644 --- a/src/spicelib/devices/bsim4v6/bsim4v6ext.h +++ b/src/spicelib/devices/bsim4v6/bsim4v6ext.h @@ -8,8 +8,6 @@ File: bsim4v6ext.h extern int BSIM4v6acLoad(GENmodel *,CKTcircuit*); extern int BSIM4v6ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int BSIM4v6convTest(GENmodel *,CKTcircuit*); -extern int BSIM4v6delete(GENinstance*); -extern void BSIM4v6destroy(void); extern int BSIM4v6getic(GENmodel*,CKTcircuit*); extern int BSIM4v6load(GENmodel*,CKTcircuit*); extern int BSIM4v6mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); diff --git a/src/spicelib/devices/bsim4v6/bsim4v6init.c b/src/spicelib/devices/bsim4v6/bsim4v6init.c index 87f08dcd0..8207aa342 100644 --- a/src/spicelib/devices/bsim4v6/bsim4v6init.c +++ b/src/spicelib/devices/bsim4v6/bsim4v6init.c @@ -42,9 +42,9 @@ SPICEdev BSIM4v6info = { .DEVfindBranch = NULL, .DEVacLoad = BSIM4v6acLoad, .DEVaccept = NULL, - .DEVdestroy = BSIM4v6destroy, + .DEVdestroy = NULL, .DEVmodDelete = BSIM4v6mDelete, - .DEVdelete = BSIM4v6delete, + .DEVdelete = NULL, .DEVsetic = BSIM4v6getic, .DEVask = BSIM4v6ask, .DEVmodAsk = BSIM4v6mAsk, diff --git a/src/spicelib/devices/bsim4v7/Makefile.am b/src/spicelib/devices/bsim4v7/Makefile.am index 68ecfc794..5393531b2 100644 --- a/src/spicelib/devices/bsim4v7/Makefile.am +++ b/src/spicelib/devices/bsim4v7/Makefile.am @@ -8,8 +8,6 @@ libbsim4v7_la_SOURCES = \ b4v7ask.c \ b4v7check.c \ b4v7cvtest.c \ - b4v7del.c \ - b4v7dest.c \ b4v7geo.c \ b4v7getic.c \ b4v7ld.c \ diff --git a/src/spicelib/devices/bsim4v7/b4v7del.c b/src/spicelib/devices/bsim4v7/b4v7del.c deleted file mode 100644 index c3cf9d529..000000000 --- a/src/spicelib/devices/bsim4v7/b4v7del.c +++ /dev/null @@ -1,25 +0,0 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ - -/********** - * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4del.c of BSIM4.7.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. - * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu - * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu - * Project Director: Prof. Chenming Hu. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim4v7def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -BSIM4v7delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsim4v7/b4v7dest.c b/src/spicelib/devices/bsim4v7/b4v7dest.c deleted file mode 100644 index 80e02685b..000000000 --- a/src/spicelib/devices/bsim4v7/b4v7dest.c +++ /dev/null @@ -1,21 +0,0 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ - -/********** - * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4dest.c of BSIM4.7.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. - * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu - * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu - * Project Director: Prof. Chenming Hu. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim4v7def.h" -#include "ngspice/suffix.h" - - -void -BSIM4v7destroy(void) -{ -} diff --git a/src/spicelib/devices/bsim4v7/bsim4v7ext.h b/src/spicelib/devices/bsim4v7/bsim4v7ext.h index d09a77819..a09f50e69 100644 --- a/src/spicelib/devices/bsim4v7/bsim4v7ext.h +++ b/src/spicelib/devices/bsim4v7/bsim4v7ext.h @@ -8,8 +8,6 @@ File: bsim4v7ext.h extern int BSIM4v7acLoad(GENmodel *,CKTcircuit*); extern int BSIM4v7ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int BSIM4v7convTest(GENmodel *,CKTcircuit*); -extern int BSIM4v7delete(GENinstance*); -extern void BSIM4v7destroy(void); extern int BSIM4v7getic(GENmodel*,CKTcircuit*); extern int BSIM4v7load(GENmodel*,CKTcircuit*); extern int BSIM4v7mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); diff --git a/src/spicelib/devices/bsim4v7/bsim4v7init.c b/src/spicelib/devices/bsim4v7/bsim4v7init.c index 3be3e43b2..e74a86a27 100644 --- a/src/spicelib/devices/bsim4v7/bsim4v7init.c +++ b/src/spicelib/devices/bsim4v7/bsim4v7init.c @@ -53,9 +53,9 @@ SPICEdev BSIM4v7info = { .DEVfindBranch = NULL, .DEVacLoad = BSIM4v7acLoad, .DEVaccept = NULL, - .DEVdestroy = BSIM4v7destroy, + .DEVdestroy = NULL, .DEVmodDelete = BSIM4v7mDelete, - .DEVdelete = BSIM4v7delete, + .DEVdelete = NULL, .DEVsetic = BSIM4v7getic, .DEVask = BSIM4v7ask, .DEVmodAsk = BSIM4v7mAsk, diff --git a/src/spicelib/devices/bsimsoi/Makefile.am b/src/spicelib/devices/bsimsoi/Makefile.am index 7ef42475a..e165ce15f 100644 --- a/src/spicelib/devices/bsimsoi/Makefile.am +++ b/src/spicelib/devices/bsimsoi/Makefile.am @@ -8,8 +8,6 @@ libbsim4soi_la_SOURCES = \ b4soiask.c \ b4soicheck.c \ b4soicvtest.c \ - b4soidel.c \ - b4soidest.c \ b4soigetic.c \ b4soild.c \ b4soimask.c \ diff --git a/src/spicelib/devices/bsimsoi/b4soidel.c b/src/spicelib/devices/bsimsoi/b4soidel.c deleted file mode 100644 index 73bc29d14..000000000 --- a/src/spicelib/devices/bsimsoi/b4soidel.c +++ /dev/null @@ -1,28 +0,0 @@ -/*** B4SOI 12/16/2010 Released by Tanvir Morshed ***/ - -/********** - * Copyright 2010 Regents of the University of California. All rights reserved. - * Authors: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang - * Authors: 1999-2004 Pin Su, Hui Wan, Wei Jin, b3soidel.c - * Authors: 2005- Hui Wan, Xuemei Xi, Ali Niknejad, Chenming Hu. - * Authors: 2009- Wenwei Yang, Chung-Hsun Lin, Ali Niknejad, Chenming Hu. - * File: b4soidel.c - * Modified by Hui Wan, Xuemei Xi 11/30/2005 - * Modified by Wenwei Yang, Chung-Hsun Lin, Darsen Lu 03/06/2009 - * Modified by Tanvir Morshed 09/22/2009 - * Modified by Tanvir Morshed 12/31/2009 - **********/ - -#include "ngspice/ngspice.h" -#include "b4soidef.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -B4SOIdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/bsimsoi/b4soidest.c b/src/spicelib/devices/bsimsoi/b4soidest.c deleted file mode 100644 index afa8a63b4..000000000 --- a/src/spicelib/devices/bsimsoi/b4soidest.c +++ /dev/null @@ -1,25 +0,0 @@ -/*** B4SOI 12/16/2010 Released by Tanvir Morshed ***/ - - -/********** - * Copyright 2010 Regents of the University of California. All rights reserved. - * Authors: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang - * Authors: 1999-2004 Pin Su, Hui Wan, Wei Jin, b3soidest.c - * Authors: 2005- Hui Wan, Xuemei Xi, Ali Niknejad, Chenming Hu. - * Authors: 2009- Wenwei Yang, Chung-Hsun Lin, Ali Niknejad, Chenming Hu. - * File: b4soidest.c - * Modified by Hui Wan, Xuemei Xi 11/30/2005 - * Modified by Wenwei Yang, Chung-Hsun Lin, Darsen Lu 03/06/2009 - * Modified by Tanvir Morshed 09/22/2009 - * Modified by Tanvir Morshed 12/31/2009 - **********/ - -#include "ngspice/ngspice.h" -#include "b4soidef.h" -#include "ngspice/suffix.h" - - -void -B4SOIdestroy(void) -{ -} diff --git a/src/spicelib/devices/bsimsoi/b4soiext.h b/src/spicelib/devices/bsimsoi/b4soiext.h index 429647045..6dd798fe9 100644 --- a/src/spicelib/devices/bsimsoi/b4soiext.h +++ b/src/spicelib/devices/bsimsoi/b4soiext.h @@ -10,8 +10,6 @@ File: b4soiext.h extern int B4SOIacLoad(GENmodel *,CKTcircuit*); extern int B4SOIask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int B4SOIconvTest(GENmodel *,CKTcircuit*); -extern int B4SOIdelete(GENinstance*); -extern void B4SOIdestroy(void); extern int B4SOIgetic(GENmodel*,CKTcircuit*); extern int B4SOIload(GENmodel*,CKTcircuit*); extern int B4SOImAsk(CKTcircuit*,GENmodel *,int, IFvalue*); diff --git a/src/spicelib/devices/bsimsoi/b4soiinit.c b/src/spicelib/devices/bsimsoi/b4soiinit.c index 6a0c8d709..6e37d883a 100644 --- a/src/spicelib/devices/bsimsoi/b4soiinit.c +++ b/src/spicelib/devices/bsimsoi/b4soiinit.c @@ -40,9 +40,9 @@ SPICEdev B4SOIinfo = { .DEVfindBranch = NULL, .DEVacLoad = B4SOIacLoad, .DEVaccept = NULL, - .DEVdestroy = B4SOIdestroy, + .DEVdestroy = NULL, .DEVmodDelete = B4SOImDelete, - .DEVdelete = B4SOIdelete, + .DEVdelete = NULL, .DEVsetic = B4SOIgetic, .DEVask = B4SOIask, .DEVmodAsk = B4SOImAsk, diff --git a/src/spicelib/devices/cap/Makefile.am b/src/spicelib/devices/cap/Makefile.am index 7c27231bf..0f231b6c3 100644 --- a/src/spicelib/devices/cap/Makefile.am +++ b/src/spicelib/devices/cap/Makefile.am @@ -7,8 +7,6 @@ libcap_la_SOURCES = \ capacld.c \ capask.c \ capdefs.h \ - capdel.c \ - capdest.c \ capext.h \ capgetic.c \ capinit.c \ @@ -16,7 +14,6 @@ libcap_la_SOURCES = \ capitf.h \ capload.c \ capmask.c \ - capmdel.c \ capmpar.c \ capparam.c \ cappzld.c \ diff --git a/src/spicelib/devices/cap/capdefs.h b/src/spicelib/devices/cap/capdefs.h index 604f6d40e..42ff915ef 100644 --- a/src/spicelib/devices/cap/capdefs.h +++ b/src/spicelib/devices/cap/capdefs.h @@ -75,9 +75,14 @@ typedef struct sCAPinstance { #define CAPqcap CAPstate /* charge on the capacitor */ #define CAPccap CAPstate+1 /* current through the capacitor */ + +#define CAPnumStates 2 + #define CAPsensxp CAPstate+2 /* charge sensitivities and their derivatives. -+3 for the derivatives - pointer to the -beginning of the array */ + * +3 for the derivatives - pointer to the + * beginning of the array */ + +#define CAPnumSenStates 2 #ifdef USE_CUSPICE typedef struct sCAPparamCPUstruct { diff --git a/src/spicelib/devices/cap/capdel.c b/src/spicelib/devices/cap/capdel.c deleted file mode 100644 index 20d5187c2..000000000 --- a/src/spicelib/devices/cap/capdel.c +++ /dev/null @@ -1,18 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -Modified: September 2003 Paolo Nenzi -**********/ - -#include "ngspice/ngspice.h" -#include "capdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -CAPdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/cap/capdest.c b/src/spicelib/devices/cap/capdest.c deleted file mode 100644 index 36d28510f..000000000 --- a/src/spicelib/devices/cap/capdest.c +++ /dev/null @@ -1,15 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -Modified: September 2003 Paolo Nenzi -**********/ - -#include "ngspice/ngspice.h" -#include "capdefs.h" -#include "ngspice/suffix.h" - - -void -CAPdestroy(void) -{ -} diff --git a/src/spicelib/devices/cap/capext.h b/src/spicelib/devices/cap/capext.h index b0bbd8df7..eb620a6a1 100644 --- a/src/spicelib/devices/cap/capext.h +++ b/src/spicelib/devices/cap/capext.h @@ -5,12 +5,9 @@ Author: 1985 Thomas L. Quarles extern int CAPacLoad(GENmodel*,CKTcircuit*); extern int CAPask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int CAPdelete(GENinstance*); -extern void CAPdestroy(void); extern int CAPgetic(GENmodel*,CKTcircuit*); extern int CAPload(GENmodel*,CKTcircuit*); extern int CAPmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int CAPmDelete(GENmodel*); extern int CAPmParam(int,IFvalue*,GENmodel*); extern int CAPparam(int,IFvalue*,GENinstance*,IFvalue*); extern int CAPpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/cap/capinit.c b/src/spicelib/devices/cap/capinit.c index 34f1f5944..48197d343 100644 --- a/src/spicelib/devices/cap/capinit.c +++ b/src/spicelib/devices/cap/capinit.c @@ -53,9 +53,9 @@ SPICEdev CAPinfo = { .DEVfindBranch = NULL, .DEVacLoad = CAPacLoad, .DEVaccept = NULL, - .DEVdestroy = CAPdestroy, - .DEVmodDelete = CAPmDelete, - .DEVdelete = CAPdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = CAPgetic, .DEVask = CAPask, .DEVmodAsk = CAPmAsk, diff --git a/src/spicelib/devices/cap/capmdel.c b/src/spicelib/devices/cap/capmdel.c deleted file mode 100644 index 90f916d0c..000000000 --- a/src/spicelib/devices/cap/capmdel.c +++ /dev/null @@ -1,18 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -Modified: Spetember 2003 Paolo Nenzi -**********/ - -#include "ngspice/ngspice.h" -#include "capdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -CAPmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/cap/capsetup.c b/src/spicelib/devices/cap/capsetup.c index d6d91ef9b..c343a5aa0 100644 --- a/src/spicelib/devices/cap/capsetup.c +++ b/src/spicelib/devices/cap/capsetup.c @@ -103,9 +103,9 @@ CAPsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } here->CAPqcap = *states; - *states += 2; + *states += CAPnumStates; if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & TRANSEN) ){ - *states += 2 * (ckt->CKTsenInfo->SENparms); + *states += CAPnumSenStates * (ckt->CKTsenInfo->SENparms); } /* macro to make elements with built in test for out of memory */ diff --git a/src/spicelib/devices/cccs/Makefile.am b/src/spicelib/devices/cccs/Makefile.am index 57c62b60a..95cecfcbe 100644 --- a/src/spicelib/devices/cccs/Makefile.am +++ b/src/spicelib/devices/cccs/Makefile.am @@ -6,14 +6,11 @@ libcccs_la_SOURCES = \ cccs.c \ cccsask.c \ cccsdefs.h \ - cccsdel.c \ - cccsdest.c \ cccsext.h \ cccsinit.c \ cccsinit.h \ cccsitf.h \ cccsload.c \ - cccsmdel.c \ cccspar.c \ cccspzld.c \ cccssacl.c \ diff --git a/src/spicelib/devices/cccs/cccsdel.c b/src/spicelib/devices/cccs/cccsdel.c deleted file mode 100644 index 2af308407..000000000 --- a/src/spicelib/devices/cccs/cccsdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "cccsdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -CCCSdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/cccs/cccsdest.c b/src/spicelib/devices/cccs/cccsdest.c deleted file mode 100644 index f43af0291..000000000 --- a/src/spicelib/devices/cccs/cccsdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "cccsdefs.h" -#include "ngspice/suffix.h" - - -void -CCCSdestroy(void) -{ -} diff --git a/src/spicelib/devices/cccs/cccsext.h b/src/spicelib/devices/cccs/cccsext.h index e66f94d0e..68e1111b3 100644 --- a/src/spicelib/devices/cccs/cccsext.h +++ b/src/spicelib/devices/cccs/cccsext.h @@ -5,10 +5,7 @@ Author: 1985 Thomas L. Quarles extern int CCCSask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int CCCSdelete(GENinstance*); -extern void CCCSdestroy(void); extern int CCCSload(GENmodel*,CKTcircuit*); -extern int CCCSmDelete(GENmodel*); extern int CCCSparam(int,IFvalue*,GENinstance*,IFvalue*); extern int CCCSpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int CCCSsAcLoad(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/cccs/cccsinit.c b/src/spicelib/devices/cccs/cccsinit.c index 7d323efd0..5b20410f3 100644 --- a/src/spicelib/devices/cccs/cccsinit.c +++ b/src/spicelib/devices/cccs/cccsinit.c @@ -42,9 +42,9 @@ SPICEdev CCCSinfo = { .DEVfindBranch = NULL, .DEVacLoad = CCCSload, .DEVaccept = NULL, - .DEVdestroy = CCCSdestroy, - .DEVmodDelete = CCCSmDelete, - .DEVdelete = CCCSdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = CCCSask, .DEVmodAsk = NULL, diff --git a/src/spicelib/devices/cccs/cccsmdel.c b/src/spicelib/devices/cccs/cccsmdel.c deleted file mode 100644 index a4b2e2c1d..000000000 --- a/src/spicelib/devices/cccs/cccsmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "cccsdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -CCCSmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/ccvs/Makefile.am b/src/spicelib/devices/ccvs/Makefile.am index 0faa88b17..5fd522d69 100644 --- a/src/spicelib/devices/ccvs/Makefile.am +++ b/src/spicelib/devices/ccvs/Makefile.am @@ -6,15 +6,12 @@ libccvs_la_SOURCES = \ ccvs.c \ ccvsask.c \ ccvsdefs.h \ - ccvsdel.c \ - ccvsdest.c \ ccvsext.h \ ccvsfbr.c \ ccvsinit.c \ ccvsinit.h \ ccvsitf.h \ ccvsload.c \ - ccvsmdel.c \ ccvspar.c \ ccvspzld.c \ ccvssacl.c \ diff --git a/src/spicelib/devices/ccvs/ccvsdel.c b/src/spicelib/devices/ccvs/ccvsdel.c deleted file mode 100644 index 7f5dba9fe..000000000 --- a/src/spicelib/devices/ccvs/ccvsdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "ccvsdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -CCVSdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/ccvs/ccvsdest.c b/src/spicelib/devices/ccvs/ccvsdest.c deleted file mode 100644 index e8fa2e8af..000000000 --- a/src/spicelib/devices/ccvs/ccvsdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "ccvsdefs.h" -#include "ngspice/suffix.h" - - -void -CCVSdestroy(void) -{ -} diff --git a/src/spicelib/devices/ccvs/ccvsext.h b/src/spicelib/devices/ccvs/ccvsext.h index eb551ee36..b42cbb054 100644 --- a/src/spicelib/devices/ccvs/ccvsext.h +++ b/src/spicelib/devices/ccvs/ccvsext.h @@ -4,11 +4,8 @@ Author: 1985 Thomas L. Quarles **********/ extern int CCVSask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int CCVSdelete(GENinstance*); -extern void CCVSdestroy(void); extern int CCVSfindBr(CKTcircuit*,GENmodel*,IFuid); extern int CCVSload(GENmodel*,CKTcircuit*); -extern int CCVSmDelete(GENmodel*); extern int CCVSparam(int,IFvalue*,GENinstance*,IFvalue*); extern int CCVSpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int CCVSsAcLoad(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/ccvs/ccvsinit.c b/src/spicelib/devices/ccvs/ccvsinit.c index 5d4bdffd1..edd5dc573 100644 --- a/src/spicelib/devices/ccvs/ccvsinit.c +++ b/src/spicelib/devices/ccvs/ccvsinit.c @@ -42,9 +42,9 @@ SPICEdev CCVSinfo = { .DEVfindBranch = CCVSfindBr, .DEVacLoad = CCVSload, .DEVaccept = NULL, - .DEVdestroy = CCVSdestroy, - .DEVmodDelete = CCVSmDelete, - .DEVdelete = CCVSdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = CCVSask, .DEVmodAsk = NULL, diff --git a/src/spicelib/devices/ccvs/ccvsmdel.c b/src/spicelib/devices/ccvs/ccvsmdel.c deleted file mode 100644 index a829e5198..000000000 --- a/src/spicelib/devices/ccvs/ccvsmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "ccvsdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -CCVSmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/cpl/Makefile.am b/src/spicelib/devices/cpl/Makefile.am index 4ae92e8f6..8d12c0604 100644 --- a/src/spicelib/devices/cpl/Makefile.am +++ b/src/spicelib/devices/cpl/Makefile.am @@ -6,14 +6,11 @@ libcpl_la_SOURCES = \ cpl.c \ cplask.c \ cpldefs.h \ - cpldest.c \ cplext.h \ cplinit.h \ cplitf.h \ cplmask.c \ - cplmdel.c \ cplparam.c \ - cpldel.c \ cplload.c \ cplmpar.c \ cplsetup.c \ diff --git a/src/spicelib/devices/cpl/cpldel.c b/src/spicelib/devices/cpl/cpldel.c deleted file mode 100644 index ebb192cc8..000000000 --- a/src/spicelib/devices/cpl/cpldel.c +++ /dev/null @@ -1,18 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights -reserved. -Author: 1992 Charles Hough -**********/ - -#include "ngspice/ngspice.h" -#include "cpldefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -CPLdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/cpl/cpldest.c b/src/spicelib/devices/cpl/cpldest.c deleted file mode 100644 index 7200aee79..000000000 --- a/src/spicelib/devices/cpl/cpldest.c +++ /dev/null @@ -1,15 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights -reserved. -Author: 1992 Charles Hough -**********/ - -#include "ngspice/ngspice.h" -#include "cpldefs.h" -#include "ngspice/suffix.h" - - -void -CPLdestroy(void) -{ -} diff --git a/src/spicelib/devices/cpl/cplext.h b/src/spicelib/devices/cpl/cplext.h index de4129db2..f69e42418 100644 --- a/src/spicelib/devices/cpl/cplext.h +++ b/src/spicelib/devices/cpl/cplext.h @@ -5,11 +5,8 @@ reserved. /* extern int CPLaccept(CKTcircuit*, GENmodel*); */ extern int CPLask(CKTcircuit*, GENinstance*, int, IFvalue*, IFvalue*); -extern int CPLdelete(GENinstance*); -extern void CPLdestroy(void); extern int CPLload(GENmodel*, CKTcircuit*); extern int CPLmAsk(CKTcircuit*, GENmodel*, int, IFvalue*); -extern int CPLmDelete(GENmodel*); extern int CPLmParam(int,IFvalue*, GENmodel*); extern int CPLparam(int,IFvalue*, GENinstance*, IFvalue*); extern int CPLsetup(SMPmatrix*, GENmodel*, CKTcircuit*, int*); diff --git a/src/spicelib/devices/cpl/cplinit.c b/src/spicelib/devices/cpl/cplinit.c index dea3b58b2..9b0accb6c 100644 --- a/src/spicelib/devices/cpl/cplinit.c +++ b/src/spicelib/devices/cpl/cplinit.c @@ -42,9 +42,9 @@ SPICEdev CPLinfo = { .DEVfindBranch = NULL, .DEVacLoad = NULL, .DEVaccept = NULL, - .DEVdestroy = CPLdestroy, - .DEVmodDelete = CPLmDelete, - .DEVdelete = CPLdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = CPLask, .DEVmodAsk = CPLmAsk, diff --git a/src/spicelib/devices/cpl/cplmdel.c b/src/spicelib/devices/cpl/cplmdel.c deleted file mode 100644 index d1e1cfa1f..000000000 --- a/src/spicelib/devices/cpl/cplmdel.c +++ /dev/null @@ -1,19 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights -reserved. -Author: 1992 Charles Hough -**********/ - - -#include "ngspice/ngspice.h" -#include "cpldefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -CPLmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/csw/Makefile.am b/src/spicelib/devices/csw/Makefile.am index c2886f90d..591697a4f 100644 --- a/src/spicelib/devices/csw/Makefile.am +++ b/src/spicelib/devices/csw/Makefile.am @@ -7,15 +7,12 @@ libcsw_la_SOURCES = \ cswacld.c \ cswask.c \ cswdefs.h \ - cswdel.c \ - cswdest.c \ cswext.h \ cswinit.c \ cswinit.h \ cswitf.h \ cswload.c \ cswmask.c \ - cswmdel.c \ cswmpar.c \ cswnoise.c \ cswparam.c \ diff --git a/src/spicelib/devices/csw/csw.c b/src/spicelib/devices/csw/csw.c index c257e12e9..47bc335fb 100644 --- a/src/spicelib/devices/csw/csw.c +++ b/src/spicelib/devices/csw/csw.c @@ -9,24 +9,25 @@ Author: 1987 Thomas L. Quarles #include "cswdefs.h" #include "ngspice/suffix.h" -IFparm CSWpTable[] = { /* parameters */ - IOP( "control",CSW_CONTROL, IF_INSTANCE, "Name of controlling source"), - IP( "on", CSW_IC_ON, IF_FLAG , "Initially closed"), - IP( "off", CSW_IC_OFF, IF_FLAG , "Initially open"), - OPU( "pos_node",CSW_POS_NODE,IF_INTEGER, "Positive node of switch"), - OPU( "neg_node",CSW_NEG_NODE,IF_INTEGER, "Negative node of switch"), - OP( "i" ,CSW_CURRENT, IF_REAL, "Switch current"), - OP( "p" ,CSW_POWER, IF_REAL, "Instantaneous power") + +IFparm CSWpTable[] = { /* parameters */ + IOP("control", CSW_CONTROL, IF_INSTANCE, "Name of controlling source"), + IP("on", CSW_IC_ON, IF_FLAG, "Initially closed"), + IP("off", CSW_IC_OFF, IF_FLAG, "Initially open"), + OPU("pos_node", CSW_POS_NODE, IF_INTEGER, "Positive node of switch"), + OPU("neg_node", CSW_NEG_NODE, IF_INTEGER, "Negative node of switch"), + OP("i", CSW_CURRENT, IF_REAL, "Switch current"), + OP("p", CSW_POWER, IF_REAL, "Instantaneous power") }; IFparm CSWmPTable[] = { /* model parameters */ - IOPU( "csw", CSW_CSW, IF_FLAG, "Current controlled switch model"), - IOPU( "it", CSW_ITH, IF_REAL, "Threshold current"), - IOPU( "ih", CSW_IHYS, IF_REAL, "Hysterisis current"), - IOPU( "ron", CSW_RON, IF_REAL, "Closed resistance"), - IOPU( "roff", CSW_ROFF, IF_REAL, "Open resistance"), - OPU( "gon", CSW_GON, IF_REAL, "Closed conductance"), - OPU( "goff", CSW_GOFF, IF_REAL, "Open conductance") + IOPU("csw", CSW_CSW, IF_FLAG, "Current controlled switch model"), + IOPU("it", CSW_ITH, IF_REAL, "Threshold current"), + IOPU("ih", CSW_IHYS, IF_REAL, "Hysterisis current"), + IOPU("ron", CSW_RON, IF_REAL, "Closed resistance"), + IOPU("roff", CSW_ROFF, IF_REAL, "Open resistance"), + OPU("gon", CSW_GON, IF_REAL, "Closed conductance"), + OPU("goff", CSW_GOFF, IF_REAL, "Open conductance") }; char *CSWnames[] = { @@ -34,8 +35,8 @@ char *CSWnames[] = { "W-" }; -int CSWnSize = NUMELEMS(CSWnames); -int CSWpTSize = NUMELEMS(CSWpTable); -int CSWmPTSize = NUMELEMS(CSWmPTable); -int CSWiSize = sizeof(CSWinstance); -int CSWmSize = sizeof(CSWmodel); +int CSWnSize = NUMELEMS(CSWnames); +int CSWpTSize = NUMELEMS(CSWpTable); +int CSWmPTSize = NUMELEMS(CSWmPTable); +int CSWiSize = sizeof(CSWinstance); +int CSWmSize = sizeof(CSWmodel); diff --git a/src/spicelib/devices/csw/cswacld.c b/src/spicelib/devices/csw/cswacld.c index 844021ea9..e9e21fada 100644 --- a/src/spicelib/devices/csw/cswacld.c +++ b/src/spicelib/devices/csw/cswacld.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs **********/ -/* - */ #include "ngspice/ngspice.h" #include "ngspice/cktdefs.h" @@ -14,33 +12,24 @@ Author: 1985 Gordon Jacobs int CSWacLoad(GENmodel *inModel, CKTcircuit *ckt) - - /* load the current values into the - * sparse matrix previously provided - * during AC analysis - */ { - CSWmodel *model = (CSWmodel*)inModel; + CSWmodel *model = (CSWmodel *) inModel; CSWinstance *here; double g_now; int current_state; - /* loop through all the switch models */ - for( ; model != NULL; model = CSWnextModel(model)) { + for (; model; model = CSWnextModel(model)) + for (here = CSWinstances(model); here; here = CSWnextInstance(here)) { - /* loop through all the instances of the model */ - for (here = CSWinstances(model); here != NULL ; - here=CSWnextInstance(here)) { + current_state = (int) ckt->CKTstate0[here->CSWswitchstate]; - current_state = (int)*(ckt->CKTstate0 + here->CSWstate); - - g_now = current_state?(model->CSWonConduct):(model->CSWoffConduct); + g_now = current_state ? model->CSWonConduct : model->CSWoffConduct; *(here->CSWposPosPtr) += g_now; *(here->CSWposNegPtr) -= g_now; *(here->CSWnegPosPtr) -= g_now; *(here->CSWnegNegPtr) += g_now; } - } - return(OK); + + return OK; } diff --git a/src/spicelib/devices/csw/cswask.c b/src/spicelib/devices/csw/cswask.c index 56b2de2ae..104c8920c 100644 --- a/src/spicelib/devices/csw/cswask.c +++ b/src/spicelib/devices/csw/cswask.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1987 Thomas L. Quarles **********/ -/* - */ /* * This routine gives access to the internal device parameters @@ -19,53 +17,53 @@ Author: 1987 Thomas L. Quarles #include "ngspice/suffix.h" -/* ARGSUSED */ int CSWask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *select) { - CSWinstance *here = (CSWinstance*)inst; + CSWinstance *here = (CSWinstance *) inst; static char *msg = "Current and power not available in ac analysis"; NG_IGNORE(select); - switch(which) { - case CSW_CONTROL: - value->uValue = here->CSWcontName; - return (OK); - case CSW_POS_NODE: - value->iValue = here->CSWposNode; - return (OK); - case CSW_NEG_NODE: - value->iValue = here->CSWnegNode; - return (OK); - case CSW_CURRENT: - if (ckt->CKTcurrentAnalysis & DOING_AC) { - errMsg = TMALLOC(char, strlen(msg) + 1); - errRtn = "CSWask"; - strcpy(errMsg,msg); - return(E_ASKCURRENT); - } else { - value->rValue = (*(ckt->CKTrhsOld+here->CSWposNode) - - *(ckt->CKTrhsOld + here->CSWnegNode)) * - here->CSWcond; - } - return(OK); - case CSW_POWER: - if (ckt->CKTcurrentAnalysis & DOING_AC) { - errMsg = TMALLOC(char, strlen(msg) + 1); - errRtn = "CSWask"; - strcpy(errMsg,msg); - return(E_ASKPOWER); - } else { - value->rValue = (*(ckt->CKTrhsOld+here->CSWposNode) - - *(ckt->CKTrhsOld + here->CSWnegNode)) * - (*(ckt->CKTrhsOld + here->CSWposNode) - - *(ckt->CKTrhsOld + here->CSWnegNode)) * - here->CSWcond; - } - return(OK); - default: - return (E_BADPARM); + switch (which) { + case CSW_CONTROL: + value->uValue = here->CSWcontName; + return OK; + case CSW_POS_NODE: + value->iValue = here->CSWposNode; + return OK; + case CSW_NEG_NODE: + value->iValue = here->CSWnegNode; + return OK; + case CSW_CURRENT: + if (ckt->CKTcurrentAnalysis & DOING_AC) { + errMsg = TMALLOC(char, strlen(msg) + 1); + errRtn = "CSWask"; + strcpy(errMsg, msg); + return E_ASKCURRENT; + } else { + value->rValue = + (ckt->CKTrhsOld[here->CSWposNode] - + ckt->CKTrhsOld[here->CSWnegNode]) * + here->CSWcond; + } + return OK; + case CSW_POWER: + if (ckt->CKTcurrentAnalysis & DOING_AC) { + errMsg = TMALLOC(char, strlen(msg) + 1); + errRtn = "CSWask"; + strcpy(errMsg, msg); + return E_ASKPOWER; + } else { + value->rValue = + (ckt->CKTrhsOld[here->CSWposNode] - + ckt->CKTrhsOld[here->CSWnegNode]) * + (ckt->CKTrhsOld[here->CSWposNode] - + ckt->CKTrhsOld[here->CSWnegNode]) * + here->CSWcond; + } + return OK; + default: + return E_BADPARM; } - /* NOTREACHED */ } diff --git a/src/spicelib/devices/csw/cswdefs.h b/src/spicelib/devices/csw/cswdefs.h index 722b68ce7..4e97562bd 100644 --- a/src/spicelib/devices/csw/cswdefs.h +++ b/src/spicelib/devices/csw/cswdefs.h @@ -13,7 +13,7 @@ Modified: 2000 AlansFixes #include "ngspice/noisedef.h" #include "ngspice/complex.h" - /* structures used to describe current controlled switches */ +/* structures used to describe current controlled switches */ /* information to describe each instance */ @@ -27,44 +27,48 @@ typedef struct sCSWinstance { #define CSWname gen.GENname #define CSWstate gen.GENstate - const int CSWposNode; /* number of positive node of switch */ - const int CSWnegNode; /* number of negative node of switch */ - int CSWcontBranch; /* number of branch of controlling current */ + const int CSWposNode; /* number of positive node of switch */ + const int CSWnegNode; /* number of negative node of switch */ + int CSWcontBranch; /* number of branch of controlling current */ - IFuid CSWcontName; /* name of controlling source */ + IFuid CSWcontName; /* name of controlling source */ double *CSWposPosPtr; /* pointer to sparse matrix diagonal at - (positive,positive) for switch conductance */ + (positive,positive) for switch conductance */ double *CSWnegPosPtr; /* pointer to sparse matrix offdiagonal at - (neagtive,positive) for switch conductance */ + (neagtive,positive) for switch conductance */ double *CSWposNegPtr; /* pointer to sparse matrix offdiagonal at - (positive,neagtive) for switch conductance */ + (positive,neagtive) for switch conductance */ double *CSWnegNegPtr; /* pointer to sparse matrix diagonal at - (neagtive,neagtive) for switch conductance */ + (neagtive,neagtive) for switch conductance */ - double CSWcond; /* current conductance of switch */ + double CSWcond; /* current conductance of switch */ unsigned CSWzero_stateGiven : 1; /* flag to indicate initial state */ #ifndef NONOISE double CSWnVar[NSTATVARS]; -#else /* NONOISE */ - double *CSWnVar; -#endif /* NONOISE */ - -#ifdef KLU - BindElement *CSWposPosBinding ; - BindElement *CSWposNegBinding ; - BindElement *CSWnegPosBinding ; - BindElement *CSWnegNegBinding ; +#else + double *CSWnVar; #endif -} CSWinstance ; +#ifdef KLU + BindElement *CSWposPosBinding; + BindElement *CSWposNegBinding; + BindElement *CSWnegPosBinding; + BindElement *CSWnegNegBinding; +#endif + +} CSWinstance; /* data per model */ #define CSW_ON_CONDUCTANCE 1.0 /* default on conductance = 1 mho */ #define CSW_OFF_CONDUCTANCE ckt->CKTgmin /* default off conductance */ -#define CSW_NUM_STATES 2 +#define CSW_NUM_STATES 2 + +#define CSWswitchstate CSWstate+0 +#define CSWctrlvalue CSWstate+1 + typedef struct sCSWmodel { /* model structure for a switch */ @@ -72,7 +76,7 @@ typedef struct sCSWmodel { /* model structure for a switch */ #define CSWmodType gen.GENmodType #define CSWnextModel(inst) ((struct sCSWmodel *)((inst)->gen.GENnextModel)) -#define CSWinstances(inst) ((CSWinstance *)((inst)->gen.GENinstances)) +#define CSWinstances(inst) ((CSWinstance *) ((inst)->gen.GENinstances)) #define CSWmodName gen.GENmodName double CSWonResistance; /* switch "on" resistance */ @@ -82,10 +86,10 @@ typedef struct sCSWmodel { /* model structure for a switch */ double CSWonConduct; /* switch "on" conductance */ double CSWoffConduct; /* switch "off" conductance */ - unsigned CSWonGiven : 1; /* flag to indicate on-resistance was specified */ - unsigned CSWoffGiven : 1;/* flag to indicate off-resistance was " */ - unsigned CSWthreshGiven : 1;/* flag to indicate threshold volt was given */ - unsigned CSWhystGiven : 1; /* flag to indicate hysteresis volt was given */ + unsigned CSWonGiven : 1; /* flag to indicate on-resistance was specified */ + unsigned CSWoffGiven : 1; /* flag to indicate off-resistance was " */ + unsigned CSWthreshGiven : 1; /* flag to indicate threshold volt was given */ + unsigned CSWhystGiven : 1; /* flag to indicate hysteresis volt was given */ } CSWmodel; /* device parameters */ @@ -112,4 +116,4 @@ typedef struct sCSWmodel { /* model structure for a switch */ #include "cswext.h" -#endif /*CSW*/ +#endif diff --git a/src/spicelib/devices/csw/cswdel.c b/src/spicelib/devices/csw/cswdel.c deleted file mode 100644 index f83042b0c..000000000 --- a/src/spicelib/devices/csw/cswdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Gordon Jacobs -**********/ - -#include "ngspice/ngspice.h" -#include "cswdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -CSWdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/csw/cswdest.c b/src/spicelib/devices/csw/cswdest.c deleted file mode 100644 index a64f831e3..000000000 --- a/src/spicelib/devices/csw/cswdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Gordon Jacobs -**********/ - -#include "ngspice/ngspice.h" -#include "cswdefs.h" -#include "ngspice/suffix.h" - - -void -CSWdestroy(void) -{ -} diff --git a/src/spicelib/devices/csw/cswext.h b/src/spicelib/devices/csw/cswext.h index 0f81b1e10..d6d456c4c 100644 --- a/src/spicelib/devices/csw/cswext.h +++ b/src/spicelib/devices/csw/cswext.h @@ -4,22 +4,19 @@ Author: 1985 Gordon M. Jacobs Modified: 2000 AlansFixes **********/ -extern int CSWask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int CSWacLoad(GENmodel*,CKTcircuit*); -extern int CSWdelete(GENinstance*); -extern void CSWdestroy(void); -extern int CSWload(GENmodel*,CKTcircuit*); -extern int CSWmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int CSWmDelete(GENmodel*); -extern int CSWmParam(int,IFvalue*,GENmodel*); -extern int CSWparam(int,IFvalue*,GENinstance*,IFvalue*); -extern int CSWpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); -extern int CSWsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); -extern int CSWnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); -extern int CSWtrunc(GENmodel*,CKTcircuit*,double*); +extern int CSWask(CKTcircuit *, GENinstance *, int, IFvalue *, IFvalue *); +extern int CSWacLoad(GENmodel *, CKTcircuit *); +extern int CSWload(GENmodel *, CKTcircuit *); +extern int CSWmAsk(CKTcircuit *, GENmodel *, int, IFvalue *); +extern int CSWmParam(int, IFvalue *, GENmodel *); +extern int CSWparam(int, IFvalue *, GENinstance *, IFvalue *); +extern int CSWpzLoad(GENmodel *, CKTcircuit *, SPcomplex *); +extern int CSWsetup(SMPmatrix *, GENmodel *, CKTcircuit *, int *); +extern int CSWnoise(int, int, GENmodel *, CKTcircuit *, Ndata *, double *); +extern int CSWtrunc(GENmodel *, CKTcircuit *, double *); #ifdef KLU -extern int CSWbindCSC (GENmodel*, CKTcircuit*) ; -extern int CSWbindCSCComplex (GENmodel*, CKTcircuit*) ; -extern int CSWbindCSCComplexToReal (GENmodel*, CKTcircuit*) ; +extern int CSWbindCSC(GENmodel *, CKTcircuit *); +extern int CSWbindCSCComplex(GENmodel *, CKTcircuit *); +extern int CSWbindCSCComplexToReal(GENmodel *, CKTcircuit *); #endif diff --git a/src/spicelib/devices/csw/cswinit.c b/src/spicelib/devices/csw/cswinit.c index ca3a4373a..c3b4be525 100644 --- a/src/spicelib/devices/csw/cswinit.c +++ b/src/spicelib/devices/csw/cswinit.c @@ -44,9 +44,9 @@ SPICEdev CSWinfo = { .DEVfindBranch = NULL, .DEVacLoad = CSWacLoad, .DEVaccept = NULL, - .DEVdestroy = CSWdestroy, - .DEVmodDelete = CSWmDelete, - .DEVdelete = CSWdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = CSWask, .DEVmodAsk = CSWmAsk, diff --git a/src/spicelib/devices/csw/cswinit.h b/src/spicelib/devices/csw/cswinit.h index aceb63379..2a08e4e68 100644 --- a/src/spicelib/devices/csw/cswinit.h +++ b/src/spicelib/devices/csw/cswinit.h @@ -1,9 +1,9 @@ #ifndef _CSWINIT_H #define _CSWINIT_H -extern IFparm CSWpTable[ ]; -extern IFparm CSWmPTable[ ]; -extern char *CSWnames[ ]; +extern IFparm CSWpTable[]; +extern IFparm CSWmPTable[]; +extern char *CSWnames[]; extern int CSWpTSize; extern int CSWmPTSize; extern int CSWnSize; diff --git a/src/spicelib/devices/csw/cswload.c b/src/spicelib/devices/csw/cswload.c index 473bee330..f77c3a43f 100644 --- a/src/spicelib/devices/csw/cswload.c +++ b/src/spicelib/devices/csw/cswload.c @@ -12,55 +12,47 @@ Modified: 2001 Jon Engelbert #include "ngspice/sperror.h" #include "ngspice/suffix.h" + int CSWload(GENmodel *inModel, CKTcircuit *ckt) - - /* actually load the current values into the - * sparse matrix previously provided - */ { - CSWmodel *model = (CSWmodel*)inModel; + CSWmodel *model = (CSWmodel *) inModel; CSWinstance *here; double g_now; double i_ctrl; - double previous_state = -1; + double previous_state = -1; double current_state = -1, old_current_state = -1; - double REALLY_OFF = 0, REALLY_ON = 1; - /* switch is on or off, not in hysteresis region. */ - double HYST_OFF = 2, HYST_ON = 3; - /* switch is on or off while control value is in hysteresis region. */ + double REALLY_OFF = 0, REALLY_ON = 1; + /* switch is on or off, not in hysteresis region. */ + double HYST_OFF = 2, HYST_ON = 3; + /* switch is on or off while control value is in hysteresis region. */ - /* loop through all the switch models */ - for( ; model != NULL; model = CSWnextModel(model)) { + for (; model; model = CSWnextModel(model)) + for (here = CSWinstances(model); here; here = CSWnextInstance(here)) { - /* loop through all the instances of the model */ - for (here = CSWinstances(model); here != NULL ; - here=CSWnextInstance(here)) { - - old_current_state = *(ckt->CKTstates[0] + here->CSWstate); - previous_state = *(ckt->CKTstates[1] + here->CSWstate); - i_ctrl = *(ckt->CKTrhsOld + - here->CSWcontBranch); + old_current_state = ckt->CKTstate0[here->CSWswitchstate]; + previous_state = ckt->CKTstate1[here->CSWswitchstate]; + i_ctrl = ckt->CKTrhsOld[here->CSWcontBranch]; /* decide the state of the switch */ - if(ckt->CKTmode & (MODEINITFIX|MODEINITJCT)) { + if (ckt->CKTmode & (MODEINITFIX | MODEINITJCT)) { - if(here->CSWzero_stateGiven) { - /* switch specified "on" */ - if ((model->CSWiHysteresis >= 0) && (i_ctrl > (model->CSWiThreshold + model->CSWiHysteresis))) - current_state = REALLY_ON; - else if ((model->CSWiHysteresis < 0) && (i_ctrl > (model->CSWiThreshold - model->CSWiHysteresis))) - current_state = REALLY_ON; - else - current_state = HYST_ON; + if (here->CSWzero_stateGiven) { + /* switch specified "on" */ + if (model->CSWiHysteresis >= 0 && i_ctrl > model->CSWiThreshold + model->CSWiHysteresis) + current_state = REALLY_ON; + else if (model->CSWiHysteresis < 0 && i_ctrl > model->CSWiThreshold - model->CSWiHysteresis) + current_state = REALLY_ON; + else + current_state = HYST_ON; } else { - if ((model->CSWiHysteresis >= 0) && (i_ctrl < (model->CSWiThreshold - model->CSWiHysteresis))) - current_state = REALLY_OFF; - else if ((model->CSWiHysteresis < 0) && (i_ctrl < (model->CSWiThreshold + model->CSWiHysteresis))) - current_state = REALLY_OFF; - else - current_state = HYST_OFF; + if (model->CSWiHysteresis >= 0 && i_ctrl < model->CSWiThreshold - model->CSWiHysteresis) + current_state = REALLY_OFF; + else if (model->CSWiHysteresis < 0 && i_ctrl < model->CSWiThreshold + model->CSWiHysteresis) + current_state = REALLY_OFF; + else + current_state = HYST_OFF; } } else if (ckt->CKTmode & (MODEINITSMSIG)) { @@ -70,78 +62,78 @@ CSWload(GENmodel *inModel, CKTcircuit *ckt) } else if (ckt->CKTmode & (MODEINITFLOAT)) { /* use state0 since INITTRAN or INITPRED already called */ - if (model->CSWiHysteresis > 0) { - if (i_ctrl > (model->CSWiThreshold + model->CSWiHysteresis)) { - current_state = REALLY_ON; - } else if (i_ctrl < (model->CSWiThreshold - model->CSWiHysteresis)) { - current_state = REALLY_OFF; - } else { - current_state = previous_state; - } - } else { - if (i_ctrl > (model->CSWiThreshold - model->CSWiHysteresis)) { - current_state = REALLY_ON; - } else if (i_ctrl < (model->CSWiThreshold + model->CSWiHysteresis)) { - current_state = REALLY_OFF; - } else { - /* in hysteresis... change value if going from low to hysteresis, - * or from hi to hysteresis. */ - - /* if previous state was in hysteresis, then don't change the state.. */ - if ((previous_state == HYST_OFF) || (previous_state == HYST_ON)) { - current_state = previous_state; - } else if (previous_state == REALLY_ON) { - current_state = HYST_OFF; - } else if (previous_state == REALLY_OFF) { - current_state = HYST_ON; - } else - internalerror("bad value for previous region in swload"); - } - } + if (model->CSWiHysteresis > 0) { + if (i_ctrl > (model->CSWiThreshold + model->CSWiHysteresis)) + current_state = REALLY_ON; + else if (i_ctrl < (model->CSWiThreshold - model->CSWiHysteresis)) + current_state = REALLY_OFF; + else + current_state = previous_state; + } else { + if (i_ctrl > (model->CSWiThreshold - model->CSWiHysteresis)) + current_state = REALLY_ON; + else if (i_ctrl < (model->CSWiThreshold + model->CSWiHysteresis)) + current_state = REALLY_OFF; + else { + /* in hysteresis... change value if going from low to hysteresis, + * or from hi to hysteresis. */ - if(current_state != old_current_state) { - ckt->CKTnoncon++; /* ensure one more iteration */ - ckt->CKTtroubleElt = (GENinstance *) here; + /* if previous state was in hysteresis, then don't change the state.. */ + if (previous_state == HYST_OFF || previous_state == HYST_ON) + current_state = previous_state; + else if (previous_state == REALLY_ON) + current_state = HYST_OFF; + else if (previous_state == REALLY_OFF) + current_state = HYST_ON; + else + internalerror("bad value for previous region in swload"); + } } - } else if (ckt->CKTmode & (MODEINITTRAN|MODEINITPRED)) { + if (current_state != old_current_state) { + ckt->CKTnoncon++; /* ensure one more iteration */ + ckt->CKTtroubleElt = (GENinstance *) here; + } - if (model->CSWiHysteresis > 0) { - if (i_ctrl > (model->CSWiThreshold + model->CSWiHysteresis)) { - current_state = REALLY_ON; - } else if (i_ctrl < (model->CSWiThreshold - model->CSWiHysteresis)) { - current_state = REALLY_OFF; - } else { - current_state = previous_state; - } - } else { - if (i_ctrl > (model->CSWiThreshold - model->CSWiHysteresis)) { - current_state = REALLY_ON; - } else if (i_ctrl < (model->CSWiThreshold + model->CSWiHysteresis)) { - current_state = REALLY_OFF; - } else { - /* in hysteresis... change value if going from low to hysteresis, - * or from hi to hysteresis. */ - - /* if previous state was in hysteresis, then don't change the state.. */ - if ((previous_state == HYST_OFF) || (previous_state == HYST_ON)) { - current_state = previous_state; - } else if (previous_state == REALLY_ON) { - current_state = HYST_OFF; - } else if (previous_state == REALLY_OFF) { - current_state = HYST_ON; - } else - internalerror("bad value for previous region in cswload"); - } - } - } + } else if (ckt->CKTmode & (MODEINITTRAN | MODEINITPRED)) { + + if (model->CSWiHysteresis > 0) { + if (i_ctrl > (model->CSWiThreshold + model->CSWiHysteresis)) + current_state = REALLY_ON; + else if (i_ctrl < (model->CSWiThreshold - model->CSWiHysteresis)) + current_state = REALLY_OFF; + else + current_state = previous_state; + } else { + if (i_ctrl > (model->CSWiThreshold - model->CSWiHysteresis)) + current_state = REALLY_ON; + else if (i_ctrl < (model->CSWiThreshold + model->CSWiHysteresis)) + current_state = REALLY_OFF; + else { + /* in hysteresis... change value if going from low to hysteresis, + * or from hi to hysteresis. */ + + /* if previous state was in hysteresis, then don't change the state.. */ + if (previous_state == HYST_OFF || previous_state == HYST_ON) + current_state = previous_state; + else if (previous_state == REALLY_ON) + current_state = HYST_OFF; + else if (previous_state == REALLY_OFF) + current_state = HYST_ON; + else + internalerror("bad value for previous region in cswload"); + } + } + } + + ckt->CKTstate0[here->CSWswitchstate] = current_state; + ckt->CKTstate1[here->CSWswitchstate] = previous_state; + + if (current_state == REALLY_ON || current_state == HYST_ON) + g_now = model->CSWonConduct; + else + g_now = model->CSWoffConduct; - *(ckt->CKTstates[0] + here->CSWstate) = current_state; - *(ckt->CKTstates[1] + here->CSWstate) = previous_state; - if ((current_state == REALLY_ON) || (current_state == HYST_ON)) - g_now = model->CSWonConduct; - else - g_now = model->CSWoffConduct; here->CSWcond = g_now; *(here->CSWposPosPtr) += g_now; @@ -149,6 +141,6 @@ CSWload(GENmodel *inModel, CKTcircuit *ckt) *(here->CSWnegPosPtr) -= g_now; *(here->CSWnegNegPtr) += g_now; } - } - return(OK); + + return OK; } diff --git a/src/spicelib/devices/csw/cswmask.c b/src/spicelib/devices/csw/cswmask.c index f4dad7b11..ae5f9d693 100644 --- a/src/spicelib/devices/csw/cswmask.c +++ b/src/spicelib/devices/csw/cswmask.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1987 Thomas L. Quarles **********/ -/* - */ /* * This routine gives access to the internal model parameters @@ -19,35 +17,33 @@ Author: 1987 Thomas L. Quarles #include "ngspice/suffix.h" -/* ARGSUSED */ int CSWmAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value) { - CSWmodel *here = (CSWmodel*)inst; + CSWmodel *here = (CSWmodel *) inst; NG_IGNORE(ckt); - switch(which) { - case CSW_RON: - value->rValue = here->CSWonResistance; - return (OK); - case CSW_ROFF: - value->rValue = here->CSWoffResistance; - return (OK); - case CSW_ITH: - value->rValue = here->CSWiThreshold; - return (OK); - case CSW_IHYS: - value->rValue = here->CSWiHysteresis; - return (OK); - case CSW_GON: - value->rValue = here->CSWonConduct; - return (OK); - case CSW_GOFF: - value->rValue = here->CSWoffConduct; - return (OK); - default: - return (E_BADPARM); + switch (which) { + case CSW_RON: + value->rValue = here->CSWonResistance; + return OK; + case CSW_ROFF: + value->rValue = here->CSWoffResistance; + return OK; + case CSW_ITH: + value->rValue = here->CSWiThreshold; + return OK; + case CSW_IHYS: + value->rValue = here->CSWiHysteresis; + return OK; + case CSW_GON: + value->rValue = here->CSWonConduct; + return OK; + case CSW_GOFF: + value->rValue = here->CSWoffConduct; + return OK; + default: + return E_BADPARM; } - /* NOTREACHED */ } diff --git a/src/spicelib/devices/csw/cswmdel.c b/src/spicelib/devices/csw/cswmdel.c deleted file mode 100644 index 729fd8407..000000000 --- a/src/spicelib/devices/csw/cswmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Gordon Jacobs -**********/ - -#include "ngspice/ngspice.h" -#include "cswdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -CSWmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/csw/cswmpar.c b/src/spicelib/devices/csw/cswmpar.c index fb047b47d..8c6e13a08 100644 --- a/src/spicelib/devices/csw/cswmpar.c +++ b/src/spicelib/devices/csw/cswmpar.c @@ -3,8 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs Modified: 2001 Jon Englebert **********/ -/* - */ #include "ngspice/ngspice.h" #include "ngspice/ifsim.h" @@ -16,33 +14,35 @@ Modified: 2001 Jon Englebert int CSWmParam(int param, IFvalue *value, GENmodel *inModel) { - CSWmodel *model = (CSWmodel*)inModel; - switch(param) { - case CSW_CSW: - /* just says that this is a switch */ - break; - case CSW_RON: - model->CSWonResistance = value->rValue; - model->CSWonConduct = 1.0/(value->rValue); - model->CSWonGiven = TRUE; - break; - case CSW_ROFF: - model->CSWoffResistance = value->rValue; - model->CSWoffConduct = 1.0/(value->rValue); - model->CSWoffGiven = TRUE; - break; - case CSW_ITH: - model->CSWiThreshold = value->rValue; - model->CSWthreshGiven = TRUE; - break; - case CSW_IHYS: - /* take absolute value of hysteresis voltage */ - /* model->CSWiHysteresis = fabs(value->rValue); */ - model->CSWiHysteresis = value->rValue; - model->CSWhystGiven = TRUE; - break; - default: - return(E_BADPARM); + CSWmodel *model = (CSWmodel *) inModel; + + switch (param) { + case CSW_CSW: + /* just says that this is a switch */ + break; + case CSW_RON: + model->CSWonResistance = value->rValue; + model->CSWonConduct = 1.0 / value->rValue; + model->CSWonGiven = TRUE; + break; + case CSW_ROFF: + model->CSWoffResistance = value->rValue; + model->CSWoffConduct = 1.0 / value->rValue; + model->CSWoffGiven = TRUE; + break; + case CSW_ITH: + model->CSWiThreshold = value->rValue; + model->CSWthreshGiven = TRUE; + break; + case CSW_IHYS: + /* take absolute value of hysteresis voltage */ + /* model->CSWiHysteresis = fabs(value->rValue); */ + model->CSWiHysteresis = value->rValue; + model->CSWhystGiven = TRUE; + break; + default: + return E_BADPARM; } - return(OK); + + return OK; } diff --git a/src/spicelib/devices/csw/cswnoise.c b/src/spicelib/devices/csw/cswnoise.c index 81c4700e7..732383c9a 100644 --- a/src/spicelib/devices/csw/cswnoise.c +++ b/src/spicelib/devices/csw/cswnoise.c @@ -22,7 +22,7 @@ Author: 1987 Gary W. Ng int -CSWnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata *data, double *OnDens) +CSWnoise(int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata *data, double *OnDens) { NOISEAN *job = (NOISEAN *) ckt->CKTcurJob; @@ -35,90 +35,81 @@ CSWnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata *d double lnNdens; int current_state; + for (model = firstModel; model; model = CSWnextModel(model)) + for (inst = CSWinstances(model); inst; inst = CSWnextInstance(inst)) { - for (model=firstModel; model != NULL; model=CSWnextModel(model)) { - for (inst=CSWinstances(model); inst != NULL; inst=CSWnextInstance(inst)) { + switch (operation) { - switch (operation) { + case N_OPEN: - case N_OPEN: + /* see if we have to to produce a summary report */ + /* if so, name the noise generator */ - /* see if we have to to produce a summary report */ - /* if so, name the noise generator */ + if (job->NStpsSm != 0) + switch (mode) { + case N_DENS: + NOISE_ADD_OUTVAR(ckt, data, "onoise_%s%s", inst->CSWname, ""); + break; + case INT_NOIZ: + NOISE_ADD_OUTVAR(ckt, data, "onoise_total_%s%s", inst->CSWname, ""); + NOISE_ADD_OUTVAR(ckt, data, "inoise_total_%s%s", inst->CSWname, ""); + break; + } + break; - if (job->NStpsSm != 0) { - switch (mode) { + case N_CALC: + switch (mode) { - case N_DENS: - NOISE_ADD_OUTVAR(ckt, data, "onoise_%s%s", inst->CSWname, ""); - break; + case N_DENS: + current_state = (int) ckt->CKTstate0[inst->CSWswitchstate]; + NevalSrc(&noizDens, &lnNdens, ckt, THERMNOISE, + inst->CSWposNode, inst->CSWnegNode, + current_state ? model->CSWonConduct : model->CSWoffConduct); - case INT_NOIZ: - NOISE_ADD_OUTVAR(ckt, data, "onoise_total_%s%s", inst->CSWname, ""); - NOISE_ADD_OUTVAR(ckt, data, "inoise_total_%s%s", inst->CSWname, ""); - break; - } - } - break; + *OnDens += noizDens; - case N_CALC: - switch (mode) { + if (data->delFreq == 0.0) { - case N_DENS: - current_state = (int)*(ckt->CKTstate0 + inst->CSWstate); - NevalSrc(&noizDens,&lnNdens,ckt,THERMNOISE, - inst->CSWposNode,inst->CSWnegNode, - current_state?(model->CSWonConduct):(model->CSWoffConduct)); + /* if we haven't done any previous integration, we need to */ + /* initialize our "history" variables */ - *OnDens += noizDens; + inst->CSWnVar[LNLSTDENS] = lnNdens; - if (data->delFreq == 0.0) { + /* clear out our integration variable if it's the first pass */ - /* if we haven't done any previous integration, we need to */ - /* initialize our "history" variables */ + if (data->freq == job->NstartFreq) + inst->CSWnVar[OUTNOIZ] = 0.0; + } else { /* data->delFreq != 0.0 (we have to integrate) */ + tempOutNoise = Nintegrate(noizDens, lnNdens, + inst->CSWnVar[LNLSTDENS], data); + tempInNoise = Nintegrate(noizDens * + data->GainSqInv, lnNdens + data->lnGainInv, + inst->CSWnVar[LNLSTDENS] + data->lnGainInv, + data); + inst->CSWnVar[OUTNOIZ] += tempOutNoise; + inst->CSWnVar[INNOIZ] += tempInNoise; + data->outNoiz += tempOutNoise; + data->inNoise += tempInNoise; + inst->CSWnVar[LNLSTDENS] = lnNdens; + } + if (data->prtSummary) + data->outpVector[data->outNumber++] = noizDens; + break; - inst->CSWnVar[LNLSTDENS] = lnNdens; + case INT_NOIZ: /* already calculated, just output */ + if (job->NStpsSm != 0) { + data->outpVector[data->outNumber++] = inst->CSWnVar[OUTNOIZ]; + data->outpVector[data->outNumber++] = inst->CSWnVar[INNOIZ]; + } + break; + } + break; - /* clear out our integration variable if it's the first pass */ + case N_CLOSE: + return OK; /* do nothing, the main calling routine will close */ + break; /* the plots */ + } + } - if (data->freq == job->NstartFreq) { - inst->CSWnVar[OUTNOIZ] = 0.0; - } - } else { /* data->delFreq != 0.0 (we have to integrate) */ - tempOutNoise = Nintegrate(noizDens, lnNdens, - inst->CSWnVar[LNLSTDENS], data); - tempInNoise = Nintegrate(noizDens * - data->GainSqInv ,lnNdens + data->lnGainInv, - inst->CSWnVar[LNLSTDENS] + data->lnGainInv, - data); - inst->CSWnVar[OUTNOIZ] += tempOutNoise; - inst->CSWnVar[INNOIZ] += tempInNoise; - data->outNoiz += tempOutNoise; - data->inNoise += tempInNoise; - inst->CSWnVar[LNLSTDENS] = lnNdens; - } - if (data->prtSummary) { - data->outpVector[data->outNumber++] = noizDens; - } - break; - - case INT_NOIZ: /* already calculated, just output */ - if (job->NStpsSm != 0) { - data->outpVector[data->outNumber++] = inst->CSWnVar[OUTNOIZ]; - data->outpVector[data->outNumber++] = inst->CSWnVar[INNOIZ]; - } /* if */ - break; - } /* switch (mode) */ - break; - - case N_CLOSE: - return (OK); /* do nothing, the main calling routine will close */ - break; /* the plots */ - } /* switch (operation) */ - } /* for inst */ - } /* for model */ - -return(OK); + return OK; } - - diff --git a/src/spicelib/devices/csw/cswparam.c b/src/spicelib/devices/csw/cswparam.c index c154a1175..b52f1419c 100644 --- a/src/spicelib/devices/csw/cswparam.c +++ b/src/spicelib/devices/csw/cswparam.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs **********/ -/* - */ #include "ngspice/ngspice.h" #include "cswdefs.h" @@ -12,30 +10,28 @@ Author: 1985 Gordon Jacobs #include "ngspice/suffix.h" -/* ARGSUSED */ int CSWparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select) { - CSWinstance *here = (CSWinstance*)inst; + CSWinstance *here = (CSWinstance *) inst; NG_IGNORE(select); - switch(param) { - case CSW_CONTROL: - here->CSWcontName = value->uValue; - break; - case CSW_IC_ON: - if(value->iValue) { - here->CSWzero_stateGiven = TRUE; - } - break; - case CSW_IC_OFF: - if(value->iValue) { - here->CSWzero_stateGiven = FALSE; - } - break; - default: - return(E_BADPARM); + switch (param) { + case CSW_CONTROL: + here->CSWcontName = value->uValue; + break; + case CSW_IC_ON: + if (value->iValue) + here->CSWzero_stateGiven = TRUE; + break; + case CSW_IC_OFF: + if (value->iValue) + here->CSWzero_stateGiven = FALSE; + break; + default: + return E_BADPARM; } - return(OK); + + return OK; } diff --git a/src/spicelib/devices/csw/cswpzld.c b/src/spicelib/devices/csw/cswpzld.c index 766d8a69f..065cefec0 100644 --- a/src/spicelib/devices/csw/cswpzld.c +++ b/src/spicelib/devices/csw/cswpzld.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs **********/ -/* - */ #include "ngspice/ngspice.h" #include "ngspice/cktdefs.h" @@ -13,38 +11,28 @@ Author: 1985 Gordon Jacobs #include "ngspice/suffix.h" -/* ARGSUSED */ int CSWpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) - - /* load the current values into the - * sparse matrix previously provided - * during AC analysis - */ { - CSWmodel *model = (CSWmodel*)inModel; + CSWmodel *model = (CSWmodel *) inModel; CSWinstance *here; double g_now; int current_state; NG_IGNORE(s); - /* loop through all the switch models */ - for( ; model != NULL; model = CSWnextModel(model)) { + for (; model; model = CSWnextModel(model)) + for (here = CSWinstances(model); here; here = CSWnextInstance(here)) { - /* loop through all the instances of the model */ - for (here = CSWinstances(model); here != NULL ; - here=CSWnextInstance(here)) { + current_state = (int) ckt->CKTstate0[here->CSWswitchstate]; - current_state = (int)*(ckt->CKTstate0 + here->CSWstate); - - g_now = current_state?(model->CSWonConduct):(model->CSWoffConduct); + g_now = current_state ? model->CSWonConduct : model->CSWoffConduct; *(here->CSWposPosPtr) += g_now; *(here->CSWposNegPtr) -= g_now; *(here->CSWnegPosPtr) -= g_now; *(here->CSWnegNegPtr) += g_now; } - } - return(OK); + + return OK; } diff --git a/src/spicelib/devices/csw/cswsetup.c b/src/spicelib/devices/csw/cswsetup.c index c33d0ec02..7d4238475 100644 --- a/src/spicelib/devices/csw/cswsetup.c +++ b/src/spicelib/devices/csw/cswsetup.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs **********/ -/* - */ #include "ngspice/ngspice.h" #include "ngspice/cktdefs.h" @@ -11,67 +9,59 @@ Author: 1985 Gordon Jacobs #include "ngspice/sperror.h" #include "ngspice/suffix.h" +#define TSTALLOC(ptr, first, second) \ + do { \ + if (!(here->ptr = SMPmakeElt(matrix, here->first, here->second))) \ + return E_NOMEM; \ + } while (0) + int CSWsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) - /* load the switch conductance with those pointers needed later - * for fast matrix loading - */ - { - CSWmodel *model = (CSWmodel*)inModel; + CSWmodel *model = (CSWmodel *) inModel; CSWinstance *here; - /* loop through all the current source models */ - for( ; model != NULL; model = CSWnextModel(model)) { + for (; model; model = CSWnextModel(model)) { #ifdef USE_CUSPICE /* This model doesn't support CUDA */ - model->gen.has_cuda = 0 ; + model->gen.has_cuda = 0; #endif /* Default Value Processing for Switch Model */ - if (!model->CSWthreshGiven) { + if (!model->CSWthreshGiven) model->CSWiThreshold = 0; - } - if (!model->CSWhystGiven) { + if (!model->CSWhystGiven) model->CSWiHysteresis = 0; - } if (!model->CSWonGiven) { model->CSWonConduct = CSW_ON_CONDUCTANCE; - model->CSWonResistance = 1.0/model->CSWonConduct; + model->CSWonResistance = 1.0 / model->CSWonConduct; } if (!model->CSWoffGiven) { model->CSWoffConduct = CSW_OFF_CONDUCTANCE; - model->CSWoffResistance = 1.0/model->CSWoffConduct; + model->CSWoffResistance = 1.0 / model->CSWoffConduct; } - /* loop through all the instances of the model */ - for (here = CSWinstances(model); here != NULL ; - here=CSWnextInstance(here)) { + for (here = CSWinstances(model); here; here = CSWnextInstance(here)) { /* Default Value Processing for Switch Instance */ here->CSWstate = *states; *states += CSW_NUM_STATES; - here->CSWcontBranch = CKTfndBranch(ckt,here->CSWcontName); - if(here->CSWcontBranch == 0) { - SPfrontEnd->IFerrorf (ERR_FATAL, - "%s: unknown controlling source %s", here->CSWname, here->CSWcontName); - return(E_BADPARM); + here->CSWcontBranch = CKTfndBranch(ckt, here->CSWcontName); + if (here->CSWcontBranch == 0) { + SPfrontEnd->IFerrorf(ERR_FATAL, + "%s: unknown controlling source %s", here->CSWname, here->CSWcontName); + return E_BADPARM; } -/* macro to make elements with built in test for out of memory */ -#define TSTALLOC(ptr,first,second) \ -do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ - return(E_NOMEM);\ -} } while(0) - TSTALLOC(CSWposPosPtr, CSWposNode, CSWposNode); TSTALLOC(CSWposNegPtr, CSWposNode, CSWnegNode); TSTALLOC(CSWnegPosPtr, CSWnegNode, CSWposNode); TSTALLOC(CSWnegNegPtr, CSWnegNode, CSWnegNode); } } - return(OK); + + return OK; } diff --git a/src/spicelib/devices/csw/cswtrunc.c b/src/spicelib/devices/csw/cswtrunc.c index 150a0dec2..e7be9559f 100644 --- a/src/spicelib/devices/csw/cswtrunc.c +++ b/src/spicelib/devices/csw/cswtrunc.c @@ -3,8 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles Modified: 2000 AlansFixes **********/ -/* - */ #include "ngspice/ngspice.h" #include "ngspice/cktdefs.h" @@ -13,37 +11,42 @@ Modified: 2000 AlansFixes #include "cswdefs.h" + int CSWtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) { - CSWmodel *model = (CSWmodel*)inModel; + CSWmodel *model = (CSWmodel *) inModel; CSWinstance *here; double lastChange, maxChange, maxStep, ref; - for( ; model!= NULL; model = CSWnextModel(model)) { - for(here = CSWinstances(model); here != NULL ; - here = CSWnextInstance(here)) { - lastChange = *(ckt->CKTstate0+(here->CSWstate+1)) - - *(ckt->CKTstate1+(here->CSWstate+1)); - if (*(ckt->CKTstate0+(here->CSWstate))==0) { - ref = (model->CSWiThreshold + model->CSWiHysteresis); - if ((*(ckt->CKTstate0+(here->CSWstate+1))0)) { - maxChange = (ref - *(ckt->CKTstate0+(here->CSWstate+1))) * - 0.75 + 0.00005; - maxStep = maxChange/lastChange * ckt->CKTdeltaOld[0]; - if (*timeStep > maxStep) { *timeStep = maxStep; } - } + for (; model; model = CSWnextModel(model)) + for (here = CSWinstances(model); here; here = CSWnextInstance(here)) { + lastChange = + ckt->CKTstate0[here->CSWctrlvalue] - + ckt->CKTstate1[here->CSWctrlvalue]; + if (ckt->CKTstate0[here->CSWswitchstate] == 0) { + ref = model->CSWiThreshold + model->CSWiHysteresis; + if (ckt->CKTstate0[here->CSWctrlvalue] < ref && lastChange > 0) { + maxChange = + (ref - ckt->CKTstate0[here->CSWctrlvalue]) * 0.75 + + 0.00005; + maxStep = maxChange / lastChange * ckt->CKTdeltaOld[0]; + if (*timeStep > maxStep) + *timeStep = maxStep; + } } else { - ref = (model->CSWiThreshold - model->CSWiHysteresis); - if ((*(ckt->CKTstate0+(here->CSWstate+1))>ref) && (lastChange<0)) { - maxChange = (ref - *(ckt->CKTstate0+(here->CSWstate+1))) * - 0.75 - 0.00005; - maxStep = maxChange/lastChange * ckt->CKTdeltaOld[0]; - if (*timeStep > maxStep) { *timeStep = maxStep; } - } + ref = model->CSWiThreshold - model->CSWiHysteresis; + if (ckt->CKTstate0[here->CSWctrlvalue] > ref && lastChange < 0) { + maxChange = + (ref - ckt->CKTstate0[here->CSWctrlvalue]) * 0.75 + - 0.00005; + maxStep = maxChange / lastChange * ckt->CKTdeltaOld[0]; + if (*timeStep > maxStep) + *timeStep = maxStep; + } } } - } - return(OK); + + return OK; } diff --git a/src/spicelib/devices/dio/Makefile.am b/src/spicelib/devices/dio/Makefile.am index e0a06564d..86241ab95 100644 --- a/src/spicelib/devices/dio/Makefile.am +++ b/src/spicelib/devices/dio/Makefile.am @@ -8,8 +8,6 @@ libdio_la_SOURCES = \ dioask.c \ dioconv.c \ diodefs.h \ - diodel.c \ - diodest.c \ diodisto.c \ diodset.c \ dioext.h \ @@ -19,7 +17,6 @@ libdio_la_SOURCES = \ dioitf.h \ dioload.c \ diomask.c \ - diomdel.c \ diompar.c \ dionoise.c \ dioparam.c \ diff --git a/src/spicelib/devices/dio/diodefs.h b/src/spicelib/devices/dio/diodefs.h index 97f7cf65f..e1223f973 100644 --- a/src/spicelib/devices/dio/diodefs.h +++ b/src/spicelib/devices/dio/diodefs.h @@ -14,6 +14,14 @@ Modified by Paolo Nenzi 2003 and Dietmar Warning 2012 /* data structures used to describe diodes */ +/* indices to array of diode noise sources */ + +#define DIORSNOIZ 0 +#define DIOIDNOIZ 1 +#define DIOFLNOIZ 2 +#define DIOTOTNOIZ 3 + +#define DIONSRCS 4 /* information needed per instance */ @@ -132,15 +140,6 @@ typedef struct sDIOinstance { #endif -/* indices to array of diode noise sources */ - -#define DIORSNOIZ 0 -#define DIOIDNOIZ 1 -#define DIOFLNOIZ 2 -#define DIOTOTNOIZ 3 - -#define DIONSRCS 4 - #ifndef NONOISE double DIOnVar[NSTATVARS][DIONSRCS]; #else /* NONOISE */ @@ -169,10 +168,15 @@ typedef struct sDIOinstance { #define DIOconduct DIOstate+2 #define DIOcapCharge DIOstate+3 #define DIOcapCurrent DIOstate+4 + +#define DIOnumStates 5 + #define DIOsensxp DIOstate+5 /* charge sensitivities and their derivatives. * +6 for the derivatives - pointer to the * beginning of the array */ +#define DIOnumSenStates 2 + /* per model data */ diff --git a/src/spicelib/devices/dio/diodel.c b/src/spicelib/devices/dio/diodel.c deleted file mode 100644 index 55e81749a..000000000 --- a/src/spicelib/devices/dio/diodel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "diodefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -DIOdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/dio/diodest.c b/src/spicelib/devices/dio/diodest.c deleted file mode 100644 index 169d5332e..000000000 --- a/src/spicelib/devices/dio/diodest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "diodefs.h" -#include "ngspice/suffix.h" - - -void -DIOdestroy(void) -{ -} diff --git a/src/spicelib/devices/dio/dioext.h b/src/spicelib/devices/dio/dioext.h index 9626dc9f4..fc4242ea2 100644 --- a/src/spicelib/devices/dio/dioext.h +++ b/src/spicelib/devices/dio/dioext.h @@ -7,12 +7,9 @@ Modified: 2000 AlansFixes extern int DIOacLoad(GENmodel*,CKTcircuit*); extern int DIOask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int DIOconvTest(GENmodel *,CKTcircuit*); -extern int DIOdelete(GENinstance*); -extern void DIOdestroy(void); extern int DIOgetic(GENmodel*,CKTcircuit*); extern int DIOload(GENmodel*,CKTcircuit*); extern int DIOmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int DIOmDelete(GENmodel*); extern int DIOmParam(int,IFvalue*,GENmodel*); extern int DIOparam(int,IFvalue*,GENinstance*,IFvalue*); extern int DIOpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/dio/dioinit.c b/src/spicelib/devices/dio/dioinit.c index 545f77297..a63836336 100644 --- a/src/spicelib/devices/dio/dioinit.c +++ b/src/spicelib/devices/dio/dioinit.c @@ -43,9 +43,9 @@ SPICEdev DIOinfo = { .DEVfindBranch = NULL, .DEVacLoad = DIOacLoad, .DEVaccept = NULL, - .DEVdestroy = DIOdestroy, - .DEVmodDelete = DIOmDelete, - .DEVdelete = DIOdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = DIOgetic, .DEVask = DIOask, .DEVmodAsk = DIOmAsk, diff --git a/src/spicelib/devices/dio/diomdel.c b/src/spicelib/devices/dio/diomdel.c deleted file mode 100644 index f4d845701..000000000 --- a/src/spicelib/devices/dio/diomdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "diodefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -DIOmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/dio/diosetup.c b/src/spicelib/devices/dio/diosetup.c index df6c5a628..8fbff587b 100644 --- a/src/spicelib/devices/dio/diosetup.c +++ b/src/spicelib/devices/dio/diosetup.c @@ -201,9 +201,9 @@ DIOsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) here->DIOjunctionSWCap = model->DIOjunctionSWCap * here->DIOpj; here->DIOstate = *states; - *states += 5; + *states += DIOnumStates; if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & TRANSEN) ){ - *states += 2 * (ckt->CKTsenInfo->SENparms); + *states += DIOnumSenStates * (ckt->CKTsenInfo->SENparms); } if(model->DIOresist == 0) { diff --git a/src/spicelib/devices/hfet1/Makefile.am b/src/spicelib/devices/hfet1/Makefile.am index 7a6ccddf6..63c06ac8f 100644 --- a/src/spicelib/devices/hfet1/Makefile.am +++ b/src/spicelib/devices/hfet1/Makefile.am @@ -7,8 +7,6 @@ libhfet_la_SOURCES = \ hfetacl.c \ hfetask.c \ hfetdefs.h \ - hfetdel.c \ - hfetdest.c \ hfetext.h \ hfetgetic.c \ hfetinit.c \ @@ -16,7 +14,6 @@ libhfet_la_SOURCES = \ hfetitf.h \ hfetload.c \ hfetmask.c \ - hfetmdel.c \ hfetmpar.c \ hfetparam.c \ hfetpzl.c \ diff --git a/src/spicelib/devices/hfet1/hfetdefs.h b/src/spicelib/devices/hfet1/hfetdefs.h index 0a08d892b..c17f7c966 100644 --- a/src/spicelib/devices/hfet1/hfetdefs.h +++ b/src/spicelib/devices/hfet1/hfetdefs.h @@ -12,8 +12,6 @@ Modified: Paolo Nenzi #include "ngspice/complex.h" #include "ngspice/noisedef.h" -#define HFETAnumStates 24 - typedef struct sHFETAinstance { struct GENinstance gen; @@ -97,6 +95,8 @@ typedef struct sHFETAinstance { #define HFETAgmg HFETAstate+22 #define HFETAgmd HFETAstate+23 +#define HFETAnumStates 24 + int HFETAoff; diff --git a/src/spicelib/devices/hfet1/hfetdel.c b/src/spicelib/devices/hfet1/hfetdel.c deleted file mode 100644 index ca46fe582..000000000 --- a/src/spicelib/devices/hfet1/hfetdel.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 S. Hwang -**********/ - -/* - Imported into hfeta model: Paolo Nenzi 2001 -*/ - -#include "ngspice/ngspice.h" -#include "hfetdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -HFETAdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/hfet1/hfetdest.c b/src/spicelib/devices/hfet1/hfetdest.c deleted file mode 100644 index 7cade9aa3..000000000 --- a/src/spicelib/devices/hfet1/hfetdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Imported from MacSpice3f4 - Antony Wilson -Modified: Paolo Nenzi -**********/ - -#include "ngspice/ngspice.h" -#include "hfetdefs.h" -#include "ngspice/suffix.h" - - -void -HFETAdestroy(void) -{ -} diff --git a/src/spicelib/devices/hfet1/hfetext.h b/src/spicelib/devices/hfet1/hfetext.h index 98cb43b0d..870c9b642 100644 --- a/src/spicelib/devices/hfet1/hfetext.h +++ b/src/spicelib/devices/hfet1/hfetext.h @@ -5,12 +5,9 @@ Modified: Paolo Nenzi extern int HFETAacLoad(GENmodel*,CKTcircuit*); extern int HFETAask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int HFETAdelete(GENinstance*); -extern void HFETAdestroy(void); extern int HFETAgetic(GENmodel*,CKTcircuit*); extern int HFETAload(GENmodel*,CKTcircuit*); extern int HFETAmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int HFETAmDelete(GENmodel*); extern int HFETAmParam(int,IFvalue*,GENmodel*); extern int HFETAparam(int,IFvalue*,GENinstance*,IFvalue*); extern int HFETApzLoad(GENmodel*, CKTcircuit*, SPcomplex*); diff --git a/src/spicelib/devices/hfet1/hfetinit.c b/src/spicelib/devices/hfet1/hfetinit.c index 15b8b1e1a..05c5793d2 100644 --- a/src/spicelib/devices/hfet1/hfetinit.c +++ b/src/spicelib/devices/hfet1/hfetinit.c @@ -42,9 +42,9 @@ SPICEdev HFETAinfo = { .DEVfindBranch = NULL, .DEVacLoad = HFETAacLoad, .DEVaccept = NULL, - .DEVdestroy = HFETAdestroy, - .DEVmodDelete = HFETAmDelete, - .DEVdelete = HFETAdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = HFETAgetic, .DEVask = HFETAask, .DEVmodAsk = HFETAmAsk, diff --git a/src/spicelib/devices/hfet1/hfetmdel.c b/src/spicelib/devices/hfet1/hfetmdel.c deleted file mode 100644 index 130566802..000000000 --- a/src/spicelib/devices/hfet1/hfetmdel.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 S. Hwang -**********/ - -/* - Imported into hfeta model: Paolo Nenzi 2001 -*/ - -#include "ngspice/ngspice.h" -#include "hfetdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -HFETAmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/hfet1/hfetsetup.c b/src/spicelib/devices/hfet1/hfetsetup.c index ce6b8dc84..74fbd3329 100644 --- a/src/spicelib/devices/hfet1/hfetsetup.c +++ b/src/spicelib/devices/hfet1/hfetsetup.c @@ -249,7 +249,6 @@ HFETAsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } here->HFETAstate = *states; - /* *states += 24; */ *states += HFETAnumStates; if(model->HFETArs != 0) { diff --git a/src/spicelib/devices/hfet2/Makefile.am b/src/spicelib/devices/hfet2/Makefile.am index 14f1ad5c1..39459f208 100644 --- a/src/spicelib/devices/hfet2/Makefile.am +++ b/src/spicelib/devices/hfet2/Makefile.am @@ -7,8 +7,6 @@ libhfet2_la_SOURCES = \ hfet2acl.c \ hfet2ask.c \ hfet2defs.h \ - hfet2del.c \ - hfet2dest.c \ hfet2ext.h \ hfet2getic.c \ hfet2init.c \ @@ -16,7 +14,6 @@ libhfet2_la_SOURCES = \ hfet2itf.h \ hfet2load.c \ hfet2mask.c \ - hfet2mdel.c \ hfet2mpar.c \ hfet2param.c \ hfet2pzl.c \ diff --git a/src/spicelib/devices/hfet2/hfet2defs.h b/src/spicelib/devices/hfet2/hfet2defs.h index a41e952e3..bfa6e461a 100644 --- a/src/spicelib/devices/hfet2/hfet2defs.h +++ b/src/spicelib/devices/hfet2/hfet2defs.h @@ -63,7 +63,9 @@ typedef struct sHFET2instance { #define HFET2cqgs HFET2state+10 #define HFET2qgd HFET2state+11 #define HFET2cqgd HFET2state+12 - + +#define HFET2numStates 13 + int HFET2mode; int HFET2off; diff --git a/src/spicelib/devices/hfet2/hfet2del.c b/src/spicelib/devices/hfet2/hfet2del.c deleted file mode 100644 index e40369863..000000000 --- a/src/spicelib/devices/hfet2/hfet2del.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 S. Hwang -**********/ - -/* - Imported into hfet2 model: Paolo Nenzi 2001 -*/ - -#include "ngspice/ngspice.h" -#include "hfet2defs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -HFET2delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/hfet2/hfet2dest.c b/src/spicelib/devices/hfet2/hfet2dest.c deleted file mode 100644 index 106865818..000000000 --- a/src/spicelib/devices/hfet2/hfet2dest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Imported from MacSpice3f4 - Antony Wilson -Modified: Paolo Nenzi -**********/ - -#include "ngspice/ngspice.h" -#include "hfet2defs.h" -#include "ngspice/suffix.h" - - -void -HFET2destroy(void) -{ -} diff --git a/src/spicelib/devices/hfet2/hfet2ext.h b/src/spicelib/devices/hfet2/hfet2ext.h index 50aa89397..36b36651a 100644 --- a/src/spicelib/devices/hfet2/hfet2ext.h +++ b/src/spicelib/devices/hfet2/hfet2ext.h @@ -5,12 +5,9 @@ Author: Trond Ytterdal extern int HFET2acLoad(GENmodel*,CKTcircuit*); extern int HFET2ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int HFET2delete(GENinstance*); -extern void HFET2destroy(void); extern int HFET2getic(GENmodel*,CKTcircuit*); extern int HFET2load(GENmodel*,CKTcircuit*); extern int HFET2mAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int HFET2mDelete(GENmodel*); extern int HFET2mParam(int,IFvalue*,GENmodel*); extern int HFET2param(int,IFvalue*,GENinstance*,IFvalue*); extern int HFET2pzLoad(GENmodel*, CKTcircuit*, SPcomplex*); diff --git a/src/spicelib/devices/hfet2/hfet2init.c b/src/spicelib/devices/hfet2/hfet2init.c index 3431b5c09..fa130f255 100644 --- a/src/spicelib/devices/hfet2/hfet2init.c +++ b/src/spicelib/devices/hfet2/hfet2init.c @@ -42,9 +42,9 @@ SPICEdev HFET2info = { .DEVfindBranch = NULL, .DEVacLoad = HFET2acLoad, .DEVaccept = NULL, - .DEVdestroy = HFET2destroy, - .DEVmodDelete = HFET2mDelete, - .DEVdelete = HFET2delete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = HFET2getic, .DEVask = HFET2ask, .DEVmodAsk = HFET2mAsk, diff --git a/src/spicelib/devices/hfet2/hfet2mdel.c b/src/spicelib/devices/hfet2/hfet2mdel.c deleted file mode 100644 index 904b5d9eb..000000000 --- a/src/spicelib/devices/hfet2/hfet2mdel.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 S. Hwang -**********/ - -/* - Imported into hfet2 model: Paolo Nenzi 2001 -*/ - -#include "ngspice/ngspice.h" -#include "hfet2defs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -HFET2mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/hfet2/hfet2setup.c b/src/spicelib/devices/hfet2/hfet2setup.c index fb3fce920..ff24b1909 100644 --- a/src/spicelib/devices/hfet2/hfet2setup.c +++ b/src/spicelib/devices/hfet2/hfet2setup.c @@ -133,7 +133,7 @@ int HFET2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state IFuid tmpName; here->HFET2state = *states; - *states += 13; + *states += HFET2numStates; if(!here->HFET2lengthGiven) L = 1e-6; diff --git a/src/spicelib/devices/hisim2/Makefile.am b/src/spicelib/devices/hisim2/Makefile.am index 25e31f277..8ac5b2ade 100644 --- a/src/spicelib/devices/hisim2/Makefile.am +++ b/src/spicelib/devices/hisim2/Makefile.am @@ -10,8 +10,6 @@ libhisim2_la_SOURCES = hisim2.h \ hsm2ask.c \ hsm2cvtest.c \ hsm2def.h \ - hsm2del.c \ - hsm2dest.c \ hsm2eval.c \ hsm2evalenv.h \ hsm2eval_dep.h \ diff --git a/src/spicelib/devices/hisim2/hsm2del.c b/src/spicelib/devices/hisim2/hsm2del.c deleted file mode 100644 index 00d7c74c6..000000000 --- a/src/spicelib/devices/hisim2/hsm2del.c +++ /dev/null @@ -1,69 +0,0 @@ -/*********************************************************************** - - HiSIM (Hiroshima University STARC IGFET Model) - Copyright (C) 2014 Hiroshima University & STARC - - MODEL NAME : HiSIM - ( VERSION : 2 SUBVERSION : 8 REVISION : 0 ) - - FILE : hsm2del.c - - Date : 2014.6.5 - - released by - Hiroshima University & - Semiconductor Technology Academic Research Center (STARC) -***********************************************************************/ - -/********************************************************************** - -The following source code, and all copyrights, trade secrets or other -intellectual property rights in and to the source code in its entirety, -is owned by the Hiroshima University and the STARC organization. - -All users need to follow the "HiSIM2 Distribution Statement and -Copyright Notice" attached to HiSIM2 model. - ------HiSIM2 Distribution Statement and Copyright Notice-------------- - -Software is distributed as is, completely without warranty or service -support. Hiroshima University or STARC and its employees are not liable -for the condition or performance of the software. - -Hiroshima University and STARC own the copyright and grant users a perpetual, -irrevocable, worldwide, non-exclusive, royalty-free license with respect -to the software as set forth below. - -Hiroshima University and STARC hereby disclaim all implied warranties. - -Hiroshima University and STARC grant the users the right to modify, copy, -and redistribute the software and documentation, both within the user's -organization and externally, subject to the following restrictions - -1. The users agree not to charge for Hiroshima University and STARC code -itself but may charge for additions, extensions, or support. - -2. In any product based on the software, the users agree to acknowledge -Hiroshima University and STARC that developed the software. This -acknowledgment shall appear in the product documentation. - -3. The users agree to reproduce any copyright notice which appears on -the software on any copy or modification of such made available -to others." - - -*************************************************************************/ - -#include "ngspice/ngspice.h" -#include "hsm2def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -HSM2delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/hisim2/hsm2dest.c b/src/spicelib/devices/hisim2/hsm2dest.c deleted file mode 100644 index b74cae252..000000000 --- a/src/spicelib/devices/hisim2/hsm2dest.c +++ /dev/null @@ -1,65 +0,0 @@ -/*********************************************************************** - - HiSIM (Hiroshima University STARC IGFET Model) - Copyright (C) 2014 Hiroshima University & STARC - - MODEL NAME : HiSIM - ( VERSION : 2 SUBVERSION : 8 REVISION : 0 ) - - FILE : hsm2dest.c - - Date : 2014.6.5 - - released by - Hiroshima University & - Semiconductor Technology Academic Research Center (STARC) -***********************************************************************/ - -/********************************************************************** - -The following source code, and all copyrights, trade secrets or other -intellectual property rights in and to the source code in its entirety, -is owned by the Hiroshima University and the STARC organization. - -All users need to follow the "HiSIM2 Distribution Statement and -Copyright Notice" attached to HiSIM2 model. - ------HiSIM2 Distribution Statement and Copyright Notice-------------- - -Software is distributed as is, completely without warranty or service -support. Hiroshima University or STARC and its employees are not liable -for the condition or performance of the software. - -Hiroshima University and STARC own the copyright and grant users a perpetual, -irrevocable, worldwide, non-exclusive, royalty-free license with respect -to the software as set forth below. - -Hiroshima University and STARC hereby disclaim all implied warranties. - -Hiroshima University and STARC grant the users the right to modify, copy, -and redistribute the software and documentation, both within the user's -organization and externally, subject to the following restrictions - -1. The users agree not to charge for Hiroshima University and STARC code -itself but may charge for additions, extensions, or support. - -2. In any product based on the software, the users agree to acknowledge -Hiroshima University and STARC that developed the software. This -acknowledgment shall appear in the product documentation. - -3. The users agree to reproduce any copyright notice which appears on -the software on any copy or modification of such made available -to others." - - -*************************************************************************/ - -#include "ngspice/ngspice.h" -#include "hsm2def.h" -#include "ngspice/suffix.h" - - -void -HSM2destroy(void) -{ -} diff --git a/src/spicelib/devices/hisim2/hsm2ext.h b/src/spicelib/devices/hisim2/hsm2ext.h index 2ee6a72e3..d464f6487 100644 --- a/src/spicelib/devices/hisim2/hsm2ext.h +++ b/src/spicelib/devices/hisim2/hsm2ext.h @@ -18,8 +18,6 @@ extern int HSM2acLoad(GENmodel *,CKTcircuit*); extern int HSM2ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int HSM2convTest(GENmodel *,CKTcircuit*); -extern int HSM2delete(GENinstance*); -extern void HSM2destroy(void); extern int HSM2getic(GENmodel*,CKTcircuit*); extern int HSM2load(GENmodel*,CKTcircuit*); extern int HSM2mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); diff --git a/src/spicelib/devices/hisim2/hsm2init.c b/src/spicelib/devices/hisim2/hsm2init.c index 255dd4b64..26a5d4574 100644 --- a/src/spicelib/devices/hisim2/hsm2init.c +++ b/src/spicelib/devices/hisim2/hsm2init.c @@ -42,9 +42,9 @@ SPICEdev HSM2info = { .DEVfindBranch = NULL, .DEVacLoad = HSM2acLoad, .DEVaccept = NULL, - .DEVdestroy = HSM2destroy, + .DEVdestroy = NULL, .DEVmodDelete = HSM2mDelete, - .DEVdelete = HSM2delete, + .DEVdelete = NULL, .DEVsetic = HSM2getic, .DEVask = HSM2ask, .DEVmodAsk = HSM2mAsk, diff --git a/src/spicelib/devices/hisimhv1/Makefile.am b/src/spicelib/devices/hisimhv1/Makefile.am index 84f0f516e..bd3fd397a 100644 --- a/src/spicelib/devices/hisimhv1/Makefile.am +++ b/src/spicelib/devices/hisimhv1/Makefile.am @@ -8,8 +8,6 @@ libhisimhv1_la_SOURCES = hisimhv.h \ hsmhvask.c \ hsmhvcvtest.c \ hsmhvdef.h \ - hsmhvdel.c \ - hsmhvdest.c \ hsmhveval.c \ hsmhveval_qover.h \ hsmhvevalenv.h \ @@ -21,7 +19,6 @@ libhisimhv1_la_SOURCES = hisimhv.h \ hsmhvld.c \ hsmhvld_info_eval.h \ hsmhvmask.c \ - hsmhvmdel.c \ hsmhvmpar.c \ hsmhvnoi.c \ hsmhvpar.c \ diff --git a/src/spicelib/devices/hisimhv1/hsmhvdel.c b/src/spicelib/devices/hisimhv1/hsmhvdel.c deleted file mode 100644 index 8e1e9d818..000000000 --- a/src/spicelib/devices/hisimhv1/hsmhvdel.c +++ /dev/null @@ -1,30 +0,0 @@ -/*********************************************************************** - - HiSIM (Hiroshima University STARC IGFET Model) - Copyright (C) 2012 Hiroshima University & STARC - - MODEL NAME : HiSIM_HV - ( VERSION : 1 SUBVERSION : 2 REVISION : 4 ) - Model Parameter VERSION : 1.23 - FILE : hsmhvdel.c - - DATE : 2013.04.30 - - released by - Hiroshima University & - Semiconductor Technology Academic Research Center (STARC) -***********************************************************************/ - -#include "ngspice/ngspice.h" -#include "hsmhvdef.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -HSMHVdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/hisimhv1/hsmhvdest.c b/src/spicelib/devices/hisimhv1/hsmhvdest.c deleted file mode 100644 index ed75a539d..000000000 --- a/src/spicelib/devices/hisimhv1/hsmhvdest.c +++ /dev/null @@ -1,26 +0,0 @@ -/*********************************************************************** - - HiSIM (Hiroshima University STARC IGFET Model) - Copyright (C) 2012 Hiroshima University & STARC - - MODEL NAME : HiSIM_HV - ( VERSION : 1 SUBVERSION : 2 REVISION : 4 ) - Model Parameter VERSION : 1.23 - FILE : hsmhvdest.c - - DATE : 2013.04.30 - - released by - Hiroshima University & - Semiconductor Technology Academic Research Center (STARC) -***********************************************************************/ - -#include "ngspice/ngspice.h" -#include "hsmhvdef.h" -#include "ngspice/suffix.h" - - -void -HSMHVdestroy(void) -{ -} diff --git a/src/spicelib/devices/hisimhv1/hsmhvext.h b/src/spicelib/devices/hisimhv1/hsmhvext.h index 3be866846..3affb611b 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvext.h +++ b/src/spicelib/devices/hisimhv1/hsmhvext.h @@ -18,12 +18,9 @@ extern int HSMHVacLoad(GENmodel *,CKTcircuit*); extern int HSMHVask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int HSMHVconvTest(GENmodel *,CKTcircuit*); -extern int HSMHVdelete(GENinstance*); -extern void HSMHVdestroy(void); extern int HSMHVgetic(GENmodel*,CKTcircuit*); extern int HSMHVload(GENmodel*,CKTcircuit*); extern int HSMHVmAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int HSMHVmDelete(GENmodel*); extern int HSMHVmParam(int,IFvalue*,GENmodel*); extern void HSMHVmosCap(CKTcircuit*, double, double, double, double*, double, double, double, double, double, double, diff --git a/src/spicelib/devices/hisimhv1/hsmhvinit.c b/src/spicelib/devices/hisimhv1/hsmhvinit.c index b475949cb..3b039f189 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvinit.c +++ b/src/spicelib/devices/hisimhv1/hsmhvinit.c @@ -42,9 +42,9 @@ SPICEdev HSMHVinfo = { .DEVfindBranch = NULL, .DEVacLoad = HSMHVacLoad, .DEVaccept = NULL, - .DEVdestroy = HSMHVdestroy, - .DEVmodDelete = HSMHVmDelete, - .DEVdelete = HSMHVdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = HSMHVgetic, .DEVask = HSMHVask, .DEVmodAsk = HSMHVmAsk, diff --git a/src/spicelib/devices/hisimhv1/hsmhvmdel.c b/src/spicelib/devices/hisimhv1/hsmhvmdel.c deleted file mode 100644 index 0e8eee4cb..000000000 --- a/src/spicelib/devices/hisimhv1/hsmhvmdel.c +++ /dev/null @@ -1,29 +0,0 @@ -/*********************************************************************** - - HiSIM (Hiroshima University STARC IGFET Model) - Copyright (C) 2012 Hiroshima University & STARC - - MODEL NAME : HiSIM_HV - ( VERSION : 1 SUBVERSION : 2 REVISION : 4 ) - Model Parameter VERSION : 1.23 - FILE : hsmhvmdel.c - - DATE : 2013.04.30 - - released by - Hiroshima University & - Semiconductor Technology Academic Research Center (STARC) -***********************************************************************/ - -#include "ngspice/ngspice.h" -#include "hsmhvdef.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -HSMHVmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/hisimhv2/Makefile.am b/src/spicelib/devices/hisimhv2/Makefile.am index 5ced87ca9..065170e72 100644 --- a/src/spicelib/devices/hisimhv2/Makefile.am +++ b/src/spicelib/devices/hisimhv2/Makefile.am @@ -8,8 +8,6 @@ libhisimhv2_la_SOURCES = hisimhv2.h \ hsmhv2ask.c \ hsmhv2cvtest.c \ hsmhv2def.h \ - hsmhv2del.c \ - hsmhv2dest.c \ hsmhv2eval.c \ hsmhv2eval_dep.h \ hsmhv2eval_dio.c \ @@ -24,7 +22,6 @@ libhisimhv2_la_SOURCES = hisimhv2.h \ hsmhv2ld.c \ hsmhv2ld_info_eval.h \ hsmhv2mask.c \ - hsmhv2mdel.c \ hsmhv2mpar.c \ hsmhv2noi.c \ hsmhv2par.c \ diff --git a/src/spicelib/devices/hisimhv2/hsmhv2del.c b/src/spicelib/devices/hisimhv2/hsmhv2del.c deleted file mode 100644 index ea81a14b8..000000000 --- a/src/spicelib/devices/hisimhv2/hsmhv2del.c +++ /dev/null @@ -1,72 +0,0 @@ -/*********************************************************************** - - HiSIM (Hiroshima University STARC IGFET Model) - Copyright (C) 2014 Hiroshima University & STARC - - MODEL NAME : HiSIM_HV - ( VERSION : 2 SUBVERSION : 2 REVISION : 0 ) - Model Parameter 'VERSION' : 2.20 - FILE : hsmhvdel.c - - DATE : 2014.6.11 - - released by - Hiroshima University & - Semiconductor Technology Academic Research Center (STARC) -***********************************************************************/ - -/********************************************************************** - -The following source code, and all copyrights, trade secrets or other -intellectual property rights in and to the source code in its entirety, -is owned by the Hiroshima University and the STARC organization. - -All users need to follow the "HISIM_HV Distribution Statement and -Copyright Notice" attached to HiSIM_HV model. - ------HISIM_HV Distribution Statement and Copyright Notice-------------- - -Software is distributed as is, completely without warranty or service -support. Hiroshima University or STARC and its employees are not liable -for the condition or performance of the software. - -Hiroshima University and STARC own the copyright and grant users a perpetual, -irrevocable, worldwide, non-exclusive, royalty-free license with respect -to the software as set forth below. - -Hiroshima University and STARC hereby disclaims all implied warranties. - -Hiroshima University and STARC grant the users the right to modify, copy, -and redistribute the software and documentation, both within the user's -organization and externally, subject to the following restrictions - -1. The users agree not to charge for Hiroshima University and STARC code -itself but may charge for additions, extensions, or support. - -2. In any product based on the software, the users agree to acknowledge -Hiroshima University and STARC that developed the software. This -acknowledgment shall appear in the product documentation. - -3. The users agree to reproduce any copyright notice which appears on -the software on any copy or modification of such made available -to others." - -Toshimasa Asahara, President, Hiroshima University -Mitiko Miura-Mattausch, Professor, Hiroshima University -Katsuhiro Shimohigashi, President&CEO, STARC -June 2008 (revised October 2011) -*************************************************************************/ - -#include "ngspice/ngspice.h" -#include "hsmhv2def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -HSMHV2delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/hisimhv2/hsmhv2dest.c b/src/spicelib/devices/hisimhv2/hsmhv2dest.c deleted file mode 100644 index f18b95701..000000000 --- a/src/spicelib/devices/hisimhv2/hsmhv2dest.c +++ /dev/null @@ -1,68 +0,0 @@ -/*********************************************************************** - - HiSIM (Hiroshima University STARC IGFET Model) - Copyright (C) 2014 Hiroshima University & STARC - - MODEL NAME : HiSIM_HV - ( VERSION : 2 SUBVERSION : 2 REVISION : 0 ) - Model Parameter 'VERSION' : 2.20 - FILE : hsmhvdest.c - - DATE : 2014.6.11 - - released by - Hiroshima University & - Semiconductor Technology Academic Research Center (STARC) -***********************************************************************/ - -/********************************************************************** - -The following source code, and all copyrights, trade secrets or other -intellectual property rights in and to the source code in its entirety, -is owned by the Hiroshima University and the STARC organization. - -All users need to follow the "HISIM_HV Distribution Statement and -Copyright Notice" attached to HiSIM_HV model. - ------HISIM_HV Distribution Statement and Copyright Notice-------------- - -Software is distributed as is, completely without warranty or service -support. Hiroshima University or STARC and its employees are not liable -for the condition or performance of the software. - -Hiroshima University and STARC own the copyright and grant users a perpetual, -irrevocable, worldwide, non-exclusive, royalty-free license with respect -to the software as set forth below. - -Hiroshima University and STARC hereby disclaims all implied warranties. - -Hiroshima University and STARC grant the users the right to modify, copy, -and redistribute the software and documentation, both within the user's -organization and externally, subject to the following restrictions - -1. The users agree not to charge for Hiroshima University and STARC code -itself but may charge for additions, extensions, or support. - -2. In any product based on the software, the users agree to acknowledge -Hiroshima University and STARC that developed the software. This -acknowledgment shall appear in the product documentation. - -3. The users agree to reproduce any copyright notice which appears on -the software on any copy or modification of such made available -to others." - -Toshimasa Asahara, President, Hiroshima University -Mitiko Miura-Mattausch, Professor, Hiroshima University -Katsuhiro Shimohigashi, President&CEO, STARC -June 2008 (revised October 2011) -*************************************************************************/ - -#include "ngspice/ngspice.h" -#include "hsmhv2def.h" -#include "ngspice/suffix.h" - - -void -HSMHV2destroy(void) -{ -} diff --git a/src/spicelib/devices/hisimhv2/hsmhv2ext.h b/src/spicelib/devices/hisimhv2/hsmhv2ext.h index e878e7fb4..6261c386c 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2ext.h +++ b/src/spicelib/devices/hisimhv2/hsmhv2ext.h @@ -18,12 +18,9 @@ extern int HSMHV2acLoad(GENmodel *,CKTcircuit*); extern int HSMHV2ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int HSMHV2convTest(GENmodel *,CKTcircuit*); -extern int HSMHV2delete(GENinstance*); -extern void HSMHV2destroy(void); extern int HSMHV2getic(GENmodel*,CKTcircuit*); extern int HSMHV2load(GENmodel*,CKTcircuit*); extern int HSMHV2mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int HSMHV2mDelete(GENmodel*); extern int HSMHV2mParam(int,IFvalue*,GENmodel*); extern void HSMHV2mosCap(CKTcircuit*, double, double, double, double*, double, double, double, double, double, double, diff --git a/src/spicelib/devices/hisimhv2/hsmhv2init.c b/src/spicelib/devices/hisimhv2/hsmhv2init.c index 56fba5583..7c0efa75b 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2init.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2init.c @@ -42,9 +42,9 @@ SPICEdev HSMHV2info = { .DEVfindBranch = NULL, .DEVacLoad = HSMHV2acLoad, .DEVaccept = NULL, - .DEVdestroy = HSMHV2destroy, - .DEVmodDelete = HSMHV2mDelete, - .DEVdelete = HSMHV2delete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = HSMHV2getic, .DEVask = HSMHV2ask, .DEVmodAsk = HSMHV2mAsk, diff --git a/src/spicelib/devices/hisimhv2/hsmhv2mdel.c b/src/spicelib/devices/hisimhv2/hsmhv2mdel.c deleted file mode 100644 index 940f6e010..000000000 --- a/src/spicelib/devices/hisimhv2/hsmhv2mdel.c +++ /dev/null @@ -1,71 +0,0 @@ -/*********************************************************************** - - HiSIM (Hiroshima University STARC IGFET Model) - Copyright (C) 2014 Hiroshima University & STARC - - MODEL NAME : HiSIM_HV - ( VERSION : 2 SUBVERSION : 2 REVISION : 0 ) - Model Parameter 'VERSION' : 2.20 - FILE : hsmhvmdel.c - - DATE : 2014.6.11 - - released by - Hiroshima University & - Semiconductor Technology Academic Research Center (STARC) -***********************************************************************/ - -/********************************************************************** - -The following source code, and all copyrights, trade secrets or other -intellectual property rights in and to the source code in its entirety, -is owned by the Hiroshima University and the STARC organization. - -All users need to follow the "HISIM_HV Distribution Statement and -Copyright Notice" attached to HiSIM_HV model. - ------HISIM_HV Distribution Statement and Copyright Notice-------------- - -Software is distributed as is, completely without warranty or service -support. Hiroshima University or STARC and its employees are not liable -for the condition or performance of the software. - -Hiroshima University and STARC own the copyright and grant users a perpetual, -irrevocable, worldwide, non-exclusive, royalty-free license with respect -to the software as set forth below. - -Hiroshima University and STARC hereby disclaims all implied warranties. - -Hiroshima University and STARC grant the users the right to modify, copy, -and redistribute the software and documentation, both within the user's -organization and externally, subject to the following restrictions - -1. The users agree not to charge for Hiroshima University and STARC code -itself but may charge for additions, extensions, or support. - -2. In any product based on the software, the users agree to acknowledge -Hiroshima University and STARC that developed the software. This -acknowledgment shall appear in the product documentation. - -3. The users agree to reproduce any copyright notice which appears on -the software on any copy or modification of such made available -to others." - -Toshimasa Asahara, President, Hiroshima University -Mitiko Miura-Mattausch, Professor, Hiroshima University -Katsuhiro Shimohigashi, President&CEO, STARC -June 2008 (revised October 2011) -*************************************************************************/ - -#include "ngspice/ngspice.h" -#include "hsmhv2def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -HSMHV2mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/ind/Makefile.am b/src/spicelib/devices/ind/Makefile.am index 320fdd85e..7cbfebbcf 100644 --- a/src/spicelib/devices/ind/Makefile.am +++ b/src/spicelib/devices/ind/Makefile.am @@ -7,15 +7,12 @@ libind_la_SOURCES = \ indacld.c \ indask.c \ inddefs.h \ - inddel.c \ - inddest.c \ indext.h \ indinit.c \ indinit.h \ inditf.h \ indload.c \ indmask.c \ - indmdel.c \ indmpar.c \ indparam.c \ indpzld.c \ @@ -29,9 +26,6 @@ libind_la_SOURCES = \ indtrunc.c \ mutacld.c \ mutask.c \ - mutdel.c \ - mutdest.c \ - mutmdel.c \ mutparam.c \ mutpzld.c \ mutsetup.c \ diff --git a/src/spicelib/devices/ind/inddefs.h b/src/spicelib/devices/ind/inddefs.h index a157dc3ea..e2ff89c21 100644 --- a/src/spicelib/devices/ind/inddefs.h +++ b/src/spicelib/devices/ind/inddefs.h @@ -89,10 +89,15 @@ struct sINDinstance { #define INDflux INDstate /* flux in the inductor */ #define INDvolt INDstate+1 /* voltage - save an entry in table */ + +#define INDnumStates 2 + #define INDsensxp INDstate+2 /* charge sensitivities and their derivatives. * +3 for the derivatives - pointer to the * beginning of the array */ +#define INDnumSenStates 2 + #ifdef USE_CUSPICE typedef struct sINDparamCPUstruct { double *INDcpuPointersD [4]; diff --git a/src/spicelib/devices/ind/inddel.c b/src/spicelib/devices/ind/inddel.c deleted file mode 100644 index 0bca432ae..000000000 --- a/src/spicelib/devices/ind/inddel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "inddefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -INDdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/ind/inddest.c b/src/spicelib/devices/ind/inddest.c deleted file mode 100644 index 83d4a35dd..000000000 --- a/src/spicelib/devices/ind/inddest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "inddefs.h" -#include "ngspice/suffix.h" - - -void -INDdestroy(void) -{ -} diff --git a/src/spicelib/devices/ind/indext.h b/src/spicelib/devices/ind/indext.h index 7416dea3e..6bd0cf95b 100644 --- a/src/spicelib/devices/ind/indext.h +++ b/src/spicelib/devices/ind/indext.h @@ -8,10 +8,7 @@ Author: 1985 Thomas L. Quarles extern int INDacLoad(GENmodel*,CKTcircuit*); extern int INDask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int INDmAsk(CKTcircuit*, GENmodel*, int, IFvalue*); -extern int INDdelete(GENinstance*); -extern void INDdestroy(void); extern int INDload(GENmodel*,CKTcircuit*); -extern int INDmDelete(GENmodel*); extern int INDmParam(int, IFvalue*, GENmodel*); extern int INDparam(int,IFvalue*,GENinstance*,IFvalue*); extern int INDpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); @@ -27,9 +24,6 @@ extern int INDtrunc(GENmodel*,CKTcircuit*,double*); extern int MUTacLoad(GENmodel*,CKTcircuit*); extern int MUTask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int MUTdelete(GENinstance*); -extern void MUTdestroy(void); -extern int MUTmDelete(GENmodel*); extern int MUTparam(int,IFvalue*,GENinstance*,IFvalue*); extern int MUTpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern void MUTsPrint(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/ind/indinit.c b/src/spicelib/devices/ind/indinit.c index c2149ca6c..55f5cfd47 100644 --- a/src/spicelib/devices/ind/indinit.c +++ b/src/spicelib/devices/ind/indinit.c @@ -53,9 +53,9 @@ SPICEdev INDinfo = { .DEVfindBranch = NULL, .DEVacLoad = INDacLoad, .DEVaccept = NULL, - .DEVdestroy = INDdestroy, - .DEVmodDelete = INDmDelete, - .DEVdelete = INDdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = INDask, .DEVmodAsk = INDmAsk, @@ -128,9 +128,9 @@ SPICEdev MUTinfo = { .DEVfindBranch = NULL, .DEVacLoad = MUTacLoad, .DEVaccept = NULL, - .DEVdestroy = MUTdestroy, - .DEVmodDelete = MUTmDelete, - .DEVdelete = MUTdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = MUTask, .DEVmodAsk = NULL, diff --git a/src/spicelib/devices/ind/indmdel.c b/src/spicelib/devices/ind/indmdel.c deleted file mode 100644 index 5fa94a360..000000000 --- a/src/spicelib/devices/ind/indmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "inddefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -INDmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/ind/indsetup.c b/src/spicelib/devices/ind/indsetup.c index 889cb468d..b5ef543ea 100644 --- a/src/spicelib/devices/ind/indsetup.c +++ b/src/spicelib/devices/ind/indsetup.c @@ -80,9 +80,9 @@ INDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) here=INDnextInstance(here)) { here->INDflux = *states; - *states += 2 ; + *states += INDnumStates ; if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & TRANSEN) ){ - *states += 2 * (ckt->CKTsenInfo->SENparms); + *states += INDnumSenStates * (ckt->CKTsenInfo->SENparms); } if(here->INDbrEq == 0) { diff --git a/src/spicelib/devices/ind/mutdel.c b/src/spicelib/devices/ind/mutdel.c deleted file mode 100644 index b5ee1b71c..000000000 --- a/src/spicelib/devices/ind/mutdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "inddefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -MUTdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/ind/mutdest.c b/src/spicelib/devices/ind/mutdest.c deleted file mode 100644 index ca6d239de..000000000 --- a/src/spicelib/devices/ind/mutdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "inddefs.h" -#include "ngspice/suffix.h" - - -void -MUTdestroy(void) -{ -} diff --git a/src/spicelib/devices/ind/mutmdel.c b/src/spicelib/devices/ind/mutmdel.c deleted file mode 100644 index 42e7f76af..000000000 --- a/src/spicelib/devices/ind/mutmdel.c +++ /dev/null @@ -1,16 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "inddefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - -int -MUTmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/isrc/Makefile.am b/src/spicelib/devices/isrc/Makefile.am index 3b9598b80..20482638a 100644 --- a/src/spicelib/devices/isrc/Makefile.am +++ b/src/spicelib/devices/isrc/Makefile.am @@ -9,13 +9,11 @@ libisrc_la_SOURCES = \ isrcask.c \ isrcdefs.h \ isrcdel.c \ - isrcdest.c \ isrcext.h \ isrcinit.c \ isrcinit.h \ isrcitf.h \ isrcload.c \ - isrcmdel.c \ isrcpar.c \ isrctemp.c diff --git a/src/spicelib/devices/isrc/isrcdefs.h b/src/spicelib/devices/isrc/isrcdefs.h index b761a2e33..0c21e56bb 100644 --- a/src/spicelib/devices/isrc/isrcdefs.h +++ b/src/spicelib/devices/isrc/isrcdefs.h @@ -138,7 +138,8 @@ typedef struct sISRCmodel { /* source types */ -#ifndef PULSE +#ifndef PULSE_FUN_TYPES +#define PULSE_FUN_TYPES #define PULSE 1 #define SINE 2 #define EXP 3 @@ -148,7 +149,7 @@ typedef struct sISRCmodel { #define TRNOISE 7 #define TRRANDOM 8 #define EXTERNAL 9 -#endif /*PULSE*/ +#endif /* device parameters */ #define ISRC_DC 1 diff --git a/src/spicelib/devices/isrc/isrcdest.c b/src/spicelib/devices/isrc/isrcdest.c deleted file mode 100644 index 80b777641..000000000 --- a/src/spicelib/devices/isrc/isrcdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "isrcdefs.h" -#include "ngspice/suffix.h" - - -void -ISRCdestroy(void) -{ -} diff --git a/src/spicelib/devices/isrc/isrcext.h b/src/spicelib/devices/isrc/isrcext.h index 5462389a8..1fdb6bfb0 100644 --- a/src/spicelib/devices/isrc/isrcext.h +++ b/src/spicelib/devices/isrc/isrcext.h @@ -7,9 +7,7 @@ extern int ISRCaccept(CKTcircuit*,GENmodel*); extern int ISRCacLoad(GENmodel*,CKTcircuit*); extern int ISRCask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int ISRCdelete(GENinstance*); -extern void ISRCdestroy(void); extern int ISRCload(GENmodel*,CKTcircuit*); -extern int ISRCmDelete(GENmodel*); extern int ISRCparam(int,IFvalue*,GENinstance*,IFvalue*); extern int ISRCpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int ISRCtemp(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/isrc/isrcinit.c b/src/spicelib/devices/isrc/isrcinit.c index 9ebaf6394..9554fd3b6 100644 --- a/src/spicelib/devices/isrc/isrcinit.c +++ b/src/spicelib/devices/isrc/isrcinit.c @@ -53,8 +53,8 @@ SPICEdev ISRCinfo = { .DEVfindBranch = NULL, .DEVacLoad = ISRCacLoad, .DEVaccept = ISRCaccept, - .DEVdestroy = ISRCdestroy, - .DEVmodDelete = ISRCmDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = ISRCdelete, .DEVsetic = NULL, .DEVask = ISRCask, diff --git a/src/spicelib/devices/isrc/isrcmdel.c b/src/spicelib/devices/isrc/isrcmdel.c deleted file mode 100644 index 5184d7781..000000000 --- a/src/spicelib/devices/isrc/isrcmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "isrcdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -ISRCmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/jfet/Makefile.am b/src/spicelib/devices/jfet/Makefile.am index 2f7947dfe..911561909 100644 --- a/src/spicelib/devices/jfet/Makefile.am +++ b/src/spicelib/devices/jfet/Makefile.am @@ -7,8 +7,6 @@ libjfet_la_SOURCES = \ jfetacld.c \ jfetask.c \ jfetdefs.h \ - jfetdel.c \ - jfetdest.c \ jfetdist.c \ jfetdset.c \ jfetext.h \ @@ -18,7 +16,6 @@ libjfet_la_SOURCES = \ jfetitf.h \ jfetload.c \ jfetmask.c \ - jfetmdel.c \ jfetmpar.c \ jfetnoi.c \ jfetpar.c \ diff --git a/src/spicelib/devices/jfet/jfetdefs.h b/src/spicelib/devices/jfet/jfetdefs.h index 701dc0375..ae8c02412 100644 --- a/src/spicelib/devices/jfet/jfetdefs.h +++ b/src/spicelib/devices/jfet/jfetdefs.h @@ -17,6 +17,15 @@ Sydney University mods Copyright(c) 1989 Anthony E. Parker, David J. Skellern /* structures used to describe Junction Field Effect Transistors */ +/* indices to an array of JFET noise sources */ + +#define JFETRDNOIZ 0 +#define JFETRSNOIZ 1 +#define JFETIDNOIZ 2 +#define JFETFLNOIZ 3 +#define JFETTOTNOIZ 4 + +#define JFETNSRCS 5 /* information used to describe a single instance */ @@ -111,16 +120,6 @@ typedef struct sJFETinstance { #endif -/* indices to an array of JFET noise sources */ - -#define JFETRDNOIZ 0 -#define JFETRSNOIZ 1 -#define JFETIDNOIZ 2 -#define JFETFLNOIZ 3 -#define JFETTOTNOIZ 4 - -#define JFETNSRCS 5 - #ifndef NONOISE double JFETnVar[NSTATVARS][JFETNSRCS]; #else /* NONOISE */ @@ -186,6 +185,8 @@ typedef struct sJFETinstance { #define JFETqgd JFETstate+11 #define JFETcqgd JFETstate+12 +#define JFETnumStates 13 + /* per model data */ typedef struct sJFETmodel { /* model structure for a jfet */ diff --git a/src/spicelib/devices/jfet/jfetdel.c b/src/spicelib/devices/jfet/jfetdel.c deleted file mode 100644 index 02f863bab..000000000 --- a/src/spicelib/devices/jfet/jfetdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "jfetdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -JFETdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/jfet/jfetdest.c b/src/spicelib/devices/jfet/jfetdest.c deleted file mode 100644 index 7cef1f77a..000000000 --- a/src/spicelib/devices/jfet/jfetdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "jfetdefs.h" -#include "ngspice/suffix.h" - - -void -JFETdestroy(void) -{ -} diff --git a/src/spicelib/devices/jfet/jfetext.h b/src/spicelib/devices/jfet/jfetext.h index 4c84249b1..3b12ac530 100644 --- a/src/spicelib/devices/jfet/jfetext.h +++ b/src/spicelib/devices/jfet/jfetext.h @@ -6,12 +6,9 @@ Modified: 2000 AlansFixes extern int JFETacLoad(GENmodel*,CKTcircuit*); extern int JFETask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int JFETdelete(GENinstance*); -extern void JFETdestroy(void); extern int JFETgetic(GENmodel*,CKTcircuit*); extern int JFETload(GENmodel*,CKTcircuit*); extern int JFETmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int JFETmDelete(GENmodel*); extern int JFETmParam(int,IFvalue*,GENmodel*); extern int JFETparam(int,IFvalue*,GENinstance*,IFvalue*); extern int JFETpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/jfet/jfetinit.c b/src/spicelib/devices/jfet/jfetinit.c index 6825cddbf..04e798df3 100644 --- a/src/spicelib/devices/jfet/jfetinit.c +++ b/src/spicelib/devices/jfet/jfetinit.c @@ -42,9 +42,9 @@ SPICEdev JFETinfo = { .DEVfindBranch = NULL, .DEVacLoad = JFETacLoad, .DEVaccept = NULL, - .DEVdestroy = JFETdestroy, - .DEVmodDelete = JFETmDelete, - .DEVdelete = JFETdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = JFETgetic, .DEVask = JFETask, .DEVmodAsk = JFETmAsk, diff --git a/src/spicelib/devices/jfet/jfetmdel.c b/src/spicelib/devices/jfet/jfetmdel.c deleted file mode 100644 index f65a36079..000000000 --- a/src/spicelib/devices/jfet/jfetmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "jfetdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -JFETmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/jfet/jfetset.c b/src/spicelib/devices/jfet/jfetset.c index 0089aca18..8250faa23 100644 --- a/src/spicelib/devices/jfet/jfetset.c +++ b/src/spicelib/devices/jfet/jfetset.c @@ -115,7 +115,7 @@ JFETsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) here->JFETm = 1; } here->JFETstate = *states; - *states += 13; + *states += JFETnumStates; if(model->JFETsourceResist != 0) { if(here->JFETsourcePrimeNode == 0) { diff --git a/src/spicelib/devices/jfet2/Makefile.am b/src/spicelib/devices/jfet2/Makefile.am index c0f9dd189..59ea33206 100644 --- a/src/spicelib/devices/jfet2/Makefile.am +++ b/src/spicelib/devices/jfet2/Makefile.am @@ -7,8 +7,6 @@ libjfet2_la_SOURCES = \ jfet2acld.c \ jfet2ask.c \ jfet2defs.h \ - jfet2del.c \ - jfet2dest.c \ jfet2ext.h \ jfet2ic.c \ jfet2init.c \ @@ -16,7 +14,6 @@ libjfet2_la_SOURCES = \ jfet2itf.h \ jfet2load.c \ jfet2mask.c \ - jfet2mdel.c \ jfet2mpar.c \ jfet2noi.c \ jfet2par.c \ diff --git a/src/spicelib/devices/jfet2/jfet2defs.h b/src/spicelib/devices/jfet2/jfet2defs.h index f8b2a230b..916ae744b 100644 --- a/src/spicelib/devices/jfet2/jfet2defs.h +++ b/src/spicelib/devices/jfet2/jfet2defs.h @@ -22,6 +22,15 @@ Modified to add PS model and new parameter definitions ( Anthony E. Parker ) /* structures used to describe Junction Field Effect Transistors */ +/* indices to an array of JFET2 noise sources */ + +#define JFET2RDNOIZ 0 +#define JFET2RSNOIZ 1 +#define JFET2IDNOIZ 2 +#define JFET2FLNOIZ 3 +#define JFET2TOTNOIZ 4 + +#define JFET2NSRCS 5 /* information used to describe a single instance */ @@ -116,16 +125,6 @@ typedef struct sJFET2instance { #endif -/* indices to an array of JFET2 noise sources */ - -#define JFET2RDNOIZ 0 -#define JFET2RSNOIZ 1 -#define JFET2IDNOIZ 2 -#define JFET2FLNOIZ 3 -#define JFET2TOTNOIZ 4 - -#define JFET2NSRCS 5 - #ifndef NONOISE double JFET2nVar[NSTATVARS][JFET2NSRCS]; #else /* NONOISE */ @@ -196,7 +195,9 @@ typedef struct sJFET2instance { #define JFET2pave JFET2state+15 #define JFET2vtrap JFET2state+16 #define JFET2vgstrap JFET2state+17 -#define JFET2_STATE_COUNT 18 +#define JFET2unknown JFET2state+18 + +#define JFET2numStates 19 /* per model data */ diff --git a/src/spicelib/devices/jfet2/jfet2del.c b/src/spicelib/devices/jfet2/jfet2del.c deleted file mode 100644 index c4f457ab7..000000000 --- a/src/spicelib/devices/jfet2/jfet2del.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** -Based on jfetdel.c -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles - -Modified to jfet2 for PS model definition ( Anthony E. Parker ) - Copyright 1994 Macquarie University, Sydney Australia. -**********/ - -#include "ngspice/ngspice.h" -#include "jfet2defs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -JFET2delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/jfet2/jfet2dest.c b/src/spicelib/devices/jfet2/jfet2dest.c deleted file mode 100644 index db9e122bd..000000000 --- a/src/spicelib/devices/jfet2/jfet2dest.c +++ /dev/null @@ -1,18 +0,0 @@ -/********** -Based on jfetdest.c -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles - -Modified to jfet2 for PS model definition ( Anthony E. Parker ) - Copyright 1994 Macquarie University, Sydney Australia. -**********/ - -#include "ngspice/ngspice.h" -#include "jfet2defs.h" -#include "ngspice/suffix.h" - - -void -JFET2destroy(void) -{ -} diff --git a/src/spicelib/devices/jfet2/jfet2ext.h b/src/spicelib/devices/jfet2/jfet2ext.h index 128424625..20b6508cc 100644 --- a/src/spicelib/devices/jfet2/jfet2ext.h +++ b/src/spicelib/devices/jfet2/jfet2ext.h @@ -9,12 +9,9 @@ Modified to add PS model and new parameter definitions ( Anthony E. Parker ) extern int JFET2acLoad(GENmodel*,CKTcircuit*); extern int JFET2ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int JFET2delete(GENinstance*); -extern void JFET2destroy(void); extern int JFET2getic(GENmodel*,CKTcircuit*); extern int JFET2load(GENmodel*,CKTcircuit*); extern int JFET2mAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int JFET2mDelete(GENmodel*); extern int JFET2mParam(int,IFvalue*,GENmodel*); extern int JFET2param(int,IFvalue*,GENinstance*,IFvalue*); extern int JFET2setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); diff --git a/src/spicelib/devices/jfet2/jfet2init.c b/src/spicelib/devices/jfet2/jfet2init.c index 1187a26a7..d1746779f 100644 --- a/src/spicelib/devices/jfet2/jfet2init.c +++ b/src/spicelib/devices/jfet2/jfet2init.c @@ -42,9 +42,9 @@ SPICEdev JFET2info = { .DEVfindBranch = NULL, .DEVacLoad = JFET2acLoad, .DEVaccept = NULL, - .DEVdestroy = JFET2destroy, - .DEVmodDelete = JFET2mDelete, - .DEVdelete = JFET2delete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = JFET2getic, .DEVask = JFET2ask, .DEVmodAsk = JFET2mAsk, diff --git a/src/spicelib/devices/jfet2/jfet2mdel.c b/src/spicelib/devices/jfet2/jfet2mdel.c deleted file mode 100644 index 1a6731c9c..000000000 --- a/src/spicelib/devices/jfet2/jfet2mdel.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** -based on jfetmdel.c -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles - -Modified to jfet2 for PS model definition ( Anthony E. Parker ) - Copyright 1994 Macquarie University, Sydney Australia. -**********/ - -#include "ngspice/ngspice.h" -#include "jfet2defs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -JFET2mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/jfet2/jfet2set.c b/src/spicelib/devices/jfet2/jfet2set.c index 5a6e07ac1..7ac6482fa 100644 --- a/src/spicelib/devices/jfet2/jfet2set.c +++ b/src/spicelib/devices/jfet2/jfet2set.c @@ -55,7 +55,7 @@ JFET2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } here->JFET2state = *states; - *states += JFET2_STATE_COUNT + 1; + *states += JFET2numStates; if(model->JFET2rs != 0) { if(here->JFET2sourcePrimeNode == 0) { diff --git a/src/spicelib/devices/ltra/Makefile.am b/src/spicelib/devices/ltra/Makefile.am index c65eb5fff..d7ad71805 100644 --- a/src/spicelib/devices/ltra/Makefile.am +++ b/src/spicelib/devices/ltra/Makefile.am @@ -8,15 +8,12 @@ libltra_la_SOURCES = \ ltraacld.c \ ltraask.c \ ltradefs.h \ - ltradel.c \ - ltradest.c \ ltraext.h \ ltrainit.c \ ltrainit.h \ ltraitf.h \ ltraload.c \ ltramask.c \ - ltramdel.c \ ltramisc.c \ ltrampar.c \ ltrapar.c \ diff --git a/src/spicelib/devices/ltra/ltradel.c b/src/spicelib/devices/ltra/ltradel.c deleted file mode 100644 index 394566a73..000000000 --- a/src/spicelib/devices/ltra/ltradel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1990 Jaijeet S. Roychowdhury -**********/ - -#include "ngspice/ngspice.h" -#include "ltradefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -LTRAdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/ltra/ltradest.c b/src/spicelib/devices/ltra/ltradest.c deleted file mode 100644 index af83f771f..000000000 --- a/src/spicelib/devices/ltra/ltradest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1990 Jaijeet S. Roychowdhury -**********/ - -#include "ngspice/ngspice.h" -#include "ltradefs.h" -#include "ngspice/suffix.h" - - -void -LTRAdestroy(void) -{ -} diff --git a/src/spicelib/devices/ltra/ltraext.h b/src/spicelib/devices/ltra/ltraext.h index 595352301..1cdca8b25 100644 --- a/src/spicelib/devices/ltra/ltraext.h +++ b/src/spicelib/devices/ltra/ltraext.h @@ -8,11 +8,8 @@ Modified: 2000 AlansFixes extern int LTRAaccept(CKTcircuit*,GENmodel*); extern int LTRAask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int LTRAacLoad(GENmodel*,CKTcircuit*); -extern int LTRAdelete(GENinstance*); -extern void LTRAdestroy(void); extern int LTRAload(GENmodel*,CKTcircuit*); extern int LTRAmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int LTRAmDelete(GENmodel*); extern int LTRAparam(int,IFvalue*,GENinstance*,IFvalue*); extern int LTRAmParam(int,IFvalue*,GENmodel*); extern int LTRAsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); diff --git a/src/spicelib/devices/ltra/ltrainit.c b/src/spicelib/devices/ltra/ltrainit.c index 08a95fcd5..e905a4da2 100644 --- a/src/spicelib/devices/ltra/ltrainit.c +++ b/src/spicelib/devices/ltra/ltrainit.c @@ -42,9 +42,9 @@ SPICEdev LTRAinfo = { .DEVfindBranch = NULL, .DEVacLoad = LTRAacLoad, .DEVaccept = LTRAaccept, - .DEVdestroy = LTRAdestroy, - .DEVmodDelete = LTRAmDelete, - .DEVdelete = LTRAdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = LTRAask, .DEVmodAsk = LTRAmAsk, diff --git a/src/spicelib/devices/ltra/ltramdel.c b/src/spicelib/devices/ltra/ltramdel.c deleted file mode 100644 index 279b52a63..000000000 --- a/src/spicelib/devices/ltra/ltramdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1990 Jaijeet S. Roychowdhury -**********/ - -#include "ngspice/ngspice.h" -#include "ltradefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -LTRAmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/mes/Makefile.am b/src/spicelib/devices/mes/Makefile.am index adbdfc555..19fe5026f 100644 --- a/src/spicelib/devices/mes/Makefile.am +++ b/src/spicelib/devices/mes/Makefile.am @@ -7,8 +7,6 @@ libmes_la_SOURCES = \ mesacl.c \ mesask.c \ mesdefs.h \ - mesdel.c \ - mesdest.c \ mesdisto.c \ mesdset.c \ mesext.h \ @@ -18,7 +16,6 @@ libmes_la_SOURCES = \ mesitf.h \ mesload.c \ mesmask.c \ - mesmdel.c \ mesmpar.c \ mesnoise.c \ mesparam.c \ diff --git a/src/spicelib/devices/mes/mesdefs.h b/src/spicelib/devices/mes/mesdefs.h index 24fa8b443..bc0a33615 100644 --- a/src/spicelib/devices/mes/mesdefs.h +++ b/src/spicelib/devices/mes/mesdefs.h @@ -16,6 +16,15 @@ Author: 1985 S. Hwang /* structures used to describe MESFET Transistors */ +/* indices to the array of MESFET noise sources */ + +#define MESRDNOIZ 0 +#define MESRSNOIZ 1 +#define MESIDNOIZ 2 +#define MESFLNOIZ 3 +#define MESTOTNOIZ 4 + +#define MESNSRCS 5 /* the number of MESFET noise sources */ /* information used to describe a single instance */ @@ -128,16 +137,6 @@ int MESmode; #endif -/* indices to the array of MESFET noise sources */ - -#define MESRDNOIZ 0 -#define MESRSNOIZ 1 -#define MESIDNOIZ 2 -#define MESFLNOIZ 3 -#define MESTOTNOIZ 4 - -#define MESNSRCS 5 /* the number of MESFET noise sources */ - #ifndef NONOISE double MESnVar[NSTATVARS][MESNSRCS]; #else /* NONOISE */ diff --git a/src/spicelib/devices/mes/mesdel.c b/src/spicelib/devices/mes/mesdel.c deleted file mode 100644 index d45785465..000000000 --- a/src/spicelib/devices/mes/mesdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 S. Hwang -**********/ - -#include "ngspice/ngspice.h" -#include "mesdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -MESdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/mes/mesdest.c b/src/spicelib/devices/mes/mesdest.c deleted file mode 100644 index 5e99240a4..000000000 --- a/src/spicelib/devices/mes/mesdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 S. Hwang -**********/ - -#include "ngspice/ngspice.h" -#include "mesdefs.h" -#include "ngspice/suffix.h" - - -void -MESdestroy(void) -{ -} diff --git a/src/spicelib/devices/mes/mesext.h b/src/spicelib/devices/mes/mesext.h index ce436a4ed..61f8c3dac 100644 --- a/src/spicelib/devices/mes/mesext.h +++ b/src/spicelib/devices/mes/mesext.h @@ -6,12 +6,9 @@ Modified: 2000 AlansFixes extern int MESacLoad(GENmodel*,CKTcircuit*); extern int MESask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int MESdelete(GENinstance*); -extern void MESdestroy(void); extern int MESgetic(GENmodel*,CKTcircuit*); extern int MESload(GENmodel*,CKTcircuit*); extern int MESmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int MESmDelete(GENmodel*); extern int MESmParam(int,IFvalue*,GENmodel*); extern int MESparam(int,IFvalue*,GENinstance*,IFvalue*); extern int MESpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/mes/mesinit.c b/src/spicelib/devices/mes/mesinit.c index ecc4c24d3..98dd3ab83 100644 --- a/src/spicelib/devices/mes/mesinit.c +++ b/src/spicelib/devices/mes/mesinit.c @@ -42,9 +42,9 @@ SPICEdev MESinfo = { .DEVfindBranch = NULL, .DEVacLoad = MESacLoad, .DEVaccept = NULL, - .DEVdestroy = MESdestroy, - .DEVmodDelete = MESmDelete, - .DEVdelete = MESdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = MESgetic, .DEVask = MESask, .DEVmodAsk = MESmAsk, diff --git a/src/spicelib/devices/mes/mesmdel.c b/src/spicelib/devices/mes/mesmdel.c deleted file mode 100644 index 43d32cfea..000000000 --- a/src/spicelib/devices/mes/mesmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 S. Hwang -**********/ - -#include "ngspice/ngspice.h" -#include "mesdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -MESmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/mesa/Makefile.am b/src/spicelib/devices/mesa/Makefile.am index 07218b37b..cca0907f6 100644 --- a/src/spicelib/devices/mesa/Makefile.am +++ b/src/spicelib/devices/mesa/Makefile.am @@ -7,8 +7,6 @@ libmesa_la_SOURCES = \ mesaacl.c \ mesaask.c \ mesadefs.h \ - mesadel.c \ - mesadest.c \ mesaext.h \ mesagetic.c \ mesainit.c \ @@ -16,7 +14,6 @@ libmesa_la_SOURCES = \ mesaitf.h \ mesaload.c \ mesamask.c \ - mesamdel.c \ mesamparam.c \ mesaparam.c \ mesapzl.c \ diff --git a/src/spicelib/devices/mesa/mesadefs.h b/src/spicelib/devices/mesa/mesadefs.h index 50bdcece4..1c21ccccd 100644 --- a/src/spicelib/devices/mesa/mesadefs.h +++ b/src/spicelib/devices/mesa/mesadefs.h @@ -14,6 +14,15 @@ Author: Trond Ytterdal /* structures used to describe MESFET Transistors */ +/* indices to the array of MESAFET noise sources */ + +#define MESARDNOIZ 0 +#define MESARSNOIZ 1 +#define MESAIDNOIZ 2 +#define MESAFLNOIZ 3 +#define MESATOTNOIZ 4 + +#define MESANSRCS 5 /* the number of MESAFET noise sources */ /* information used to describe a single instance */ @@ -111,6 +120,8 @@ typedef struct sMESAinstance { #define MESAggdpp MESAstate+18 #define MESAcgdpp MESAstate+19 +#define MESAnumStates 20 + int MESAoff; unsigned MESAlengthGiven : 1; unsigned MESAwidthGiven : 1; @@ -174,16 +185,6 @@ int MESAmode; #endif -/* indices to the array of MESAFET noise sources */ - -#define MESARDNOIZ 0 -#define MESARSNOIZ 1 -#define MESAIDNOIZ 2 -#define MESAFLNOIZ 3 -#define MESATOTNOIZ 4 - -#define MESANSRCS 5 /* the number of MESAFET noise sources */ - #ifndef NONOISE double MESAnVar[NSTATVARS][MESANSRCS]; #else /* NONOISE */ diff --git a/src/spicelib/devices/mesa/mesadel.c b/src/spicelib/devices/mesa/mesadel.c deleted file mode 100644 index b1c4f47d4..000000000 --- a/src/spicelib/devices/mesa/mesadel.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 S. Hwang -**********/ - -/* - Imported into mesa model: 2001 Paolo Nenzi -*/ - -#include "ngspice/ngspice.h" -#include "mesadefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -MESAdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/mesa/mesadest.c b/src/spicelib/devices/mesa/mesadest.c deleted file mode 100644 index e087790eb..000000000 --- a/src/spicelib/devices/mesa/mesadest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1993: T. Ytterdal, K. Lee, M. Shur and T. A. Fjeldly. All rights reserved. -Author: Trond Ytterdal -**********/ - -#include "ngspice/ngspice.h" -#include "mesadefs.h" -#include "ngspice/suffix.h" - - -void -MESAdestroy(void) -{ -} diff --git a/src/spicelib/devices/mesa/mesaext.h b/src/spicelib/devices/mesa/mesaext.h index 65ff368f4..2ef2a530b 100644 --- a/src/spicelib/devices/mesa/mesaext.h +++ b/src/spicelib/devices/mesa/mesaext.h @@ -5,12 +5,9 @@ Author: Trond Ytterdal extern int MESAacLoad(GENmodel*,CKTcircuit*); extern int MESAask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int MESAdelete(GENinstance*); -extern void MESAdestroy(void); extern int MESAgetic(GENmodel*,CKTcircuit*); extern int MESAload(GENmodel*,CKTcircuit*); extern int MESAmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int MESAmDelete(GENmodel*); extern int MESAmParam(int,IFvalue*,GENmodel*); extern int MESAparam(int,IFvalue*,GENinstance*,IFvalue*); extern int MESApzLoad(GENmodel*,CKTcircuit*, SPcomplex*); diff --git a/src/spicelib/devices/mesa/mesainit.c b/src/spicelib/devices/mesa/mesainit.c index 4136af1ea..5ea67adce 100644 --- a/src/spicelib/devices/mesa/mesainit.c +++ b/src/spicelib/devices/mesa/mesainit.c @@ -42,9 +42,9 @@ SPICEdev MESAinfo = { .DEVfindBranch = NULL, .DEVacLoad = MESAacLoad, .DEVaccept = NULL, - .DEVdestroy = MESAdestroy, - .DEVmodDelete = MESAmDelete, - .DEVdelete = MESAdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = MESAgetic, .DEVask = MESAask, .DEVmodAsk = MESAmAsk, diff --git a/src/spicelib/devices/mesa/mesamdel.c b/src/spicelib/devices/mesa/mesamdel.c deleted file mode 100644 index 1084778f5..000000000 --- a/src/spicelib/devices/mesa/mesamdel.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 S. Hwang -**********/ - -/* - Imported into mesa model: 2001 Paolo Nenzi -*/ - -#include "ngspice/ngspice.h" -#include "mesadefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -MESAmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/mesa/mesasetup.c b/src/spicelib/devices/mesa/mesasetup.c index fbb40946c..924f13efa 100644 --- a/src/spicelib/devices/mesa/mesasetup.c +++ b/src/spicelib/devices/mesa/mesasetup.c @@ -257,7 +257,7 @@ MESAsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) here->MESAstate = *states; - *states += 20; + *states += MESAnumStates; if(model->MESAsourceResist != 0) { if(here->MESAsourcePrimeNode == 0) { diff --git a/src/spicelib/devices/mos1/Makefile.am b/src/spicelib/devices/mos1/Makefile.am index a0e3eff13..7a9ec8565 100644 --- a/src/spicelib/devices/mos1/Makefile.am +++ b/src/spicelib/devices/mos1/Makefile.am @@ -9,7 +9,6 @@ libmos1_la_SOURCES = \ mos1conv.c \ mos1defs.h \ mos1del.c \ - mos1dest.c \ mos1dist.c \ mos1dset.c \ mos1ext.h \ @@ -19,7 +18,6 @@ libmos1_la_SOURCES = \ mos1itf.h \ mos1load.c \ mos1mask.c \ - mos1mdel.c \ mos1mpar.c \ mos1noi.c \ mos1par.c \ diff --git a/src/spicelib/devices/mos1/mos1defs.h b/src/spicelib/devices/mos1/mos1defs.h index 8117bf655..128b2a703 100644 --- a/src/spicelib/devices/mos1/mos1defs.h +++ b/src/spicelib/devices/mos1/mos1defs.h @@ -15,6 +15,16 @@ Modified: 2000 AlansFixes /* declarations for level 1 MOSFETs */ +/* indices to the array of MOSFET(1) noise sources */ + +#define MOS1RDNOIZ 0 +#define MOS1RSNOIZ 1 +#define MOS1IDNOIZ 2 +#define MOS1FLNOIZ 3 +#define MOS1TOTNOIZ 4 + +#define MOS1NSRCS 5 /* the number of MOS1FET noise sources*/ + /* information needed for each instance */ typedef struct sMOS1instance { @@ -142,14 +152,6 @@ typedef struct sMOS1instance { #endif -#define MOS1RDNOIZ 0 -#define MOS1RSNOIZ 1 -#define MOS1IDNOIZ 2 -#define MOS1FLNOIZ 3 -#define MOS1TOTNOIZ 4 - -#define MOS1NSRCS 5 /* the number of MOS1FET noise sources*/ - #ifndef NONOISE double MOS1nVar[NSTATVARS][MOS1NSRCS]; #else /* NONOISE */ @@ -318,9 +320,9 @@ typedef struct sMOS1instance { #define MOS1numStates 17 -#define MOS1sensxpgs MOS1states+17 /* charge sensitivities and - their derivatives. +18 for the derivatives: - pointer to the beginning of the array */ +#define MOS1sensxpgs MOS1states+17 /* charge sensitivities and their derivatives. + * +18 for the derivatives + * pointer to the beginning of the array */ #define MOS1sensxpgd MOS1states+19 #define MOS1sensxpgb MOS1states+21 #define MOS1sensxpbs MOS1states+23 diff --git a/src/spicelib/devices/mos1/mos1dest.c b/src/spicelib/devices/mos1/mos1dest.c deleted file mode 100644 index d7993452b..000000000 --- a/src/spicelib/devices/mos1/mos1dest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "mos1defs.h" -#include "ngspice/suffix.h" - - -void -MOS1destroy(void) -{ -} diff --git a/src/spicelib/devices/mos1/mos1ext.h b/src/spicelib/devices/mos1/mos1ext.h index 7aa3a2d4b..cd6fae033 100644 --- a/src/spicelib/devices/mos1/mos1ext.h +++ b/src/spicelib/devices/mos1/mos1ext.h @@ -7,11 +7,9 @@ Modified: 2000 AlansFixes extern int MOS1acLoad(GENmodel *,CKTcircuit*); extern int MOS1ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int MOS1delete(GENinstance*); -extern void MOS1destroy(void); extern int MOS1getic(GENmodel*,CKTcircuit*); extern int MOS1load(GENmodel*,CKTcircuit*); extern int MOS1mAsk(CKTcircuit *,GENmodel *,int,IFvalue*); -extern int MOS1mDelete(GENmodel*); extern int MOS1mParam(int,IFvalue*,GENmodel*); extern int MOS1param(int,IFvalue*,GENinstance*,IFvalue*); extern int MOS1pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/mos1/mos1init.c b/src/spicelib/devices/mos1/mos1init.c index 0c5becbe2..1dd551a14 100644 --- a/src/spicelib/devices/mos1/mos1init.c +++ b/src/spicelib/devices/mos1/mos1init.c @@ -42,8 +42,8 @@ SPICEdev MOS1info = { .DEVfindBranch = NULL, .DEVacLoad = MOS1acLoad, .DEVaccept = NULL, - .DEVdestroy = MOS1destroy, - .DEVmodDelete = MOS1mDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = MOS1delete, .DEVsetic = MOS1getic, .DEVask = MOS1ask, diff --git a/src/spicelib/devices/mos1/mos1mdel.c b/src/spicelib/devices/mos1/mos1mdel.c deleted file mode 100644 index 5e95311cc..000000000 --- a/src/spicelib/devices/mos1/mos1mdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "mos1defs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -MOS1mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/mos1/mos1set.c b/src/spicelib/devices/mos1/mos1set.c index ed8eac5d7..d829d3c91 100644 --- a/src/spicelib/devices/mos1/mos1set.c +++ b/src/spicelib/devices/mos1/mos1set.c @@ -102,7 +102,7 @@ MOS1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, *states += MOS1numStates; if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & TRANSEN) ){ - *states += 10 * (ckt->CKTsenInfo->SENparms); + *states += MOS1numSenStates * (ckt->CKTsenInfo->SENparms); } if(!here->MOS1drainPerimiterGiven) { diff --git a/src/spicelib/devices/mos2/Makefile.am b/src/spicelib/devices/mos2/Makefile.am index a3d439759..871250c85 100644 --- a/src/spicelib/devices/mos2/Makefile.am +++ b/src/spicelib/devices/mos2/Makefile.am @@ -9,7 +9,6 @@ libmos2_la_SOURCES = \ mos2conv.c \ mos2defs.h \ mos2del.c \ - mos2dest.c \ mos2dist.c \ mos2dset.c \ mos2ext.h \ @@ -19,7 +18,6 @@ libmos2_la_SOURCES = \ mos2itf.h \ mos2load.c \ mos2mask.c \ - mos2mdel.c \ mos2mpar.c \ mos2noi.c \ mos2par.c \ diff --git a/src/spicelib/devices/mos2/mos2defs.h b/src/spicelib/devices/mos2/mos2defs.h index 407ac3026..8c26f7bbf 100644 --- a/src/spicelib/devices/mos2/mos2defs.h +++ b/src/spicelib/devices/mos2/mos2defs.h @@ -15,6 +15,16 @@ Modified: 2000 AlansFIxes /* declarations for level 2 MOSFETs */ +/* indices to the array of MOSFET(2) noise sources */ + +#define MOS2RDNOIZ 0 +#define MOS2RSNOIZ 1 +#define MOS2IDNOIZ 2 +#define MOS2FLNOIZ 3 +#define MOS2TOTNOIZ 4 + +#define MOS2NSRCS 5 /* the number of MOS2FET noise sources */ + /* information needed for each instance */ typedef struct sMOS2instance { @@ -254,16 +264,6 @@ typedef struct sMOS2instance { #endif -/* indices to the array of MOSFET(2) noise sources */ - -#define MOS2RDNOIZ 0 -#define MOS2RSNOIZ 1 -#define MOS2IDNOIZ 2 -#define MOS2FLNOIZ 3 -#define MOS2TOTNOIZ 4 - -#define MOS2NSRCS 5 /* the number of MOS2FET noise sources */ - #ifndef NONOISE double MOS2nVar[NSTATVARS][MOS2NSRCS]; #else /* NONOISE */ @@ -325,8 +325,8 @@ typedef struct sMOS2instance { #define MOS2sensxpgs MOS2states+17 /* charge sensitivities and their derivatives - +18 for the derivatives - pointer to the - beginning of the array */ + * +18 for the derivatives + * pointer to the beginning of the array */ #define MOS2sensxpgd MOS2states+19 #define MOS2sensxpgb MOS2states+21 diff --git a/src/spicelib/devices/mos2/mos2dest.c b/src/spicelib/devices/mos2/mos2dest.c deleted file mode 100644 index 53450734e..000000000 --- a/src/spicelib/devices/mos2/mos2dest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "mos2defs.h" -#include "ngspice/suffix.h" - - -void -MOS2destroy(void) -{ -} diff --git a/src/spicelib/devices/mos2/mos2ext.h b/src/spicelib/devices/mos2/mos2ext.h index e55e2fea4..49a0645fe 100644 --- a/src/spicelib/devices/mos2/mos2ext.h +++ b/src/spicelib/devices/mos2/mos2ext.h @@ -9,10 +9,8 @@ extern int MOS2ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int MOS2mAsk(CKTcircuit*,GENmodel*,int,IFvalue*); extern int MOS2convTest(GENmodel*,CKTcircuit*); extern int MOS2delete(GENinstance*); -extern void MOS2destroy(void); extern int MOS2getic(GENmodel*,CKTcircuit*); extern int MOS2load(GENmodel*,CKTcircuit*); -extern int MOS2mDelete(GENmodel*); extern int MOS2mParam(int,IFvalue*,GENmodel*); extern int MOS2param(int,IFvalue*,GENinstance*,IFvalue*); extern int MOS2pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/mos2/mos2init.c b/src/spicelib/devices/mos2/mos2init.c index 590e08e75..dd1323301 100644 --- a/src/spicelib/devices/mos2/mos2init.c +++ b/src/spicelib/devices/mos2/mos2init.c @@ -42,8 +42,8 @@ SPICEdev MOS2info = { .DEVfindBranch = NULL, .DEVacLoad = MOS2acLoad, .DEVaccept = NULL, - .DEVdestroy = MOS2destroy, - .DEVmodDelete = MOS2mDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = MOS2delete, .DEVsetic = MOS2getic, .DEVask = MOS2ask, diff --git a/src/spicelib/devices/mos2/mos2mdel.c b/src/spicelib/devices/mos2/mos2mdel.c deleted file mode 100644 index b47d5d254..000000000 --- a/src/spicelib/devices/mos2/mos2mdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "mos2defs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -MOS2mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/mos2/mos2set.c b/src/spicelib/devices/mos2/mos2set.c index b452a81a0..c1959f722 100644 --- a/src/spicelib/devices/mos2/mos2set.c +++ b/src/spicelib/devices/mos2/mos2set.c @@ -134,7 +134,7 @@ MOS2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) *states += MOS2numStates; if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & TRANSEN) ){ - *states += 10 * (ckt->CKTsenInfo->SENparms); + *states += MOS2numSenStates * (ckt->CKTsenInfo->SENparms); } if(!here->MOS2drainPerimiterGiven) { diff --git a/src/spicelib/devices/mos3/Makefile.am b/src/spicelib/devices/mos3/Makefile.am index cf08841e1..1b2239706 100644 --- a/src/spicelib/devices/mos3/Makefile.am +++ b/src/spicelib/devices/mos3/Makefile.am @@ -9,7 +9,6 @@ libmos3_la_SOURCES = \ mos3conv.c \ mos3defs.h \ mos3del.c \ - mos3dest.c \ mos3dist.c \ mos3dset.c \ mos3ext.h \ @@ -19,7 +18,6 @@ libmos3_la_SOURCES = \ mos3itf.h \ mos3load.c \ mos3mask.c \ - mos3mdel.c \ mos3mpar.c \ mos3noi.c \ mos3par.c \ diff --git a/src/spicelib/devices/mos3/mos3defs.h b/src/spicelib/devices/mos3/mos3defs.h index 268a9b158..080c1332c 100644 --- a/src/spicelib/devices/mos3/mos3defs.h +++ b/src/spicelib/devices/mos3/mos3defs.h @@ -15,6 +15,16 @@ Modified: 2000 AlanFixes /* declarations for level 3 MOSFETs */ +/* indices to the array of MOSFET(3) noise sources */ + +#define MOS3RDNOIZ 0 +#define MOS3RSNOIZ 1 +#define MOS3IDNOIZ 2 +#define MOS3FLNOIZ 3 +#define MOS3TOTNOIZ 4 + +#define MOS3NSRCS 5 /* the number of MOSFET(3) noise sources */ + /* information needed for each instance */ typedef struct sMOS3instance { @@ -253,15 +263,6 @@ typedef struct sMOS3instance { #endif /* end distortion coeffs. */ -/* indices to the array of MOSFET(3) noise sources */ - -#define MOS3RDNOIZ 0 -#define MOS3RSNOIZ 1 -#define MOS3IDNOIZ 2 -#define MOS3FLNOIZ 3 -#define MOS3TOTNOIZ 4 - -#define MOS3NSRCS 5 /* the number of MOSFET(3) noise sources */ #ifndef NONOISE double MOS3nVar[NSTATVARS][MOS3NSRCS]; diff --git a/src/spicelib/devices/mos3/mos3dest.c b/src/spicelib/devices/mos3/mos3dest.c deleted file mode 100644 index b5f162e10..000000000 --- a/src/spicelib/devices/mos3/mos3dest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "mos3defs.h" -#include "ngspice/suffix.h" - - -void -MOS3destroy(void) -{ -} diff --git a/src/spicelib/devices/mos3/mos3ext.h b/src/spicelib/devices/mos3/mos3ext.h index bab082bc8..a5cdcd86a 100644 --- a/src/spicelib/devices/mos3/mos3ext.h +++ b/src/spicelib/devices/mos3/mos3ext.h @@ -8,11 +8,9 @@ extern int MOS3acLoad(GENmodel*,CKTcircuit*); extern int MOS3ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int MOS3convTest(GENmodel *,CKTcircuit *); extern int MOS3delete(GENinstance*); -extern void MOS3destroy(void); extern int MOS3getic(GENmodel*,CKTcircuit*); extern int MOS3load(GENmodel*,CKTcircuit*); extern int MOS3mAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int MOS3mDelete(GENmodel*); extern int MOS3mParam(int,IFvalue*,GENmodel*); extern int MOS3param(int,IFvalue*,GENinstance*,IFvalue*); extern int MOS3pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/mos3/mos3init.c b/src/spicelib/devices/mos3/mos3init.c index 1e2d72fa2..7918983da 100644 --- a/src/spicelib/devices/mos3/mos3init.c +++ b/src/spicelib/devices/mos3/mos3init.c @@ -42,8 +42,8 @@ SPICEdev MOS3info = { .DEVfindBranch = NULL, .DEVacLoad = MOS3acLoad, .DEVaccept = NULL, - .DEVdestroy = MOS3destroy, - .DEVmodDelete = MOS3mDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = MOS3delete, .DEVsetic = MOS3getic, .DEVask = MOS3ask, diff --git a/src/spicelib/devices/mos3/mos3mdel.c b/src/spicelib/devices/mos3/mos3mdel.c deleted file mode 100644 index ed2d06e40..000000000 --- a/src/spicelib/devices/mos3/mos3mdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "mos3defs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -MOS3mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/mos6/Makefile.am b/src/spicelib/devices/mos6/Makefile.am index 6300e3173..d051f50cb 100644 --- a/src/spicelib/devices/mos6/Makefile.am +++ b/src/spicelib/devices/mos6/Makefile.am @@ -8,7 +8,6 @@ libmos6_la_SOURCES = \ mos6conv.c \ mos6defs.h \ mos6del.c \ - mos6dest.c \ mos6ext.h \ mos6ic.c \ mos6init.c \ @@ -16,7 +15,6 @@ libmos6_la_SOURCES = \ mos6itf.h \ mos6load.c \ mos6mask.c \ - mos6mdel.c \ mos6mpar.c \ mos6par.c \ mos6set.c \ diff --git a/src/spicelib/devices/mos6/mos6defs.h b/src/spicelib/devices/mos6/mos6defs.h index 580a3b2af..56685e9f4 100644 --- a/src/spicelib/devices/mos6/mos6defs.h +++ b/src/spicelib/devices/mos6/mos6defs.h @@ -250,9 +250,9 @@ typedef struct sMOS6instance { #define MOS6numStates 17 -#define MOS6sensxpgs MOS6states+17 /* charge sensitivities and - their derivatives. +18 for the derivatives: - pointer to the beginning of the array */ +#define MOS6sensxpgs MOS6states+17 /* charge sensitivities and their derivatives. + * +18 for the derivatives + * pointer to the beginning of the array */ #define MOS6sensxpgd MOS6states+19 #define MOS6sensxpgb MOS6states+21 #define MOS6sensxpbs MOS6states+23 diff --git a/src/spicelib/devices/mos6/mos6dest.c b/src/spicelib/devices/mos6/mos6dest.c deleted file mode 100644 index 23f48d53c..000000000 --- a/src/spicelib/devices/mos6/mos6dest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1989 Takayasu Sakurai -**********/ - -#include "ngspice/ngspice.h" -#include "mos6defs.h" -#include "ngspice/suffix.h" - - -void -MOS6destroy(void) -{ -} diff --git a/src/spicelib/devices/mos6/mos6ext.h b/src/spicelib/devices/mos6/mos6ext.h index a7ffd3d2f..e539d8c4b 100644 --- a/src/spicelib/devices/mos6/mos6ext.h +++ b/src/spicelib/devices/mos6/mos6ext.h @@ -6,11 +6,9 @@ Author: 1985 Thomas L. Quarles extern int MOS6acLoad(GENmodel *,CKTcircuit*); extern int MOS6ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int MOS6delete(GENinstance*); -extern void MOS6destroy(void); extern int MOS6getic(GENmodel*,CKTcircuit*); extern int MOS6load(GENmodel*,CKTcircuit*); extern int MOS6mAsk(CKTcircuit *,GENmodel *,int,IFvalue*); -extern int MOS6mDelete(GENmodel*); extern int MOS6mParam(int,IFvalue*,GENmodel*); extern int MOS6param(int,IFvalue*,GENinstance*,IFvalue*); extern int MOS6pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/mos6/mos6init.c b/src/spicelib/devices/mos6/mos6init.c index e81117f6b..baef3fb9c 100644 --- a/src/spicelib/devices/mos6/mos6init.c +++ b/src/spicelib/devices/mos6/mos6init.c @@ -42,8 +42,8 @@ SPICEdev MOS6info = { .DEVfindBranch = NULL, .DEVacLoad = NULL, .DEVaccept = NULL, - .DEVdestroy = MOS6destroy, - .DEVmodDelete = MOS6mDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = MOS6delete, .DEVsetic = MOS6getic, .DEVask = MOS6ask, diff --git a/src/spicelib/devices/mos6/mos6mdel.c b/src/spicelib/devices/mos6/mos6mdel.c deleted file mode 100644 index cd148fbc4..000000000 --- a/src/spicelib/devices/mos6/mos6mdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "mos6defs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -MOS6mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/mos6/mos6set.c b/src/spicelib/devices/mos6/mos6set.c index 351600dfc..4ff71040f 100644 --- a/src/spicelib/devices/mos6/mos6set.c +++ b/src/spicelib/devices/mos6/mos6set.c @@ -150,7 +150,7 @@ MOS6setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, here->MOS6states = *states; *states += MOS6numStates; if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & TRANSEN) ){ - *states += 10 * (ckt->CKTsenInfo->SENparms); + *states += MOS6numSenStates * (ckt->CKTsenInfo->SENparms); } if((model->MOS6drainResistance != 0 || diff --git a/src/spicelib/devices/mos9/Makefile.am b/src/spicelib/devices/mos9/Makefile.am index 564835c93..4ee95f8c4 100644 --- a/src/spicelib/devices/mos9/Makefile.am +++ b/src/spicelib/devices/mos9/Makefile.am @@ -9,7 +9,6 @@ libmos9_la_SOURCES = \ mos9conv.c \ mos9defs.h \ mos9del.c \ - mos9dest.c \ mos9dist.c \ mos9dset.c \ mos9ext.h \ @@ -19,7 +18,6 @@ libmos9_la_SOURCES = \ mos9itf.h \ mos9load.c \ mos9mask.c \ - mos9mdel.c \ mos9mpar.c \ mos9noi.c \ mos9par.c \ diff --git a/src/spicelib/devices/mos9/mos9defs.h b/src/spicelib/devices/mos9/mos9defs.h index 6f673df91..764647483 100644 --- a/src/spicelib/devices/mos9/mos9defs.h +++ b/src/spicelib/devices/mos9/mos9defs.h @@ -15,6 +15,16 @@ Modified: Alan Gillespie /* declarations for level 9 MOSFETs */ +/* indices to the array of MOSFET(9) noise sources */ + +#define MOS9RDNOIZ 0 +#define MOS9RSNOIZ 1 +#define MOS9IDNOIZ 2 +#define MOS9FLNOIZ 3 +#define MOS9TOTNOIZ 4 + +#define MOS9NSRCS 5 /* the number of MOSFET(9) noise sources */ + /* information needed for each instance */ typedef struct sMOS9instance { @@ -255,15 +265,6 @@ typedef struct sMOS9instance { #endif /* end distortion coeffs. */ -/* indices to the array of MOSFET(3) noise sources */ - -#define MOS9RDNOIZ 0 -#define MOS9RSNOIZ 1 -#define MOS9IDNOIZ 2 -#define MOS9FLNOIZ 3 -#define MOS9TOTNOIZ 4 - -#define MOS9NSRCS 5 /* the number of MOSFET(9) noise sources */ #ifndef NONOISE double MOS9nVar[NSTATVARS][MOS9NSRCS]; diff --git a/src/spicelib/devices/mos9/mos9dest.c b/src/spicelib/devices/mos9/mos9dest.c deleted file mode 100644 index 961f52c46..000000000 --- a/src/spicelib/devices/mos9/mos9dest.c +++ /dev/null @@ -1,15 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -Modified: Alan Gillespie -**********/ - -#include "ngspice/ngspice.h" -#include "mos9defs.h" -#include "ngspice/suffix.h" - - -void -MOS9destroy(void) -{ -} diff --git a/src/spicelib/devices/mos9/mos9ext.h b/src/spicelib/devices/mos9/mos9ext.h index 9f1b42390..7535b622c 100644 --- a/src/spicelib/devices/mos9/mos9ext.h +++ b/src/spicelib/devices/mos9/mos9ext.h @@ -8,11 +8,9 @@ extern int MOS9acLoad(GENmodel*,CKTcircuit*); extern int MOS9ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int MOS9convTest(GENmodel *,CKTcircuit *); extern int MOS9delete(GENinstance*); -extern void MOS9destroy(void); extern int MOS9getic(GENmodel*,CKTcircuit*); extern int MOS9load(GENmodel*,CKTcircuit*); extern int MOS9mAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int MOS9mDelete(GENmodel*); extern int MOS9mParam(int,IFvalue*,GENmodel*); extern int MOS9param(int,IFvalue*,GENinstance*,IFvalue*); extern int MOS9pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/mos9/mos9init.c b/src/spicelib/devices/mos9/mos9init.c index 71c512707..2fe43ed4f 100644 --- a/src/spicelib/devices/mos9/mos9init.c +++ b/src/spicelib/devices/mos9/mos9init.c @@ -42,8 +42,8 @@ SPICEdev MOS9info = { .DEVfindBranch = NULL, .DEVacLoad = MOS9acLoad, .DEVaccept = NULL, - .DEVdestroy = MOS9destroy, - .DEVmodDelete = MOS9mDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = MOS9delete, .DEVsetic = MOS9getic, .DEVask = MOS9ask, diff --git a/src/spicelib/devices/mos9/mos9mdel.c b/src/spicelib/devices/mos9/mos9mdel.c deleted file mode 100644 index d9c9a21e6..000000000 --- a/src/spicelib/devices/mos9/mos9mdel.c +++ /dev/null @@ -1,18 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -Modified: Alan Gillespie -**********/ - -#include "ngspice/ngspice.h" -#include "mos9defs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -MOS9mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/nbjt/Makefile.am b/src/spicelib/devices/nbjt/Makefile.am index 7f18d5b19..3c1facc2f 100644 --- a/src/spicelib/devices/nbjt/Makefile.am +++ b/src/spicelib/devices/nbjt/Makefile.am @@ -8,14 +8,12 @@ libnbjt_la_SOURCES = \ nbjtask.c \ nbjtdefs.h \ nbjtdel.c \ - nbjtdest.c \ nbjtdump.c \ nbjtext.h \ nbjtinit.c \ nbjtinit.h \ nbjtitf.h \ nbjtload.c \ - nbjtmdel.c \ nbjtmpar.c \ nbjtparm.c \ nbjtpzld.c \ diff --git a/src/spicelib/devices/nbjt/nbjtdest.c b/src/spicelib/devices/nbjt/nbjtdest.c deleted file mode 100644 index 7c0aad559..000000000 --- a/src/spicelib/devices/nbjt/nbjtdest.c +++ /dev/null @@ -1,19 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group -**********/ - -/* - * This routine deletes all NBJTs from the circuit and frees all storage they - * were using. The current implementation has memory leaks. - */ - -#include "ngspice/ngspice.h" -#include "nbjtdefs.h" -#include "ngspice/suffix.h" - - -void -NBJTdestroy(void) -{ -} diff --git a/src/spicelib/devices/nbjt/nbjtext.h b/src/spicelib/devices/nbjt/nbjtext.h index 3658f9c28..89865a39c 100644 --- a/src/spicelib/devices/nbjt/nbjtext.h +++ b/src/spicelib/devices/nbjt/nbjtext.h @@ -9,10 +9,8 @@ Author: 1987 Karti Mayaram extern int NBJTacLoad(GENmodel *, CKTcircuit *); extern int NBJTask(CKTcircuit *, GENinstance *, int, IFvalue *, IFvalue *); extern int NBJTdelete(GENinstance *); -extern void NBJTdestroy(void); extern int NBJTgetic(GENmodel *, CKTcircuit *); extern int NBJTload(GENmodel *, CKTcircuit *); -extern int NBJTmDelete(GENmodel *); extern int NBJTmParam(int, IFvalue *, GENmodel *); extern int NBJTparam(int, IFvalue *, GENinstance *, IFvalue *); extern int NBJTpzLoad(GENmodel *, CKTcircuit *, SPcomplex *); diff --git a/src/spicelib/devices/nbjt/nbjtinit.c b/src/spicelib/devices/nbjt/nbjtinit.c index 9b25d80e6..47b571c50 100644 --- a/src/spicelib/devices/nbjt/nbjtinit.c +++ b/src/spicelib/devices/nbjt/nbjtinit.c @@ -42,8 +42,8 @@ SPICEdev NBJTinfo = { .DEVfindBranch = NULL, .DEVacLoad = NBJTacLoad, .DEVaccept = NULL, - .DEVdestroy = NBJTdestroy, - .DEVmodDelete = NBJTmDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = NBJTdelete, .DEVsetic = NULL, .DEVask = NBJTask, diff --git a/src/spicelib/devices/nbjt/nbjtmdel.c b/src/spicelib/devices/nbjt/nbjtmdel.c deleted file mode 100644 index 9f1ac2307..000000000 --- a/src/spicelib/devices/nbjt/nbjtmdel.c +++ /dev/null @@ -1,22 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group -**********/ - -/* - * This routine deletes a NBJT model from the circuit and frees the storage - * it was using. returns an error if the model has instances - */ - -#include "ngspice/ngspice.h" -#include "nbjtdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -NBJTmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/nbjt2/Makefile.am b/src/spicelib/devices/nbjt2/Makefile.am index 22e262578..efb514cb9 100644 --- a/src/spicelib/devices/nbjt2/Makefile.am +++ b/src/spicelib/devices/nbjt2/Makefile.am @@ -8,14 +8,12 @@ libnbjt2_la_SOURCES = \ nbt2ask.c \ nbjt2def.h \ nbt2del.c \ - nbt2dest.c \ nbt2dump.c \ nbjt2ext.h \ nbt2init.c \ nbt2init.h \ nbjt2itf.h \ nbt2load.c \ - nbt2mdel.c \ nbt2mpar.c \ nbt2parm.c \ nbt2pzld.c \ diff --git a/src/spicelib/devices/nbjt2/nbjt2ext.h b/src/spicelib/devices/nbjt2/nbjt2ext.h index 294f7a54d..f0a8fc20b 100644 --- a/src/spicelib/devices/nbjt2/nbjt2ext.h +++ b/src/spicelib/devices/nbjt2/nbjt2ext.h @@ -10,10 +10,8 @@ Author: 1987 Karti Mayaram extern int NBJT2acLoad(GENmodel *, CKTcircuit *); extern int NBJT2ask(CKTcircuit *, GENinstance *, int, IFvalue *, IFvalue *); extern int NBJT2delete(GENinstance *); -extern void NBJT2destroy(void); extern int NBJT2getic(GENmodel *, CKTcircuit *); extern int NBJT2load(GENmodel *, CKTcircuit *); -extern int NBJT2mDelete(GENmodel *); extern int NBJT2mParam(int, IFvalue *, GENmodel *); extern int NBJT2param(int, IFvalue *, GENinstance *, IFvalue *); extern int NBJT2pzLoad(GENmodel *, CKTcircuit *, SPcomplex *); diff --git a/src/spicelib/devices/nbjt2/nbt2dest.c b/src/spicelib/devices/nbjt2/nbt2dest.c deleted file mode 100644 index e3cf03312..000000000 --- a/src/spicelib/devices/nbjt2/nbt2dest.c +++ /dev/null @@ -1,19 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group -**********/ - -/* - * This routine deletes all NBJT2s from the circuit and frees all storage - * they were using. The current implementation has memory leaks. - */ - -#include "ngspice/ngspice.h" -#include "nbjt2def.h" -#include "ngspice/suffix.h" - - -void -NBJT2destroy(void) -{ -} diff --git a/src/spicelib/devices/nbjt2/nbt2init.c b/src/spicelib/devices/nbjt2/nbt2init.c index f27591ae1..6366abd24 100644 --- a/src/spicelib/devices/nbjt2/nbt2init.c +++ b/src/spicelib/devices/nbjt2/nbt2init.c @@ -42,8 +42,8 @@ SPICEdev NBJT2info = { .DEVfindBranch = NULL, .DEVacLoad = NBJT2acLoad, .DEVaccept = NULL, - .DEVdestroy = NBJT2destroy, - .DEVmodDelete = NBJT2mDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = NBJT2delete, .DEVsetic = NULL, .DEVask = NBJT2ask, diff --git a/src/spicelib/devices/nbjt2/nbt2mdel.c b/src/spicelib/devices/nbjt2/nbt2mdel.c deleted file mode 100644 index f156c86b9..000000000 --- a/src/spicelib/devices/nbjt2/nbt2mdel.c +++ /dev/null @@ -1,22 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group -**********/ - -/* - * This routine deletes a NBJT2 model from the circuit and frees the storage - * it was using. returns an error if the model has instances - */ - -#include "ngspice/ngspice.h" -#include "nbjt2def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -NBJT2mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/ndev/Makefile.am b/src/spicelib/devices/ndev/Makefile.am index ce0f7deee..da761fd44 100644 --- a/src/spicelib/devices/ndev/Makefile.am +++ b/src/spicelib/devices/ndev/Makefile.am @@ -8,8 +8,6 @@ libndev_la_SOURCES = \ ndevaccept.c \ ndevask.c \ ndevdefs.h \ - ndevdel.c \ - ndevdest.c \ ndevdump.c \ ndevext.h \ ndevexch.h \ diff --git a/src/spicelib/devices/ndev/ndevdel.c b/src/spicelib/devices/ndev/ndevdel.c deleted file mode 100644 index 93dd30fa3..000000000 --- a/src/spicelib/devices/ndev/ndevdel.c +++ /dev/null @@ -1,18 +0,0 @@ -/********** -Permit to use it as your wish. -Author: 2007 Gong Ding, gdiso@ustc.edu -University of Science and Technology of China -**********/ - -#include "ngspice/ngspice.h" -#include "ndevdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -NDEVdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/ndev/ndevdest.c b/src/spicelib/devices/ndev/ndevdest.c deleted file mode 100644 index fb99e5a64..000000000 --- a/src/spicelib/devices/ndev/ndevdest.c +++ /dev/null @@ -1,15 +0,0 @@ -/********** -Permit to use it as your wish. -Author: 2007 Gong Ding, gdiso@ustc.edu -University of Science and Technology of China -**********/ - -#include "ngspice/ngspice.h" -#include "ndevdefs.h" -#include "ngspice/suffix.h" - - -void -NDEVdestroy(void) -{ -} diff --git a/src/spicelib/devices/ndev/ndevext.h b/src/spicelib/devices/ndev/ndevext.h index 78a4543ba..66e6bc8a5 100644 --- a/src/spicelib/devices/ndev/ndevext.h +++ b/src/spicelib/devices/ndev/ndevext.h @@ -9,8 +9,6 @@ Author: 1987 Karti Mayaram extern int NDEVacLoad(GENmodel *, CKTcircuit *); extern int NDEVask(CKTcircuit *, GENinstance *, int, IFvalue *, IFvalue *); -extern int NDEVdelete(GENinstance *); -extern void NDEVdestroy(void); extern int NDEVgetic(GENmodel *, CKTcircuit *); extern int NDEVload(GENmodel *, CKTcircuit *); extern int NDEVaccept(CKTcircuit *, GENmodel *); diff --git a/src/spicelib/devices/ndev/ndevinit.c b/src/spicelib/devices/ndev/ndevinit.c index bab699529..7ceee047b 100644 --- a/src/spicelib/devices/ndev/ndevinit.c +++ b/src/spicelib/devices/ndev/ndevinit.c @@ -42,9 +42,9 @@ SPICEdev NDEVinfo = { .DEVfindBranch = NULL, .DEVacLoad = NDEVacLoad, .DEVaccept = NDEVaccept, - .DEVdestroy = NDEVdestroy, + .DEVdestroy = NULL, .DEVmodDelete = NDEVmDelete, - .DEVdelete = NDEVdelete, + .DEVdelete = NULL, .DEVsetic = NDEVgetic, .DEVask = NDEVask, .DEVmodAsk = NULL, diff --git a/src/spicelib/devices/numd/Makefile.am b/src/spicelib/devices/numd/Makefile.am index 9f6b19510..133d3ea65 100644 --- a/src/spicelib/devices/numd/Makefile.am +++ b/src/spicelib/devices/numd/Makefile.am @@ -8,14 +8,12 @@ libnumd_la_SOURCES = \ numdask.c \ numddefs.h \ numddel.c \ - numddest.c \ numddump.c \ numdext.h \ numdinit.c \ numdinit.h \ numditf.h \ numdload.c \ - numdmdel.c \ numdmpar.c \ numdparm.c \ numdpzld.c \ diff --git a/src/spicelib/devices/numd/numddest.c b/src/spicelib/devices/numd/numddest.c deleted file mode 100644 index 35fecbaf8..000000000 --- a/src/spicelib/devices/numd/numddest.c +++ /dev/null @@ -1,19 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group -**********/ - -/* - * This routine deletes all NUMDs from the circuit and frees all storage they - * were using. The current implementation has memory leaks. - */ - -#include "ngspice/ngspice.h" -#include "numddefs.h" -#include "ngspice/suffix.h" - - -void -NUMDdestroy(void) -{ -} diff --git a/src/spicelib/devices/numd/numdext.h b/src/spicelib/devices/numd/numdext.h index b90f31ce8..72a686260 100644 --- a/src/spicelib/devices/numd/numdext.h +++ b/src/spicelib/devices/numd/numdext.h @@ -10,10 +10,8 @@ Author: 1987 Karti Mayaram extern int NUMDacLoad(GENmodel *, CKTcircuit *); extern int NUMDask(CKTcircuit *, GENinstance *, int, IFvalue *, IFvalue *); extern int NUMDdelete(GENinstance *); -extern void NUMDdestroy(void); extern int NUMDgetic(GENmodel *, CKTcircuit *); extern int NUMDload(GENmodel *, CKTcircuit *); -extern int NUMDmDelete(GENmodel *); extern int NUMDmParam(int, IFvalue *, GENmodel *); extern int NUMDparam(int, IFvalue *, GENinstance *, IFvalue *); extern int NUMDpzLoad(GENmodel *, CKTcircuit *, SPcomplex *); diff --git a/src/spicelib/devices/numd/numdinit.c b/src/spicelib/devices/numd/numdinit.c index cf6a23537..ac91eaa63 100644 --- a/src/spicelib/devices/numd/numdinit.c +++ b/src/spicelib/devices/numd/numdinit.c @@ -42,8 +42,8 @@ SPICEdev NUMDinfo = { .DEVfindBranch = NULL, .DEVacLoad = NUMDacLoad, .DEVaccept = NULL, - .DEVdestroy = NUMDdestroy, - .DEVmodDelete = NUMDmDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = NUMDdelete, .DEVsetic = NULL, .DEVask = NUMDask, diff --git a/src/spicelib/devices/numd/numdmdel.c b/src/spicelib/devices/numd/numdmdel.c deleted file mode 100644 index 4fbafca96..000000000 --- a/src/spicelib/devices/numd/numdmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group -**********/ - -#include "ngspice/ngspice.h" -#include "numddefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -NUMDmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/numd2/Makefile.am b/src/spicelib/devices/numd2/Makefile.am index bd0dd1cf2..56c39175c 100644 --- a/src/spicelib/devices/numd2/Makefile.am +++ b/src/spicelib/devices/numd2/Makefile.am @@ -8,14 +8,12 @@ libnumd2_la_SOURCES = \ nud2ask.c \ numd2def.h \ nud2del.c \ - nud2dest.c \ nud2dump.c \ numd2ext.h \ numd2init.c \ numd2init.h \ numd2itf.h \ nud2load.c \ - nud2mdel.c \ nud2mpar.c \ nud2parm.c \ nud2pzld.c \ diff --git a/src/spicelib/devices/numd2/nud2dest.c b/src/spicelib/devices/numd2/nud2dest.c deleted file mode 100644 index c8b8c6817..000000000 --- a/src/spicelib/devices/numd2/nud2dest.c +++ /dev/null @@ -1,19 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group -**********/ - -/* - * This routine deletes all NUMD2s from the circuit and frees all storage - * they were using. The current implementation has memory leaks. - */ - -#include "ngspice/ngspice.h" -#include "numd2def.h" -#include "ngspice/suffix.h" - - -void -NUMD2destroy(void) -{ -} diff --git a/src/spicelib/devices/numd2/nud2mdel.c b/src/spicelib/devices/numd2/nud2mdel.c deleted file mode 100644 index 52cb8e85c..000000000 --- a/src/spicelib/devices/numd2/nud2mdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group -**********/ - -#include "ngspice/ngspice.h" -#include "numd2def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -NUMD2mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/numd2/numd2ext.h b/src/spicelib/devices/numd2/numd2ext.h index 519201212..19f893d01 100644 --- a/src/spicelib/devices/numd2/numd2ext.h +++ b/src/spicelib/devices/numd2/numd2ext.h @@ -10,10 +10,8 @@ Author: 1987 Karti Mayaram extern int NUMD2acLoad(GENmodel *, CKTcircuit *); extern int NUMD2ask(CKTcircuit *, GENinstance *, int, IFvalue *, IFvalue *); extern int NUMD2delete(GENinstance *); -extern void NUMD2destroy(void); extern int NUMD2getic(GENmodel *, CKTcircuit *); extern int NUMD2load(GENmodel *, CKTcircuit *); -extern int NUMD2mDelete(GENmodel *); extern int NUMD2mParam(int, IFvalue *, GENmodel *); extern int NUMD2param(int, IFvalue *, GENinstance *, IFvalue *); extern int NUMD2pzLoad(GENmodel *, CKTcircuit *, SPcomplex *); diff --git a/src/spicelib/devices/numd2/numd2init.c b/src/spicelib/devices/numd2/numd2init.c index 880d4d643..69dbc77f9 100644 --- a/src/spicelib/devices/numd2/numd2init.c +++ b/src/spicelib/devices/numd2/numd2init.c @@ -42,8 +42,8 @@ SPICEdev NUMD2info = { .DEVfindBranch = NULL, .DEVacLoad = NUMD2acLoad, .DEVaccept = NULL, - .DEVdestroy = NUMD2destroy, - .DEVmodDelete = NUMD2mDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = NUMD2delete, .DEVsetic = NULL, .DEVask = NUMD2ask, diff --git a/src/spicelib/devices/numos/Makefile.am b/src/spicelib/devices/numos/Makefile.am index 4f7c315c8..25784b05a 100644 --- a/src/spicelib/devices/numos/Makefile.am +++ b/src/spicelib/devices/numos/Makefile.am @@ -8,14 +8,12 @@ libnumos_la_SOURCES = \ nummask.c \ numosdef.h \ nummdel.c \ - nummdest.c \ nummdump.c \ numosext.h \ numosinit.c \ numosinit.h \ numositf.h \ nummload.c \ - nummmdel.c \ nummmpar.c \ nummparm.c \ nummpzld.c \ diff --git a/src/spicelib/devices/numos/nummdest.c b/src/spicelib/devices/numos/nummdest.c deleted file mode 100644 index c68fb8ed5..000000000 --- a/src/spicelib/devices/numos/nummdest.c +++ /dev/null @@ -1,19 +0,0 @@ -/********** -Copyright 1991 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group -**********/ - -/* - * This routine deletes all NUMOSs from the circuit and frees all storage - * they were using. The current implementation has memory leaks. - */ - -#include "ngspice/ngspice.h" -#include "numosdef.h" -#include "ngspice/suffix.h" - - -void -NUMOSdestroy(void) -{ -} diff --git a/src/spicelib/devices/numos/nummmdel.c b/src/spicelib/devices/numos/nummmdel.c deleted file mode 100644 index c05613144..000000000 --- a/src/spicelib/devices/numos/nummmdel.c +++ /dev/null @@ -1,22 +0,0 @@ -/********** -Copyright 1991 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group -**********/ - -/* - * This routine deletes a NUMOS model from the circuit and frees the storage - * it was using. returns an error if the model has instances - */ - -#include "ngspice/ngspice.h" -#include "numosdef.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -NUMOSmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/numos/numosext.h b/src/spicelib/devices/numos/numosext.h index adff061ac..14bef1045 100644 --- a/src/spicelib/devices/numos/numosext.h +++ b/src/spicelib/devices/numos/numosext.h @@ -10,10 +10,8 @@ Author: 1987 Karti Mayaram extern int NUMOSacLoad(GENmodel *, CKTcircuit *); extern int NUMOSask(CKTcircuit *, GENinstance *, int, IFvalue *, IFvalue *); extern int NUMOSdelete(GENinstance *); -extern void NUMOSdestroy(void); extern int NUMOSgetic(GENmodel *, CKTcircuit *); extern int NUMOSload(GENmodel *, CKTcircuit *); -extern int NUMOSmDelete(GENmodel *); extern int NUMOSmParam(int, IFvalue *, GENmodel *); extern int NUMOSparam(int, IFvalue *, GENinstance *, IFvalue *); extern int NUMOSpzLoad(GENmodel *, CKTcircuit *, SPcomplex *); diff --git a/src/spicelib/devices/numos/numosinit.c b/src/spicelib/devices/numos/numosinit.c index 0385b225a..18bae4c50 100644 --- a/src/spicelib/devices/numos/numosinit.c +++ b/src/spicelib/devices/numos/numosinit.c @@ -42,8 +42,8 @@ SPICEdev NUMOSinfo = { .DEVfindBranch = NULL, .DEVacLoad = NUMOSacLoad, .DEVaccept = NULL, - .DEVdestroy = NUMOSdestroy, - .DEVmodDelete = NUMOSmDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = NUMOSdelete, .DEVsetic = NULL, .DEVask = NUMOSask, diff --git a/src/spicelib/devices/res/Makefile.am b/src/spicelib/devices/res/Makefile.am index e20f38e2c..e571c7082 100644 --- a/src/spicelib/devices/res/Makefile.am +++ b/src/spicelib/devices/res/Makefile.am @@ -6,15 +6,12 @@ libres_la_SOURCES = \ res.c \ resask.c \ resdefs.h \ - resdel.c \ - resdest.c \ resext.h \ resinit.c \ resinit.h \ resitf.h \ resload.c \ resmask.c \ - resmdel.c \ resmpar.c \ resnoise.c \ resparam.c \ diff --git a/src/spicelib/devices/res/resdefs.h b/src/spicelib/devices/res/resdefs.h index 81ed42b67..d2c896c51 100644 --- a/src/spicelib/devices/res/resdefs.h +++ b/src/spicelib/devices/res/resdefs.h @@ -15,6 +15,13 @@ Modified: 2000 AlansFixes /* definitions used to describe resistors */ +/* indices to array of RES noise sources */ + +#define RESTHNOIZ 0 /* Thermal noise source */ +#define RESFLNOIZ 1 /* Flicker noise source */ +#define RESTOTNOIZ 2 /* Total noise */ + +#define RESNSRCS 3 /* the number of RES noise sources */ /* information used to describe a single instance */ @@ -73,15 +80,6 @@ typedef struct sRESinstance { int RESsenParmNo; /* parameter # for sensitivity use; * set equal to 0 if not a design parameter*/ - /* indices to array of RES noise sources */ - -#define RESTHNOIZ 0 /* Thermal noise source */ -#define RESFLNOIZ 1 /* Flicker noise source */ -#define RESTOTNOIZ 2 /* Total noise */ - -#define RESNSRCS 3 /* the number of RES noise sources */ - - #ifndef NONOISE double RESnVar[NSTATVARS][RESNSRCS]; #else /* NONOISE */ diff --git a/src/spicelib/devices/res/resdel.c b/src/spicelib/devices/res/resdel.c deleted file mode 100644 index 0f5202863..000000000 --- a/src/spicelib/devices/res/resdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -Modified: Apr 2000 - Paolo Nenzi -**********/ - -#include "ngspice/ngspice.h" -#include "resdefs.h" -#include "ngspice/sperror.h" - - -int -RESdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/res/resdest.c b/src/spicelib/devices/res/resdest.c deleted file mode 100644 index 1d338c864..000000000 --- a/src/spicelib/devices/res/resdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -Modified: Apr 2000 - Paolo Nenzi -**********/ - -#include "ngspice/ngspice.h" -#include "resdefs.h" - - -void -RESdestroy(void) -{ -} diff --git a/src/spicelib/devices/res/resext.h b/src/spicelib/devices/res/resext.h index b0ebacdb9..ab91f283f 100644 --- a/src/spicelib/devices/res/resext.h +++ b/src/spicelib/devices/res/resext.h @@ -4,12 +4,9 @@ Author: 1985 Thomas L. Quarles **********/ extern int RESask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int RESdelete(GENinstance*); -extern void RESdestroy(void); extern int RESload(GENmodel*,CKTcircuit*); extern int RESacload(GENmodel*,CKTcircuit*); extern int RESmodAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int RESmDelete(GENmodel*); extern int RESmParam(int,IFvalue*,GENmodel*); extern int RESparam(int,IFvalue*,GENinstance*,IFvalue*); extern int RESpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/res/resinit.c b/src/spicelib/devices/res/resinit.c index 8d51bb6b0..fea52495d 100644 --- a/src/spicelib/devices/res/resinit.c +++ b/src/spicelib/devices/res/resinit.c @@ -49,9 +49,9 @@ SPICEdev RESinfo = { .DEVfindBranch = NULL, .DEVacLoad = RESacload, .DEVaccept = NULL, - .DEVdestroy = RESdestroy, - .DEVmodDelete = RESmDelete, - .DEVdelete = RESdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = RESask, .DEVmodAsk = RESmodAsk, diff --git a/src/spicelib/devices/res/resmdel.c b/src/spicelib/devices/res/resmdel.c deleted file mode 100644 index b7dc54ec2..000000000 --- a/src/spicelib/devices/res/resmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -Modified: Apr 2000 - Paolo Nenzi -**********/ - -#include "ngspice/ngspice.h" -#include "resdefs.h" -#include "ngspice/sperror.h" - - -int -RESmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/res/restemp.c b/src/spicelib/devices/res/restemp.c index 14df9177b..57656a77e 100644 --- a/src/spicelib/devices/res/restemp.c +++ b/src/spicelib/devices/res/restemp.c @@ -120,6 +120,9 @@ RESupdate_conduct(RESinstance *here, bool spill_warnings) else factor = (((tc2 * difference) + tc1) * difference) + 1.0; + if (!here->RESscaleGiven) + here->RESscale = 1; + here->RESconduct = here->RESm / (here->RESresist * factor * here->RESscale); /* Paolo Nenzi: AC value */ diff --git a/src/spicelib/devices/soi3/Makefile.am b/src/spicelib/devices/soi3/Makefile.am index 4081c33fe..e932fcfd0 100644 --- a/src/spicelib/devices/soi3/Makefile.am +++ b/src/spicelib/devices/soi3/Makefile.am @@ -9,8 +9,6 @@ libsoi3_la_SOURCES = \ soi3cap.c \ soi3conv.c \ soi3defs.h \ - soi3del.c \ - soi3dest.c \ soi3ext.h \ soi3ic.c \ soi3init.c \ @@ -18,7 +16,6 @@ libsoi3_la_SOURCES = \ soi3itf.h \ soi3load.c \ soi3mask.c \ - soi3mdel.c \ soi3mpar.c \ soi3nois.c \ soi3par.c \ diff --git a/src/spicelib/devices/soi3/soi3defs.h b/src/spicelib/devices/soi3/soi3defs.h index 465597cf8..5a5fa9208 100644 --- a/src/spicelib/devices/soi3/soi3defs.h +++ b/src/spicelib/devices/soi3/soi3defs.h @@ -33,6 +33,16 @@ ngspice integration /* declarations for SOI3 MOSFETs */ +/* indices to the array of SOI(3) noise sources */ + +#define SOI3RDNOIZ 0 +#define SOI3RSNOIZ 1 +#define SOI3IDNOIZ 2 +#define SOI3FLNOIZ 3 +#define SOI3TOTNOIZ 4 + +#define SOI3NSRCS 5 /* the number of SOI(3) noise sources */ + /* information needed for each instance */ typedef struct sSOI3instance { @@ -304,17 +314,6 @@ typedef struct sSOI3instance { double *SOI3TOUT4_tout3Ptr; double *SOI3TOUT4_tout4Ptr; - -/* indices to the array of SOI(3) noise sources */ - -#define SOI3RDNOIZ 0 -#define SOI3RSNOIZ 1 -#define SOI3IDNOIZ 2 -#define SOI3FLNOIZ 3 -#define SOI3TOTNOIZ 4 - -#define SOI3NSRCS 5 /* the number of SOI(3) noise sources */ - #ifndef NONOISE double SOI3nVar[NSTATVARS][SOI3NSRCS]; #else /* NONOISE */ diff --git a/src/spicelib/devices/soi3/soi3del.c b/src/spicelib/devices/soi3/soi3del.c deleted file mode 100644 index 55d5b3fda..000000000 --- a/src/spicelib/devices/soi3/soi3del.c +++ /dev/null @@ -1,39 +0,0 @@ -/********** -STAG version 2.7 -Copyright 2000 owned by the United Kingdom Secretary of State for Defence -acting through the Defence Evaluation and Research Agency. -Developed by : Jim Benson, - Department of Electronics and Computer Science, - University of Southampton, - United Kingdom. -With help from : Nele D'Halleweyn, Ketan Mistry, Bill Redman-White, and Craig Easson. - -Based on STAG version 2.1 -Developed by : Mike Lee, -With help from : Bernard Tenbroek, Bill Redman-White, Mike Uren, Chris Edwards - and John Bunyan. -Acknowledgements : Rupert Howes and Pete Mole. -**********/ - -/********** -Modified by Paolo Nenzi 2002 -ngspice integration -**********/ - -#include "ngspice/ngspice.h" -#include "soi3defs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -SOI3delete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); -#if 0 - /* fixme, why not ? */ - SOI3instance *inst = (SOI3instance *) gen_inst; - FREE(inst->SOI3sens); -#endif - return OK; -} diff --git a/src/spicelib/devices/soi3/soi3dest.c b/src/spicelib/devices/soi3/soi3dest.c deleted file mode 100644 index e6510283c..000000000 --- a/src/spicelib/devices/soi3/soi3dest.c +++ /dev/null @@ -1,31 +0,0 @@ -/********** -STAG version 2.7 -Copyright 2000 owned by the United Kingdom Secretary of State for Defence -acting through the Defence Evaluation and Research Agency. -Developed by : Jim Benson, - Department of Electronics and Computer Science, - University of Southampton, - United Kingdom. -With help from : Nele D'Halleweyn, Ketan Mistry, Bill Redman-White, and Craig Easson. - -Based on STAG version 2.1 -Developed by : Mike Lee, -With help from : Bernard Tenbroek, Bill Redman-White, Mike Uren, Chris Edwards - and John Bunyan. -Acknowledgements : Rupert Howes and Pete Mole. -**********/ - -/********** -Modified by Paolo Nenzi 2002 -ngspice integration -**********/ - -#include "ngspice/ngspice.h" -#include "soi3defs.h" -#include "ngspice/suffix.h" - - -void -SOI3destroy(void) -{ -} diff --git a/src/spicelib/devices/soi3/soi3ext.h b/src/spicelib/devices/soi3/soi3ext.h index d54c28e0b..c1d07c99e 100644 --- a/src/spicelib/devices/soi3/soi3ext.h +++ b/src/spicelib/devices/soi3/soi3ext.h @@ -23,12 +23,9 @@ ngspice integration extern int SOI3acLoad(GENmodel *,CKTcircuit*); extern int SOI3ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int SOI3delete(GENinstance*); -extern void SOI3destroy(void); extern int SOI3getic(GENmodel*,CKTcircuit*); extern int SOI3load(GENmodel*,CKTcircuit*); extern int SOI3mAsk(CKTcircuit *,GENmodel *,int,IFvalue*); -extern int SOI3mDelete(GENmodel*); extern int SOI3mParam(int,IFvalue*,GENmodel*); extern void SOI3cap(double,double,double, double*,double*,double*,double*, diff --git a/src/spicelib/devices/soi3/soi3init.c b/src/spicelib/devices/soi3/soi3init.c index 505a0942d..acd25b8ed 100644 --- a/src/spicelib/devices/soi3/soi3init.c +++ b/src/spicelib/devices/soi3/soi3init.c @@ -42,9 +42,9 @@ SPICEdev SOI3info = { .DEVfindBranch = NULL, .DEVacLoad = SOI3acLoad, .DEVaccept = NULL, - .DEVdestroy = SOI3destroy, - .DEVmodDelete = SOI3mDelete, - .DEVdelete = SOI3delete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = SOI3getic, .DEVask = SOI3ask, .DEVmodAsk = SOI3mAsk, diff --git a/src/spicelib/devices/soi3/soi3mdel.c b/src/spicelib/devices/soi3/soi3mdel.c deleted file mode 100644 index 85a47750a..000000000 --- a/src/spicelib/devices/soi3/soi3mdel.c +++ /dev/null @@ -1,34 +0,0 @@ -/********** -STAG version 2.7 -Copyright 2000 owned by the United Kingdom Secretary of State for Defence -acting through the Defence Evaluation and Research Agency. -Developed by : Jim Benson, - Department of Electronics and Computer Science, - University of Southampton, - United Kingdom. -With help from : Nele D'Halleweyn, Ketan Mistry, Bill Redman-White, and Craig Easson. - -Based on STAG version 2.1 -Developed by : Mike Lee, -With help from : Bernard Tenbroek, Bill Redman-White, Mike Uren, Chris Edwards - and John Bunyan. -Acknowledgements : Rupert Howes and Pete Mole. -**********/ - -/********** - Modified by Paolo Nenzi 2002 - ngspice integration -**********/ - -#include "ngspice/ngspice.h" -#include "soi3defs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -SOI3mDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/soi3/soi3set.c b/src/spicelib/devices/soi3/soi3set.c index 703b9cea2..c7392672e 100644 --- a/src/spicelib/devices/soi3/soi3set.c +++ b/src/spicelib/devices/soi3/soi3set.c @@ -334,7 +334,7 @@ SOI3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) here->SOI3states = *states; *states += SOI3numStates; /* if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & TRANSEN) ){ - *states += 10 * (ckt->CKTsenInfo->SENparms); + *states += SOI3numSenStates * (ckt->CKTsenInfo->SENparms); } */ /****** Part 4 - check resistance values for internal nodes, ******/ diff --git a/src/spicelib/devices/sw/Makefile.am b/src/spicelib/devices/sw/Makefile.am index 6451924ba..312f9cbb5 100644 --- a/src/spicelib/devices/sw/Makefile.am +++ b/src/spicelib/devices/sw/Makefile.am @@ -7,15 +7,12 @@ libsw_la_SOURCES = \ swacload.c \ swask.c \ swdefs.h \ - swdelete.c \ - swdest.c \ swext.h \ swinit.c \ swinit.h \ switf.h \ swload.c \ swmask.c \ - swmdel.c \ swmparam.c \ swnoise.c \ swparam.c \ diff --git a/src/spicelib/devices/sw/sw.c b/src/spicelib/devices/sw/sw.c index c1bb66a06..536060abb 100644 --- a/src/spicelib/devices/sw/sw.c +++ b/src/spicelib/devices/sw/sw.c @@ -9,27 +9,25 @@ Author: 1987 #include "swdefs.h" #include "ngspice/suffix.h" -IFparm SWpTable[] = { /* parameters */ - IP("on", SW_IC_ON, IF_FLAG,"Switch initially closed"), - IP("off", SW_IC_OFF, IF_FLAG,"Switch initially open"), - IOPU("pos_node", SW_POS_NODE,IF_INTEGER,"Positive node of switch"), - IOPU("neg_node", SW_NEG_NODE,IF_INTEGER,"Negative node of switch"), - OPU("cont_p_node",SW_POS_CONT_NODE,IF_INTEGER, - "Positive contr. node of switch"), - OPU("cont_n_node",SW_NEG_CONT_NODE,IF_INTEGER, - "Positive contr. node of switch"), - OP("i", SW_CURRENT, IF_REAL, "Switch current"), - OP("p", SW_POWER, IF_REAL, "Switch power") +IFparm SWpTable[] = { /* parameters */ + IP("on", SW_IC_ON, IF_FLAG, "Switch initially closed"), + IP("off", SW_IC_OFF, IF_FLAG, "Switch initially open"), + IOPU("pos_node", SW_POS_NODE, IF_INTEGER, "Positive node of switch"), + IOPU("neg_node", SW_NEG_NODE, IF_INTEGER, "Negative node of switch"), + OPU("cont_p_node", SW_POS_CONT_NODE, IF_INTEGER, "Positive contr. node of switch"), + OPU("cont_n_node", SW_NEG_CONT_NODE, IF_INTEGER, "Positive contr. node of switch"), + OP("i", SW_CURRENT, IF_REAL, "Switch current"), + OP("p", SW_POWER, IF_REAL, "Switch power") }; IFparm SWmPTable[] = { /* model parameters */ - IOPU( "sw", SW_MOD_SW, IF_FLAG,"Switch model"), - IOPU( "vt", SW_MOD_VTH, IF_REAL,"Threshold voltage"), - IOPU( "vh", SW_MOD_VHYS, IF_REAL,"Hysteresis voltage"), - IOPU( "ron", SW_MOD_RON, IF_REAL,"Resistance when closed"), - OPU( "gon", SW_MOD_GON, IF_REAL,"Conductance when closed"), - IOPU( "roff", SW_MOD_ROFF, IF_REAL,"Resistance when open"), - OPU( "goff", SW_MOD_GOFF, IF_REAL,"Conductance when open") + IOPU("sw", SW_MOD_SW, IF_FLAG, "Switch model"), + IOPU("vt", SW_MOD_VTH, IF_REAL, "Threshold voltage"), + IOPU("vh", SW_MOD_VHYS, IF_REAL, "Hysteresis voltage"), + IOPU("ron", SW_MOD_RON, IF_REAL, "Resistance when closed"), + OPU("gon", SW_MOD_GON, IF_REAL, "Conductance when closed"), + IOPU("roff", SW_MOD_ROFF, IF_REAL, "Resistance when open"), + OPU("goff", SW_MOD_GOFF, IF_REAL, "Conductance when open") }; char *SWnames[] = { @@ -39,8 +37,8 @@ char *SWnames[] = { "SC-" }; -int SWnSize = NUMELEMS(SWnames); -int SWpTSize = NUMELEMS(SWpTable); -int SWmPTSize = NUMELEMS(SWmPTable); -int SWiSize = sizeof(SWinstance); -int SWmSize = sizeof(SWmodel); +int SWnSize = NUMELEMS(SWnames); +int SWpTSize = NUMELEMS(SWpTable); +int SWmPTSize = NUMELEMS(SWmPTable); +int SWiSize = sizeof(SWinstance); +int SWmSize = sizeof(SWmodel); diff --git a/src/spicelib/devices/sw/swacload.c b/src/spicelib/devices/sw/swacload.c index 5b6e71e82..e8b2c03d7 100644 --- a/src/spicelib/devices/sw/swacload.c +++ b/src/spicelib/devices/sw/swacload.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs **********/ -/* - */ #include "ngspice/ngspice.h" #include "ngspice/cktdefs.h" @@ -14,34 +12,26 @@ Author: 1985 Gordon Jacobs int SWacLoad(GENmodel *inModel, CKTcircuit *ckt) - /* load the current values into the - * sparse matrix previously provided - * during AC analysis. - */ { - SWmodel *model = (SWmodel *)inModel; + SWmodel *model = (SWmodel *) inModel; SWinstance *here; double g_now; int current_state; - /* loop through all the switch models */ - for( ; model != NULL; model = SWnextModel(model)) { - - /* loop through all the instances of the model */ - for (here = SWinstances(model); here != NULL ; - here=SWnextInstance(here)) { + for (; model; model = SWnextModel(model)) + for (here = SWinstances(model); here; here = SWnextInstance(here)) { /* In AC analysis, just propogate the state... */ - current_state = (int)*(ckt->CKTstate0 + here->SWstate); + current_state = (int) ckt->CKTstate0[here->SWswitchstate]; - g_now = current_state?(model->SWonConduct):(model->SWoffConduct); + g_now = current_state ? model->SWonConduct : model->SWoffConduct; *(here->SWposPosPtr) += g_now; *(here->SWposNegPtr) -= g_now; *(here->SWnegPosPtr) -= g_now; *(here->SWnegNegPtr) += g_now; } - } - return(OK); + + return OK; } diff --git a/src/spicelib/devices/sw/swask.c b/src/spicelib/devices/sw/swask.c index 7af8f7511..8c1555c04 100644 --- a/src/spicelib/devices/sw/swask.c +++ b/src/spicelib/devices/sw/swask.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1987 Thomas L. Quarles **********/ -/* - */ /* * This routine gives access to the internal device parameters @@ -19,56 +17,56 @@ Author: 1987 Thomas L. Quarles #include "ngspice/suffix.h" -/* ARGSUSED */ int SWask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *select) { - SWinstance *here = (SWinstance *)inst; + SWinstance *here = (SWinstance *) inst; static char *msg = "Current and power not available in ac analysis"; NG_IGNORE(select); - switch(which) { - case SW_POS_NODE: - value->iValue = here->SWposNode; - return (OK); - case SW_NEG_NODE: - value->iValue = here->SWnegNode; - return (OK); - case SW_POS_CONT_NODE: - value->iValue = here->SWposCntrlNode; - return (OK); - case SW_NEG_CONT_NODE: - value->iValue = here->SWnegCntrlNode; - return (OK); - case SW_CURRENT: - if (ckt->CKTcurrentAnalysis & DOING_AC) { - errMsg = TMALLOC(char, strlen(msg) + 1); - errRtn = "SWask"; - strcpy(errMsg,msg); - return(E_ASKCURRENT); - } else { - value->rValue = (*(ckt->CKTrhsOld + here->SWposNode) - - *(ckt->CKTrhsOld + here->SWnegNode)) * - here->SWcond; - } - return(OK); - case SW_POWER: - if (ckt->CKTcurrentAnalysis & DOING_AC) { - errMsg = TMALLOC(char, strlen(msg) + 1); - errRtn = "SWask"; - strcpy(errMsg,msg); - return(E_ASKPOWER); - } else { - value->rValue = (*(ckt->CKTrhsOld + here->SWposNode) - - *(ckt->CKTrhsOld + here->SWnegNode)) * - (*(ckt->CKTrhsOld + here->SWposNode) - - *(ckt->CKTrhsOld + here->SWnegNode)) * - here->SWcond; - } - return(OK); - default: - return (E_BADPARM); + switch (which) { + case SW_POS_NODE: + value->iValue = here->SWposNode; + return OK; + case SW_NEG_NODE: + value->iValue = here->SWnegNode; + return OK; + case SW_POS_CONT_NODE: + value->iValue = here->SWposCntrlNode; + return OK; + case SW_NEG_CONT_NODE: + value->iValue = here->SWnegCntrlNode; + return OK; + case SW_CURRENT: + if (ckt->CKTcurrentAnalysis & DOING_AC) { + errMsg = TMALLOC(char, strlen(msg) + 1); + errRtn = "SWask"; + strcpy(errMsg, msg); + return E_ASKCURRENT; + } else { + value->rValue = + (ckt->CKTrhsOld[here->SWposNode] - + ckt->CKTrhsOld[here->SWnegNode]) * + here->SWcond; + } + return OK; + case SW_POWER: + if (ckt->CKTcurrentAnalysis & DOING_AC) { + errMsg = TMALLOC(char, strlen(msg) + 1); + errRtn = "SWask"; + strcpy(errMsg, msg); + return E_ASKPOWER; + } else { + value->rValue = + (ckt->CKTrhsOld[here->SWposNode] - + ckt->CKTrhsOld[here->SWnegNode]) * + (ckt->CKTrhsOld[here->SWposNode] - + ckt->CKTrhsOld[here->SWnegNode]) * + here->SWcond; + } + return OK; + default: + return E_BADPARM; } - /* NOTREACHED */ } diff --git a/src/spicelib/devices/sw/swdefs.h b/src/spicelib/devices/sw/swdefs.h index b22f12e6d..55d6e5c4c 100644 --- a/src/spicelib/devices/sw/swdefs.h +++ b/src/spicelib/devices/sw/swdefs.h @@ -13,7 +13,7 @@ Modified: 2000 AlansFixes #include "ngspice/complex.h" #include "ngspice/noisedef.h" - /* structures used to describe voltage controlled switches */ +/* structures used to describe voltage controlled switches */ /* information to describe each instance */ @@ -27,43 +27,47 @@ typedef struct sSWinstance { #define SWname gen.GENname #define SWstate gen.GENstate - const int SWposNode; /* number of positive node of switch */ - const int SWnegNode; /* number of negative node of switch */ + const int SWposNode; /* number of positive node of switch */ + const int SWnegNode; /* number of negative node of switch */ const int SWposCntrlNode; /* number of positive controlling node of switch */ const int SWnegCntrlNode; /* number of negative controlling node of switch */ double *SWposPosPtr; /* pointer to sparse matrix diagonal at - (positive,positive) for switch conductance */ + (positive,positive) for switch conductance */ double *SWnegPosPtr; /* pointer to sparse matrix offdiagonal at - (neagtive,positive) for switch conductance */ + (neagtive,positive) for switch conductance */ double *SWposNegPtr; /* pointer to sparse matrix offdiagonal at - (positive,neagtive) for switch conductance */ + (positive,neagtive) for switch conductance */ double *SWnegNegPtr; /* pointer to sparse matrix diagonal at - (neagtive,neagtive) for switch conductance */ + (neagtive,neagtive) for switch conductance */ - double SWcond; /* conductance of the switch now */ + double SWcond; /* conductance of the switch now */ unsigned SWzero_stateGiven : 1; /* flag to indicate initial state */ #ifndef NONOISE double SWnVar[NSTATVARS]; -#else /* NONOISE */ +#else double *SWnVar; -#endif /* NONOISE */ - -#ifdef KLU - BindElement *SWposPosBinding ; - BindElement *SWposNegBinding ; - BindElement *SWnegPosBinding ; - BindElement *SWnegNegBinding ; #endif -} SWinstance ; +#ifdef KLU + BindElement *SWposPosBinding; + BindElement *SWposNegBinding; + BindElement *SWnegPosBinding; + BindElement *SWnegNegBinding; +#endif + +} SWinstance; /* data per model */ #define SW_ON_CONDUCTANCE 1.0 /* default on conductance = 1 mho */ #define SW_OFF_CONDUCTANCE ckt->CKTgmin /* default off conductance */ -#define SW_NUM_STATES 2 +#define SW_NUM_STATES 2 + +#define SWswitchstate SWstate+0 +#define SWctrlvalue SWstate+1 + typedef struct sSWmodel { /* model structure for a switch */ @@ -71,7 +75,7 @@ typedef struct sSWmodel { /* model structure for a switch */ #define SWmodType gen.GENmodType #define SWnextModel(inst) ((struct sSWmodel *)((inst)->gen.GENnextModel)) -#define SWinstances(inst) ((SWinstance *)((inst)->gen.GENinstances)) +#define SWinstances(inst) ((SWinstance *) ((inst)->gen.GENinstances)) #define SWmodName gen.GENmodName double SWonResistance; /* switch "on" resistance */ @@ -81,10 +85,10 @@ typedef struct sSWmodel { /* model structure for a switch */ double SWonConduct; /* switch "on" conductance */ double SWoffConduct; /* switch "off" conductance */ - unsigned SWonGiven : 1; /* flag to indicate on-resistance was specified */ - unsigned SWoffGiven : 1; /* flag to indicate off-resistance was " */ + unsigned SWonGiven : 1; /* flag to indicate on-resistance was specified */ + unsigned SWoffGiven : 1; /* flag to indicate off-resistance was " */ unsigned SWthreshGiven : 1; /* flag to indicate threshold volt was given */ - unsigned SWhystGiven : 1; /* flag to indicate hysteresis volt was given */ + unsigned SWhystGiven : 1; /* flag to indicate hysteresis volt was given */ } SWmodel; /* device parameters */ @@ -112,4 +116,4 @@ typedef struct sSWmodel { /* model structure for a switch */ #include "swext.h" -#endif /*SW*/ +#endif diff --git a/src/spicelib/devices/sw/swdelete.c b/src/spicelib/devices/sw/swdelete.c deleted file mode 100644 index 7c3ef4d29..000000000 --- a/src/spicelib/devices/sw/swdelete.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Gordon Jacobs -**********/ - -#include "ngspice/ngspice.h" -#include "swdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -SWdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/sw/swdest.c b/src/spicelib/devices/sw/swdest.c deleted file mode 100644 index 03f408c3d..000000000 --- a/src/spicelib/devices/sw/swdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Gordon Jacobs -**********/ - -#include "ngspice/ngspice.h" -#include "swdefs.h" -#include "ngspice/suffix.h" - - -void -SWdestroy(void) -{ -} diff --git a/src/spicelib/devices/sw/swext.h b/src/spicelib/devices/sw/swext.h index 2bcdf57d8..b65658693 100644 --- a/src/spicelib/devices/sw/swext.h +++ b/src/spicelib/devices/sw/swext.h @@ -4,22 +4,19 @@ Author: 1985 Gordon M. Jacobs Modified: 2000 AlansFixes **********/ -extern int SWacLoad(GENmodel*,CKTcircuit*); -extern int SWask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int SWdelete(GENinstance*); -extern void SWdestroy(void); -extern int SWload(GENmodel*,CKTcircuit*); -extern int SWmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int SWmDelete(GENmodel*); -extern int SWmParam(int,IFvalue*,GENmodel*); -extern int SWparam(int,IFvalue*,GENinstance*,IFvalue*); -extern int SWpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); -extern int SWsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); -extern int SWnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); -extern int SWtrunc(GENmodel*,CKTcircuit*,double*); +extern int SWacLoad(GENmodel *, CKTcircuit *); +extern int SWask(CKTcircuit *, GENinstance *, int, IFvalue *, IFvalue *); +extern int SWload(GENmodel *, CKTcircuit *); +extern int SWmAsk(CKTcircuit *, GENmodel *, int, IFvalue *); +extern int SWmParam(int, IFvalue *, GENmodel *); +extern int SWparam(int, IFvalue *, GENinstance *, IFvalue *); +extern int SWpzLoad(GENmodel *, CKTcircuit *, SPcomplex *); +extern int SWsetup(SMPmatrix *, GENmodel *, CKTcircuit *, int *); +extern int SWnoise(int, int, GENmodel *, CKTcircuit *, Ndata *, double *); +extern int SWtrunc(GENmodel *, CKTcircuit *, double *); #ifdef KLU -extern int SWbindCSC (GENmodel*, CKTcircuit*) ; -extern int SWbindCSCComplex (GENmodel*, CKTcircuit*) ; -extern int SWbindCSCComplexToReal (GENmodel*, CKTcircuit*) ; +extern int SWbindCSC(GENmodel *, CKTcircuit *); +extern int SWbindCSCComplex(GENmodel *, CKTcircuit *); +extern int SWbindCSCComplexToReal(GENmodel *, CKTcircuit *); #endif diff --git a/src/spicelib/devices/sw/swinit.c b/src/spicelib/devices/sw/swinit.c index 427187f6d..32923e8ff 100644 --- a/src/spicelib/devices/sw/swinit.c +++ b/src/spicelib/devices/sw/swinit.c @@ -43,9 +43,9 @@ SPICEdev SWinfo = { .DEVfindBranch = NULL, .DEVacLoad = SWacLoad, .DEVaccept = NULL, - .DEVdestroy = SWdestroy, - .DEVmodDelete = SWmDelete, - .DEVdelete = SWdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = SWask, .DEVmodAsk = SWmAsk, diff --git a/src/spicelib/devices/sw/swinit.h b/src/spicelib/devices/sw/swinit.h index 968f0bbf5..2ec0cd37c 100644 --- a/src/spicelib/devices/sw/swinit.h +++ b/src/spicelib/devices/sw/swinit.h @@ -1,9 +1,9 @@ #ifndef _SWINIT_H #define _SWINIT_H -extern IFparm SWpTable[ ]; -extern IFparm SWmPTable[ ]; -extern char *SWnames[ ]; +extern IFparm SWpTable[]; +extern IFparm SWmPTable[]; +extern char *SWnames[]; extern int SWpTSize; extern int SWmPTSize; extern int SWnSize; diff --git a/src/spicelib/devices/sw/swload.c b/src/spicelib/devices/sw/swload.c index a492b4a77..4150d736f 100644 --- a/src/spicelib/devices/sw/swload.c +++ b/src/spicelib/devices/sw/swload.c @@ -12,56 +12,51 @@ Modified: 2001 Jon Engelbert #include "ngspice/sperror.h" #include "ngspice/suffix.h" + int SWload(GENmodel *inModel, CKTcircuit *ckt) - /* actually load the current values into the - * sparse matrix previously provided - */ { SWmodel *model = (SWmodel *) inModel; SWinstance *here; double g_now; double v_ctrl; - double previous_state = -1; + double previous_state = -1; double current_state = -1; - double old_current_state = -1; - double REALLY_OFF = 0, REALLY_ON = 1; // switch is on or off, not in hysteresis region. - double HYST_OFF = 2, HYST_ON = 3; // switch is on or off while control value is in hysteresis region. -// double previous_region = -1; -// double current_region = -1; + double old_current_state = -1; + double REALLY_OFF = 0, REALLY_ON = 1; // switch is on or off, not in hysteresis region. + double HYST_OFF = 2, HYST_ON = 3; // switch is on or off while control value is in hysteresis region. + // double previous_region = -1; + // double current_region = -1; - /* loop through all the switch models */ - for( ; model != NULL; model = SWnextModel(model)) { + for (; model; model = SWnextModel(model)) + for (here = SWinstances(model); here; here = SWnextInstance(here)) { - /* loop through all the instances of the model */ - for (here = SWinstances(model); here != NULL ; - here=SWnextInstance(here)) { - - old_current_state = *(ckt->CKTstates[0] + here->SWstate); - previous_state = *(ckt->CKTstates[1] + here->SWstate); + old_current_state = ckt->CKTstate0[here->SWswitchstate]; + previous_state = ckt->CKTstate1[here->SWswitchstate]; - v_ctrl = *(ckt->CKTrhsOld + here->SWposCntrlNode) - - *(ckt->CKTrhsOld + here->SWnegCntrlNode); - - /* decide the state of the switch */ - - if(ckt->CKTmode & (MODEINITFIX|MODEINITJCT)) { + v_ctrl = + ckt->CKTrhsOld[here->SWposCntrlNode] - + ckt->CKTrhsOld[here->SWnegCntrlNode]; - if(here->SWzero_stateGiven) { - /* switch specified "on" */ - if ((model->SWvHysteresis >= 0) && (v_ctrl > (model->SWvThreshold + model->SWvHysteresis))) - current_state = REALLY_ON; - else if ((model->SWvHysteresis < 0) && (v_ctrl > (model->SWvThreshold - model->SWvHysteresis))) - current_state = REALLY_ON; - else - current_state = HYST_ON; + /* decide the state of the switch */ + + if (ckt->CKTmode & (MODEINITFIX | MODEINITJCT)) { + + if (here->SWzero_stateGiven) { + /* switch specified "on" */ + if (model->SWvHysteresis >= 0 && v_ctrl > model->SWvThreshold + model->SWvHysteresis) + current_state = REALLY_ON; + else if (model->SWvHysteresis < 0 && v_ctrl > model->SWvThreshold - model->SWvHysteresis) + current_state = REALLY_ON; + else + current_state = HYST_ON; } else { - if ((model->SWvHysteresis >= 0) && (v_ctrl < (model->SWvThreshold - model->SWvHysteresis))) - current_state = REALLY_OFF; - else if ((model->SWvHysteresis < 0) && (v_ctrl < (model->SWvThreshold + model->SWvHysteresis))) - current_state = REALLY_OFF; - else - current_state = HYST_OFF; + if (model->SWvHysteresis >= 0 && v_ctrl < model->SWvThreshold - model->SWvHysteresis) + current_state = REALLY_OFF; + else if (model->SWvHysteresis < 0 && v_ctrl < model->SWvThreshold + model->SWvHysteresis) + current_state = REALLY_OFF; + else + current_state = HYST_OFF; } } else if (ckt->CKTmode & (MODEINITSMSIG)) { @@ -71,79 +66,77 @@ SWload(GENmodel *inModel, CKTcircuit *ckt) } else if (ckt->CKTmode & (MODEINITFLOAT)) { /* use state0 since INITTRAN or INITPRED already called */ - if (model->SWvHysteresis > 0) { - if (v_ctrl > (model->SWvThreshold + model->SWvHysteresis)) { - current_state = REALLY_ON; - } else if (v_ctrl < (model->SWvThreshold - model->SWvHysteresis)) { - current_state = REALLY_OFF; - } else { - current_state = old_current_state; - } - } else { // negative hysteresis case. - if (v_ctrl > (model->SWvThreshold - model->SWvHysteresis)) - { - current_state = REALLY_ON; - } else if (v_ctrl < (model->SWvThreshold + model->SWvHysteresis)) - { - current_state = REALLY_OFF; - } else { // in hysteresis... change value if going from low to hysteresis, or from hi to hysteresis. - // if previous state was in hysteresis, then don't change the state.. - if ((previous_state == HYST_OFF) || (previous_state == HYST_ON)) { - current_state = previous_state; - } else if (previous_state == REALLY_ON) { - current_state = HYST_OFF; - } else if (previous_state == REALLY_OFF) { - current_state = HYST_ON; - } else - internalerror("bad value for previous state in swload"); - } - } - - if(current_state != old_current_state) { - ckt->CKTnoncon++; /* ensure one more iteration */ - ckt->CKTtroubleElt = (GENinstance *) here; + if (model->SWvHysteresis > 0) { + if (v_ctrl > (model->SWvThreshold + model->SWvHysteresis)) + current_state = REALLY_ON; + else if (v_ctrl < (model->SWvThreshold - model->SWvHysteresis)) + current_state = REALLY_OFF; + else + current_state = old_current_state; + } else { // negative hysteresis case. + if (v_ctrl > (model->SWvThreshold - model->SWvHysteresis)) + current_state = REALLY_ON; + else if (v_ctrl < (model->SWvThreshold + model->SWvHysteresis)) + current_state = REALLY_OFF; + else { // in hysteresis... change value if going from low to hysteresis, or from hi to hysteresis. + // if previous state was in hysteresis, then don't change the state.. + if (previous_state == HYST_OFF || previous_state == HYST_ON) + current_state = previous_state; + else if (previous_state == REALLY_ON) + current_state = HYST_OFF; + else if (previous_state == REALLY_OFF) + current_state = HYST_ON; + else + internalerror("bad value for previous state in swload"); + } } + if (current_state != old_current_state) { + ckt->CKTnoncon++; /* ensure one more iteration */ + ckt->CKTtroubleElt = (GENinstance *) here; + } - } else if(ckt->CKTmode & (MODEINITTRAN|MODEINITPRED) ) { + } else if (ckt->CKTmode & (MODEINITTRAN | MODEINITPRED)) { - if (model->SWvHysteresis > 0) { - if (v_ctrl > (model->SWvThreshold + model->SWvHysteresis)) - current_state = REALLY_ON; - else if (v_ctrl < (model->SWvThreshold - model->SWvHysteresis)) - current_state = REALLY_OFF; - else - current_state = previous_state; - } else { // negative hysteresis case. - if (v_ctrl > (model->SWvThreshold - model->SWvHysteresis)) - current_state = REALLY_ON; - else if (v_ctrl < (model->SWvThreshold + model->SWvHysteresis)) - current_state = REALLY_OFF; - else { - current_state = 0.0; - if ((previous_state == HYST_ON) || (previous_state == HYST_OFF)) { - current_state = previous_state; - } else if (previous_state == REALLY_ON) { - current_state = REALLY_OFF; - } else if (previous_state == REALLY_OFF) { - current_state = REALLY_ON; - } - } - } - } -// code added to force the state to be updated. -// there is a possible problem. What if, during the transient analysis, the time is stepped -// forward enough to change the switch's state, but that time point is rejected as being too -// distant and then the time is pushed back to a time before the switch changed states. -// After analyzing the transient code, it seems that this is not a problem because state updating -// occurs before the convergence loop in transient processing. - *(ckt->CKTstates[0] + here->SWstate) = current_state; - *(ckt->CKTstates[0] + here->SWstate + 1) = v_ctrl; + if (model->SWvHysteresis > 0) { + if (v_ctrl > (model->SWvThreshold + model->SWvHysteresis)) + current_state = REALLY_ON; + else if (v_ctrl < (model->SWvThreshold - model->SWvHysteresis)) + current_state = REALLY_OFF; + else + current_state = previous_state; + } else { // negative hysteresis case. + if (v_ctrl > (model->SWvThreshold - model->SWvHysteresis)) + current_state = REALLY_ON; + else if (v_ctrl < (model->SWvThreshold + model->SWvHysteresis)) + current_state = REALLY_OFF; + else { + current_state = 0.0; + if (previous_state == HYST_ON || previous_state == HYST_OFF) + current_state = previous_state; + else if (previous_state == REALLY_ON) + current_state = REALLY_OFF; + else if (previous_state == REALLY_OFF) + current_state = REALLY_ON; + } + } + } + + // code added to force the state to be updated. + // there is a possible problem. What if, during the transient analysis, the time is stepped + // forward enough to change the switch's state, but that time point is rejected as being too + // distant and then the time is pushed back to a time before the switch changed states. + // After analyzing the transient code, it seems that this is not a problem because state updating + // occurs before the convergence loop in transient processing. + + ckt->CKTstate0[here->SWswitchstate] = current_state; + ckt->CKTstate0[here->SWctrlvalue] = v_ctrl; + + if (current_state == REALLY_ON || current_state == HYST_ON) + g_now = model->SWonConduct; + else + g_now = model->SWoffConduct; - if ((current_state == REALLY_ON) || (current_state == HYST_ON)) - g_now = model->SWonConduct; - else - g_now = model->SWoffConduct; here->SWcond = g_now; *(here->SWposPosPtr) += g_now; @@ -151,6 +144,6 @@ SWload(GENmodel *inModel, CKTcircuit *ckt) *(here->SWnegPosPtr) -= g_now; *(here->SWnegNegPtr) += g_now; } - } - return(OK); + + return OK; } diff --git a/src/spicelib/devices/sw/swmask.c b/src/spicelib/devices/sw/swmask.c index ff8a0c3aa..3fec325d2 100644 --- a/src/spicelib/devices/sw/swmask.c +++ b/src/spicelib/devices/sw/swmask.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1987 Thomas L. Quarles **********/ -/* - */ /* * This routine gives access to the internal model parameter @@ -19,35 +17,33 @@ Author: 1987 Thomas L. Quarles #include "ngspice/suffix.h" -/* ARGSUSED */ int SWmAsk(CKTcircuit *ckt, GENmodel *inModel, int which, IFvalue *value) { - SWmodel *model = (SWmodel *)inModel; + SWmodel *model = (SWmodel *) inModel; NG_IGNORE(ckt); - switch(which) { - case SW_MOD_RON: - value->rValue = model->SWonResistance; - return (OK); - case SW_MOD_ROFF: - value->rValue = model->SWoffResistance; - return (OK); - case SW_MOD_VTH: - value->rValue = model->SWvThreshold; - return (OK); - case SW_MOD_VHYS: - value->rValue = model->SWvHysteresis; - return (OK); - case SW_MOD_GON: - value->rValue = model->SWonConduct; - return (OK); - case SW_MOD_GOFF: - value->rValue = model->SWoffConduct; - return (OK); - default: - return (E_BADPARM); + switch (which) { + case SW_MOD_RON: + value->rValue = model->SWonResistance; + return OK; + case SW_MOD_ROFF: + value->rValue = model->SWoffResistance; + return OK; + case SW_MOD_VTH: + value->rValue = model->SWvThreshold; + return OK; + case SW_MOD_VHYS: + value->rValue = model->SWvHysteresis; + return OK; + case SW_MOD_GON: + value->rValue = model->SWonConduct; + return OK; + case SW_MOD_GOFF: + value->rValue = model->SWoffConduct; + return OK; + default: + return E_BADPARM; } - /* NOTREACHED */ } diff --git a/src/spicelib/devices/sw/swmdel.c b/src/spicelib/devices/sw/swmdel.c deleted file mode 100644 index c7e6ac5cc..000000000 --- a/src/spicelib/devices/sw/swmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Gordon Jacobs -**********/ - -#include "ngspice/ngspice.h" -#include "swdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -SWmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/sw/swmparam.c b/src/spicelib/devices/sw/swmparam.c index 1eb1b1478..501c54618 100644 --- a/src/spicelib/devices/sw/swmparam.c +++ b/src/spicelib/devices/sw/swmparam.c @@ -3,8 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs Modified: 2001 Jon Engelbert **********/ -/* - */ #include "ngspice/ngspice.h" #include "swdefs.h" @@ -16,36 +14,37 @@ Modified: 2001 Jon Engelbert int SWmParam(int param, IFvalue *value, GENmodel *inModel) { - SWmodel *model = (SWmodel *)inModel; - switch(param) { - case SW_MOD_SW: - /* just says that this is a switch */ - break; - case SW_MOD_RON: - model->SWonResistance = value->rValue; - model->SWonConduct = 1.0/(value->rValue); - model->SWonGiven = TRUE; - break; - case SW_MOD_ROFF: - model->SWoffResistance = value->rValue; - model->SWoffConduct = 1.0/(value->rValue); - model->SWoffGiven = TRUE; - break; - case SW_MOD_VTH: - /* take absolute value of hysteresis voltage */ - model->SWvThreshold = value->rValue; - model->SWthreshGiven = TRUE; - break; - case SW_MOD_VHYS: - /* take absolute value of hysteresis voltage */ -// model->SWvHysteresis = (value->rValue < 0) ? -(value->rValue) : -// value->rValue; - model->SWvHysteresis = value->rValue; - model->SWhystGiven = TRUE; - break; - default: - return(E_BADPARM); + SWmodel *model = (SWmodel *) inModel; + + switch (param) { + case SW_MOD_SW: + /* just says that this is a switch */ + break; + case SW_MOD_RON: + model->SWonResistance = value->rValue; + model->SWonConduct = 1.0 / value->rValue; + model->SWonGiven = TRUE; + break; + case SW_MOD_ROFF: + model->SWoffResistance = value->rValue; + model->SWoffConduct = 1.0 / value->rValue; + model->SWoffGiven = TRUE; + break; + case SW_MOD_VTH: + /* take absolute value of hysteresis voltage */ + model->SWvThreshold = value->rValue; + model->SWthreshGiven = TRUE; + break; + case SW_MOD_VHYS: + /* take absolute value of hysteresis voltage */ + // model->SWvHysteresis = (value->rValue < 0) ? -(value->rValue) : + // value->rValue; + model->SWvHysteresis = value->rValue; + model->SWhystGiven = TRUE; + break; + default: + return E_BADPARM; } - return(OK); + return OK; } diff --git a/src/spicelib/devices/sw/swnoise.c b/src/spicelib/devices/sw/swnoise.c index 1e429a2e1..ed0ce79c6 100644 --- a/src/spicelib/devices/sw/swnoise.c +++ b/src/spicelib/devices/sw/swnoise.c @@ -22,7 +22,7 @@ Author: 1987 Gary W. Ng int -SWnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata *data, double *OnDens) +SWnoise(int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata *data, double *OnDens) { NOISEAN *job = (NOISEAN *) ckt->CKTcurJob; @@ -35,88 +35,81 @@ SWnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata *da double lnNdens; int current_state; + for (model = firstModel; model; model = SWnextModel(model)) + for (inst = SWinstances(model); inst; inst = SWnextInstance(inst)) { - for (model=firstModel; model != NULL; model=SWnextModel(model)) { - for (inst=SWinstances(model); inst != NULL; inst=SWnextInstance(inst)) { + switch (operation) { - switch (operation) { + case N_OPEN: - case N_OPEN: + /* see if we have to to produce a summary report */ + /* if so, name the noise generator */ - /* see if we have to to produce a summary report */ - /* if so, name the noise generator */ + if (job->NStpsSm != 0) + switch (mode) { + case N_DENS: + NOISE_ADD_OUTVAR(ckt, data, "onoise_%s%s", inst->SWname, ""); + break; + case INT_NOIZ: + NOISE_ADD_OUTVAR(ckt, data, "onoise_total_%s%s", inst->SWname, ""); + NOISE_ADD_OUTVAR(ckt, data, "inoise_total_%s%s", inst->SWname, ""); + break; + } + break; - if (job->NStpsSm != 0) { - switch (mode) { + case N_CALC: + switch (mode) { - case N_DENS: - NOISE_ADD_OUTVAR(ckt, data, "onoise_%s%s", inst->SWname, ""); - break; + case N_DENS: + current_state = (int) ckt->CKTstate0[inst->SWswitchstate]; + NevalSrc(&noizDens, &lnNdens, ckt, THERMNOISE, + inst->SWposNode, inst->SWnegNode, + current_state ? model->SWonConduct : model->SWoffConduct); - case INT_NOIZ: - NOISE_ADD_OUTVAR(ckt, data, "onoise_total_%s%s", inst->SWname, ""); - NOISE_ADD_OUTVAR(ckt, data, "inoise_total_%s%s", inst->SWname, ""); - break; - } - } - break; + *OnDens += noizDens; - case N_CALC: - switch (mode) { + if (data->delFreq == 0.0) { - case N_DENS: - current_state = (int)*(ckt->CKTstate0 + inst->SWstate); - NevalSrc(&noizDens,&lnNdens,ckt,THERMNOISE, - inst->SWposNode,inst->SWnegNode, - current_state?(model->SWonConduct):(model->SWoffConduct)); + /* if we haven't done any previous integration, we need to */ + /* initialize our "history" variables */ - *OnDens += noizDens; + inst->SWnVar[LNLSTDENS] = lnNdens; - if (data->delFreq == 0.0) { + /* clear out our integration variable if it's the first pass */ - /* if we haven't done any previous integration, we need to */ - /* initialize our "history" variables */ + if (data->freq == job->NstartFreq) + inst->SWnVar[OUTNOIZ] = 0.0; + } else { /* data->delFreq != 0.0 (we have to integrate) */ + tempOutNoise = Nintegrate(noizDens, lnNdens, + inst->SWnVar[LNLSTDENS], data); + tempInNoise = Nintegrate(noizDens * + data->GainSqInv, lnNdens + data->lnGainInv, + inst->SWnVar[LNLSTDENS] + data->lnGainInv, + data); + inst->SWnVar[OUTNOIZ] += tempOutNoise; + inst->SWnVar[INNOIZ] += tempInNoise; + data->outNoiz += tempOutNoise; + data->inNoise += tempInNoise; + inst->SWnVar[LNLSTDENS] = lnNdens; + } + if (data->prtSummary) + data->outpVector[data->outNumber++] = noizDens; + break; - inst->SWnVar[LNLSTDENS] = lnNdens; + case INT_NOIZ: /* already calculated, just output */ + if (job->NStpsSm != 0) { + data->outpVector[data->outNumber++] = inst->SWnVar[OUTNOIZ]; + data->outpVector[data->outNumber++] = inst->SWnVar[INNOIZ]; + } + break; + } + break; - /* clear out our integration variable if it's the first pass */ + case N_CLOSE: + return OK; /* do nothing, the main calling routine will close */ + break; /* the plots */ + } + } - if (data->freq == job->NstartFreq) { - inst->SWnVar[OUTNOIZ] = 0.0; - } - } else { /* data->delFreq != 0.0 (we have to integrate) */ - tempOutNoise = Nintegrate(noizDens, lnNdens, - inst->SWnVar[LNLSTDENS], data); - tempInNoise = Nintegrate(noizDens * - data->GainSqInv ,lnNdens + data->lnGainInv, - inst->SWnVar[LNLSTDENS] + data->lnGainInv, - data); - inst->SWnVar[OUTNOIZ] += tempOutNoise; - inst->SWnVar[INNOIZ] += tempInNoise; - data->outNoiz += tempOutNoise; - data->inNoise += tempInNoise; - inst->SWnVar[LNLSTDENS] = lnNdens; - } - if (data->prtSummary) { - data->outpVector[data->outNumber++] = noizDens; - } - break; - - case INT_NOIZ: /* already calculated, just output */ - if (job->NStpsSm != 0) { - data->outpVector[data->outNumber++] = inst->SWnVar[OUTNOIZ]; - data->outpVector[data->outNumber++] = inst->SWnVar[INNOIZ]; - } /* if */ - break; - } /* switch (mode) */ - break; - - case N_CLOSE: - return (OK); /* do nothing, the main calling routine will close */ - break; /* the plots */ - } /* switch (operation) */ - } /* for inst */ - } /* for model */ - -return(OK); + return OK; } diff --git a/src/spicelib/devices/sw/swparam.c b/src/spicelib/devices/sw/swparam.c index bda497b0e..dd1bd9d0c 100644 --- a/src/spicelib/devices/sw/swparam.c +++ b/src/spicelib/devices/sw/swparam.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs **********/ -/* - */ #include "ngspice/ngspice.h" #include "swdefs.h" @@ -12,28 +10,25 @@ Author: 1985 Gordon Jacobs #include "ngspice/suffix.h" -/*ARGSUSED*/ int SWparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select) { - SWinstance *here = (SWinstance *)inst; + SWinstance *here = (SWinstance *) inst; NG_IGNORE(select); - switch(param) { - case SW_IC_ON: - if(value->iValue) { - here->SWzero_stateGiven = TRUE; - } - break; - case SW_IC_OFF: - if(value->iValue) { - here->SWzero_stateGiven = FALSE; - } - break; - default: - return(E_BADPARM); + switch (param) { + case SW_IC_ON: + if (value->iValue) + here->SWzero_stateGiven = TRUE; + break; + case SW_IC_OFF: + if (value->iValue) + here->SWzero_stateGiven = FALSE; + break; + default: + return E_BADPARM; } - return(OK); + return OK; } diff --git a/src/spicelib/devices/sw/swpzload.c b/src/spicelib/devices/sw/swpzload.c index ddcd08dc0..ff23edb16 100644 --- a/src/spicelib/devices/sw/swpzload.c +++ b/src/spicelib/devices/sw/swpzload.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs **********/ -/* - */ #include "ngspice/ngspice.h" #include "ngspice/cktdefs.h" @@ -13,39 +11,30 @@ Author: 1985 Gordon Jacobs #include "ngspice/suffix.h" -/* ARGSUSED */ int SWpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) - /* load the current values into the - * sparse matrix previously provided - * during AC analysis. - */ { - SWmodel *model = (SWmodel *)inModel; + SWmodel *model = (SWmodel *) inModel; SWinstance *here; double g_now; int current_state; NG_IGNORE(s); - /* loop through all the switch models */ - for( ; model != NULL; model = SWnextModel(model)) { - - /* loop through all the instances of the model */ - for (here = SWinstances(model); here != NULL ; - here=SWnextInstance(here)) { + for (; model; model = SWnextModel(model)) + for (here = SWinstances(model); here; here = SWnextInstance(here)) { /* In AC analysis, just propogate the state... */ - current_state = (int)*(ckt->CKTstate0 + here->SWstate); + current_state = (int) ckt->CKTstate0[here->SWswitchstate]; - g_now = current_state?(model->SWonConduct):(model->SWoffConduct); + g_now = current_state ? model->SWonConduct : model->SWoffConduct; *(here->SWposPosPtr) += g_now; *(here->SWposNegPtr) -= g_now; *(here->SWnegPosPtr) -= g_now; *(here->SWnegNegPtr) += g_now; } - } - return(OK); + + return OK; } diff --git a/src/spicelib/devices/sw/swsetup.c b/src/spicelib/devices/sw/swsetup.c index 41821e8fa..b13bc38c7 100644 --- a/src/spicelib/devices/sw/swsetup.c +++ b/src/spicelib/devices/sw/swsetup.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs **********/ -/* - */ #include "ngspice/ngspice.h" #include "ngspice/smpdefs.h" @@ -12,55 +10,47 @@ Author: 1985 Gordon Jacobs #include "ngspice/sperror.h" #include "ngspice/suffix.h" +#define TSTALLOC(ptr, first, second) \ + do { \ + if (!(here->ptr = SMPmakeElt(matrix, here->first, here->second))) \ + return E_NOMEM; \ + } while (0) + int SWsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) - /* load the switch conductance with those pointers needed later - * for fast matrix loading - */ { - SWmodel *model = (SWmodel *)inModel; + SWmodel *model = (SWmodel *) inModel; SWinstance *here; - /* loop through all the current source models */ - for( ; model != NULL; model = SWnextModel(model)) { + for (; model; model = SWnextModel(model)) { #ifdef USE_CUSPICE /* This model doesn't support CUDA */ - model->gen.has_cuda = 0 ; + model->gen.has_cuda = 0; #endif /* Default Value Processing for Switch Model */ - if (!model->SWthreshGiven) { + if (!model->SWthreshGiven) model->SWvThreshold = 0; - } - if (!model->SWhystGiven) { + if (!model->SWhystGiven) model->SWvHysteresis = 0; - } if (!model->SWonGiven) { model->SWonConduct = SW_ON_CONDUCTANCE; - model->SWonResistance = 1.0/model->SWonConduct; - } + model->SWonResistance = 1.0 / model->SWonConduct; + } if (!model->SWoffGiven) { model->SWoffConduct = SW_OFF_CONDUCTANCE; - model->SWoffResistance = 1.0/model->SWoffConduct; + model->SWoffResistance = 1.0 / model->SWoffConduct; } - /* loop through all the instances of the model */ - for (here = SWinstances(model); here != NULL ; - here=SWnextInstance(here)) { + for (here = SWinstances(model); here; here = SWnextInstance(here)) { here->SWstate = *states; *states += SW_NUM_STATES; /* Default Value Processing for Switch Instance */ - /* none */ - -/* macro to make elements with built in test for out of memory */ -#define TSTALLOC(ptr,first,second) \ -do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ - return(E_NOMEM);\ -} } while(0) + /* none */ TSTALLOC(SWposPosPtr, SWposNode, SWposNode); TSTALLOC(SWposNegPtr, SWposNode, SWnegNode); @@ -68,5 +58,6 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ TSTALLOC(SWnegNegPtr, SWnegNode, SWnegNode); } } - return(OK); + + return OK; } diff --git a/src/spicelib/devices/sw/swtrunc.c b/src/spicelib/devices/sw/swtrunc.c index 9b40e3098..81866e285 100644 --- a/src/spicelib/devices/sw/swtrunc.c +++ b/src/spicelib/devices/sw/swtrunc.c @@ -3,8 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles Modified: 2000 AlansFixes **********/ -/* - */ #include "ngspice/ngspice.h" #include "ngspice/cktdefs.h" @@ -12,36 +10,41 @@ Modified: 2000 AlansFixes #include "ngspice/suffix.h" #include "swdefs.h" + int SWtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) { - SWmodel *model = (SWmodel*)inModel; + SWmodel *model = (SWmodel *) inModel; SWinstance *here; double lastChange, maxChange, maxStep, ref; - for( ; model!= NULL; model = SWnextModel(model)) { - for(here = SWinstances(model); here != NULL ; - here = SWnextInstance(here)) { - lastChange = *(ckt->CKTstate0+(here->SWstate+1)) - - *(ckt->CKTstate1+(here->SWstate+1)); - if (*(ckt->CKTstate0+(here->SWstate))==0) { - ref = (model->SWvThreshold + model->SWvHysteresis); - if ((*(ckt->CKTstate0+(here->SWstate+1))0)) { - maxChange = (ref - *(ckt->CKTstate0+(here->SWstate+1))) * - 0.75 + 0.05; - maxStep = maxChange/lastChange * ckt->CKTdeltaOld[0]; - if (*timeStep > maxStep) { *timeStep = maxStep; } - } + for (; model; model = SWnextModel(model)) + for (here = SWinstances(model); here; here = SWnextInstance(here)) { + lastChange = + ckt->CKTstate0[here->SWctrlvalue] - + ckt->CKTstate1[here->SWctrlvalue]; + if (ckt->CKTstate0[here->SWswitchstate] == 0) { + ref = model->SWvThreshold + model->SWvHysteresis; + if (ckt->CKTstate0[here->SWctrlvalue] < ref && lastChange > 0) { + maxChange = + (ref - ckt->CKTstate0[here->SWctrlvalue]) * 0.75 + + 0.05; + maxStep = maxChange / lastChange * ckt->CKTdeltaOld[0]; + if (*timeStep > maxStep) + *timeStep = maxStep; + } } else { - ref = (model->SWvThreshold - model->SWvHysteresis); - if ((*(ckt->CKTstate0+(here->SWstate+1))>ref) && (lastChange<0)) { - maxChange = (ref - *(ckt->CKTstate0+(here->SWstate+1))) * - 0.75 - 0.05; - maxStep = maxChange/lastChange * ckt->CKTdeltaOld[0]; - if (*timeStep > maxStep) { *timeStep = maxStep; } - } + ref = model->SWvThreshold - model->SWvHysteresis; + if (ckt->CKTstate0[here->SWctrlvalue] > ref && lastChange < 0) { + maxChange = + (ref - ckt->CKTstate0[here->SWctrlvalue]) * 0.75 + - 0.05; + maxStep = maxChange / lastChange * ckt->CKTdeltaOld[0]; + if (*timeStep > maxStep) + *timeStep = maxStep; + } } } - } - return(OK); + + return OK; } diff --git a/src/spicelib/devices/tra/Makefile.am b/src/spicelib/devices/tra/Makefile.am index 5fb0a2eeb..fced0fd1b 100644 --- a/src/spicelib/devices/tra/Makefile.am +++ b/src/spicelib/devices/tra/Makefile.am @@ -8,14 +8,11 @@ libtra_la_SOURCES = \ traacld.c \ traask.c \ tradefs.h \ - tradel.c \ - tradest.c \ traext.h \ trainit.c \ trainit.h \ traitf.h \ traload.c \ - tramdel.c \ traparam.c \ trasetup.c \ tratemp.c \ diff --git a/src/spicelib/devices/tra/tradel.c b/src/spicelib/devices/tra/tradel.c deleted file mode 100644 index 2ab779109..000000000 --- a/src/spicelib/devices/tra/tradel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "tradefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -TRAdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/tra/tradest.c b/src/spicelib/devices/tra/tradest.c deleted file mode 100644 index ae9f983ec..000000000 --- a/src/spicelib/devices/tra/tradest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "tradefs.h" -#include "ngspice/suffix.h" - - -void -TRAdestroy(void) -{ -} diff --git a/src/spicelib/devices/tra/traext.h b/src/spicelib/devices/tra/traext.h index d7640c353..c02c84867 100644 --- a/src/spicelib/devices/tra/traext.h +++ b/src/spicelib/devices/tra/traext.h @@ -6,11 +6,8 @@ Author: 1985 Thomas L. Quarles extern int TRAacLoad(GENmodel*,CKTcircuit*); extern int TRAaccept(CKTcircuit*,GENmodel*); extern int TRAask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int TRAdelete(GENinstance*); -extern void TRAdestroy(void); extern int TRAload(GENmodel*,CKTcircuit*); extern int TRAmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int TRAmDelete(GENmodel*); extern int TRAparam(int,IFvalue*,GENinstance*,IFvalue*); extern int TRAsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); extern int TRAunsetup(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/tra/trainit.c b/src/spicelib/devices/tra/trainit.c index 5d1cf91dc..5ea943464 100644 --- a/src/spicelib/devices/tra/trainit.c +++ b/src/spicelib/devices/tra/trainit.c @@ -42,9 +42,9 @@ SPICEdev TRAinfo = { .DEVfindBranch = NULL, .DEVacLoad = TRAacLoad, .DEVaccept = TRAaccept, - .DEVdestroy = TRAdestroy, - .DEVmodDelete = TRAmDelete, - .DEVdelete = TRAdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = TRAask, .DEVmodAsk = NULL, diff --git a/src/spicelib/devices/tra/tramdel.c b/src/spicelib/devices/tra/tramdel.c deleted file mode 100644 index 39b3d5a1e..000000000 --- a/src/spicelib/devices/tra/tramdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "tradefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -TRAmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/txl/Makefile.am b/src/spicelib/devices/txl/Makefile.am index 25e7c4d9a..fffbeebe7 100644 --- a/src/spicelib/devices/txl/Makefile.am +++ b/src/spicelib/devices/txl/Makefile.am @@ -7,15 +7,12 @@ libtxl_la_SOURCES = \ txlacct.c \ txlask.c \ txldefs.h \ - txldest.c \ txlext.h \ txlfbr.c \ txlinit.h \ txlitf.h \ txlload.c \ - txlmdel.c \ txlparam.c \ - txldel.c \ txlmask.c \ txlmpar.c \ txlsetup.c \ diff --git a/src/spicelib/devices/txl/txldel.c b/src/spicelib/devices/txl/txldel.c deleted file mode 100644 index 9e97fae5a..000000000 --- a/src/spicelib/devices/txl/txldel.c +++ /dev/null @@ -1,18 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights -reserved. -Author: 1992 Charles Hough -**********/ - -#include "ngspice/ngspice.h" -#include "txldefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -TXLdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/txl/txldest.c b/src/spicelib/devices/txl/txldest.c deleted file mode 100644 index 84951d75f..000000000 --- a/src/spicelib/devices/txl/txldest.c +++ /dev/null @@ -1,15 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights -reserved. -Author: 1992 Charles Hough -**********/ - -#include "ngspice/ngspice.h" -#include "txldefs.h" -#include "ngspice/suffix.h" - - -void -TXLdestroy(void) -{ -} diff --git a/src/spicelib/devices/txl/txlext.h b/src/spicelib/devices/txl/txlext.h index 11a9fc8b8..49272385b 100644 --- a/src/spicelib/devices/txl/txlext.h +++ b/src/spicelib/devices/txl/txlext.h @@ -1,13 +1,9 @@ extern int TXLaccept(CKTcircuit*,GENmodel*); extern int TXLask(CKTcircuit*, GENinstance*, int, IFvalue*, IFvalue*); -extern int TXLdelete(GENinstance*); -extern void TXLdestroy(void); extern int TXLfindBr(CKTcircuit*, GENmodel*, IFuid); extern int TXLload(GENmodel*,CKTcircuit*); extern int TXLmodAsk(CKTcircuit*, GENmodel*, int, IFvalue*); - -extern int TXLmDelete(GENmodel*); extern int TXLmParam(int,IFvalue*,GENmodel*); extern int TXLparam(int,IFvalue*,GENinstance*,IFvalue*); extern int TXLsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); diff --git a/src/spicelib/devices/txl/txlinit.c b/src/spicelib/devices/txl/txlinit.c index 7533aa15b..f6c11c938 100644 --- a/src/spicelib/devices/txl/txlinit.c +++ b/src/spicelib/devices/txl/txlinit.c @@ -47,9 +47,9 @@ SPICEdev TXLinfo = { .DEVfindBranch = NULL, .DEVacLoad = TXLload, .DEVaccept = NULL, - .DEVdestroy = TXLdestroy, - .DEVmodDelete = TXLmDelete, - .DEVdelete = TXLdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = TXLask, .DEVmodAsk = TXLmodAsk, diff --git a/src/spicelib/devices/txl/txlmdel.c b/src/spicelib/devices/txl/txlmdel.c deleted file mode 100644 index a50ae0c5b..000000000 --- a/src/spicelib/devices/txl/txlmdel.c +++ /dev/null @@ -1,18 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights -reserved. -Author: 1992 Charles Hough -**********/ - -#include "ngspice/ngspice.h" -#include "txldefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -TXLmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/urc/Makefile.am b/src/spicelib/devices/urc/Makefile.am index 8b6c10a49..232d508ef 100644 --- a/src/spicelib/devices/urc/Makefile.am +++ b/src/spicelib/devices/urc/Makefile.am @@ -6,14 +6,11 @@ liburc_la_SOURCES = \ urc.c \ urcask.c \ urcdefs.h \ - urcdel.c \ - urcdest.c \ urcext.h \ urcinit.c \ urcinit.h \ urcitf.h \ urcmask.c \ - urcmdel.c \ urcmpar.c \ urcparam.c \ urcsetup.c diff --git a/src/spicelib/devices/urc/urcdel.c b/src/spicelib/devices/urc/urcdel.c deleted file mode 100644 index 8c0c3f58d..000000000 --- a/src/spicelib/devices/urc/urcdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1987 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "urcdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -URCdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/urc/urcdest.c b/src/spicelib/devices/urc/urcdest.c deleted file mode 100644 index 6c5587cb3..000000000 --- a/src/spicelib/devices/urc/urcdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1987 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "urcdefs.h" -#include "ngspice/suffix.h" - - -void -URCdestroy(void) -{ -} diff --git a/src/spicelib/devices/urc/urcext.h b/src/spicelib/devices/urc/urcext.h index 52ce2cd72..f7880251c 100644 --- a/src/spicelib/devices/urc/urcext.h +++ b/src/spicelib/devices/urc/urcext.h @@ -6,10 +6,7 @@ Author: 1985 Thomas L. Quarles #define _URCEXT_H extern int URCask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int URCdelete(GENinstance*); -extern void URCdestroy(void); extern int URCmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int URCmDelete(GENmodel*); extern int URCmParam(int,IFvalue*,GENmodel*); extern int URCparam(int,IFvalue*,GENinstance*,IFvalue*); extern int URCsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); diff --git a/src/spicelib/devices/urc/urcinit.c b/src/spicelib/devices/urc/urcinit.c index 7226b777b..a4b58890b 100644 --- a/src/spicelib/devices/urc/urcinit.c +++ b/src/spicelib/devices/urc/urcinit.c @@ -42,9 +42,9 @@ SPICEdev URCinfo = { .DEVfindBranch = NULL, .DEVacLoad = NULL, .DEVaccept = NULL, - .DEVdestroy = URCdestroy, - .DEVmodDelete = URCmDelete, - .DEVdelete = URCdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = URCask, .DEVmodAsk = URCmAsk, diff --git a/src/spicelib/devices/urc/urcmdel.c b/src/spicelib/devices/urc/urcmdel.c deleted file mode 100644 index e2cab752d..000000000 --- a/src/spicelib/devices/urc/urcmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1987 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "urcdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -URCmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/vbic/Makefile.am b/src/spicelib/devices/vbic/Makefile.am index 189cdb458..9bbae9a84 100644 --- a/src/spicelib/devices/vbic/Makefile.am +++ b/src/spicelib/devices/vbic/Makefile.am @@ -9,7 +9,6 @@ libvbic_la_SOURCES = \ vbicconv.c \ vbicdefs.h \ vbicdel.c \ - vbicdest.c \ vbicext.h \ vbicgetic.c \ vbicinit.c \ @@ -17,7 +16,6 @@ libvbic_la_SOURCES = \ vbicitf.h \ vbicload.c \ vbicmask.c \ - vbicmdel.c \ vbicmpar.c \ vbicnoise.c \ vbicparam.c \ diff --git a/src/spicelib/devices/vbic/vbicdefs.h b/src/spicelib/devices/vbic/vbicdefs.h index 1dd356607..f9a20e780 100644 --- a/src/spicelib/devices/vbic/vbicdefs.h +++ b/src/spicelib/devices/vbic/vbicdefs.h @@ -16,6 +16,25 @@ Spice3 Implementation: 2003 Dietmar Warning DAnalyse GmbH /* structures to describe Bipolar Junction Transistors */ +/* indices to array of VBIC noise sources */ + +#define VBICRCNOIZ 0 +#define VBICRCINOIZ 1 +#define VBICRBNOIZ 2 +#define VBICRBINOIZ 3 +#define VBICRENOIZ 4 +#define VBICRBPNOIZ 5 +#define VBICRSNOIZ 6 +#define VBICICNOIZ 7 +#define VBICIBNOIZ 8 +#define VBICIBEPNOIZ 9 +#define VBICICCPNOIZ 10 +#define VBICFLBENOIZ 11 +#define VBICFLBEPNOIZ 12 +#define VBICTOTNOIZ 13 + +#define VBICNSRCS 14 /* the number of VBIC noise sources */ + /* data needed to describe a single instance */ typedef struct sVBICinstance { @@ -219,25 +238,6 @@ typedef struct sVBICinstance { #define VBICsenCsub VBICsens+45 /* stores the perturbed values of csub */ -/* indices to array of VBIC noise sources */ - -#define VBICRCNOIZ 0 -#define VBICRCINOIZ 1 -#define VBICRBNOIZ 2 -#define VBICRBINOIZ 3 -#define VBICRENOIZ 4 -#define VBICRBPNOIZ 5 -#define VBICRSNOIZ 6 -#define VBICICNOIZ 7 -#define VBICIBNOIZ 8 -#define VBICIBEPNOIZ 9 -#define VBICICCPNOIZ 10 -#define VBICFLBENOIZ 11 -#define VBICFLBEPNOIZ 12 -#define VBICTOTNOIZ 13 - -#define VBICNSRCS 14 /* the number of VBIC noise sources */ - #ifndef NONOISE double VBICnVar[NSTATVARS][VBICNSRCS]; #else /*NONOISE*/ @@ -393,9 +393,9 @@ typedef struct sVBICinstance { #define VBICnumStates 66 -#define VBICsensxpbe VBICstate+66 /* charge sensitivities and their - derivatives. +67 for the derivatives - - pointer to the beginning of the array */ +#define VBICsensxpbe VBICstate+66 /* charge sensitivities and their derivatives. + * +67 for the derivatives + * pointer to the beginning of the array */ #define VBICsensxpbex VBICstate+68 #define VBICsensxpbc VBICstate+70 #define VBICsensxpbcx VBICstate+72 diff --git a/src/spicelib/devices/vbic/vbicdest.c b/src/spicelib/devices/vbic/vbicdest.c deleted file mode 100644 index 49938319e..000000000 --- a/src/spicelib/devices/vbic/vbicdest.c +++ /dev/null @@ -1,21 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -Model Author: 1995 Colin McAndrew Motorola -Spice3 Implementation: 2003 Dietmar Warning DAnalyse GmbH -**********/ - -/* - * This routine deletes all VBICs from the circuit and frees - * all storage they were using. - */ - -#include "ngspice/ngspice.h" -#include "vbicdefs.h" -#include "ngspice/suffix.h" - - -void -VBICdestroy(void) -{ -} diff --git a/src/spicelib/devices/vbic/vbicext.h b/src/spicelib/devices/vbic/vbicext.h index 9da7646cc..e9ab1bb9a 100644 --- a/src/spicelib/devices/vbic/vbicext.h +++ b/src/spicelib/devices/vbic/vbicext.h @@ -12,11 +12,9 @@ extern int VBICacLoad(GENmodel *,CKTcircuit*); extern int VBICask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); extern int VBICconvTest(GENmodel*,CKTcircuit*); extern int VBICdelete(GENinstance*); -extern void VBICdestroy(void); extern int VBICgetic(GENmodel*,CKTcircuit*); extern int VBICload(GENmodel*,CKTcircuit*); extern int VBICmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int VBICmDelete(GENmodel*); extern int VBICmParam(int,IFvalue*,GENmodel*); extern int VBICparam(int,IFvalue*,GENinstance*,IFvalue*); extern int VBICpzLoad(GENmodel*, CKTcircuit*, SPcomplex*); diff --git a/src/spicelib/devices/vbic/vbicinit.c b/src/spicelib/devices/vbic/vbicinit.c index d71c3f0fb..a09e82244 100644 --- a/src/spicelib/devices/vbic/vbicinit.c +++ b/src/spicelib/devices/vbic/vbicinit.c @@ -47,8 +47,8 @@ SPICEdev VBICinfo = { .DEVfindBranch = NULL, .DEVacLoad = VBICacLoad, .DEVaccept = NULL, - .DEVdestroy = VBICdestroy, - .DEVmodDelete = VBICmDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = VBICdelete, .DEVsetic = VBICgetic, .DEVask = VBICask, diff --git a/src/spicelib/devices/vbic/vbicmdel.c b/src/spicelib/devices/vbic/vbicmdel.c deleted file mode 100644 index 06fe82064..000000000 --- a/src/spicelib/devices/vbic/vbicmdel.c +++ /dev/null @@ -1,25 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -Model Author: 1995 Colin McAndrew Motorola -Spice3 Implementation: 2003 Dietmar Warning DAnalyse GmbH -**********/ - -/* - * This routine deletes a VBIC model from the circuit and frees - * the storage it was using. - * returns an error if the model has instances - */ - -#include "ngspice/ngspice.h" -#include "vbicdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -VBICmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/vbic/vbicsetup.c b/src/spicelib/devices/vbic/vbicsetup.c index 5ce1c6ec4..297604925 100644 --- a/src/spicelib/devices/vbic/vbicsetup.c +++ b/src/spicelib/devices/vbic/vbicsetup.c @@ -403,7 +403,7 @@ VBICsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) here->VBICstate = *states; *states += VBICnumStates; if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & TRANSEN) ){ - *states += 8 * (ckt->CKTsenInfo->SENparms); + *states += VBICnumSenStates * (ckt->CKTsenInfo->SENparms); } if(model->VBICextCollResist == 0) { diff --git a/src/spicelib/devices/vccs/Makefile.am b/src/spicelib/devices/vccs/Makefile.am index eae86acd7..022f70958 100644 --- a/src/spicelib/devices/vccs/Makefile.am +++ b/src/spicelib/devices/vccs/Makefile.am @@ -6,14 +6,11 @@ libvccs_la_SOURCES = \ vccs.c \ vccsask.c \ vccsdefs.h \ - vccsdel.c \ - vccsdest.c \ vccsext.h \ vccsinit.c \ vccsinit.h \ vccsitf.h \ vccsload.c \ - vccsmdel.c \ vccspar.c \ vccspzld.c \ vccssacl.c \ diff --git a/src/spicelib/devices/vccs/vccsdel.c b/src/spicelib/devices/vccs/vccsdel.c deleted file mode 100644 index b809e2635..000000000 --- a/src/spicelib/devices/vccs/vccsdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "vccsdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -VCCSdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/vccs/vccsdest.c b/src/spicelib/devices/vccs/vccsdest.c deleted file mode 100644 index 6115e2532..000000000 --- a/src/spicelib/devices/vccs/vccsdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "vccsdefs.h" -#include "ngspice/suffix.h" - - -void -VCCSdestroy(void) -{ -} diff --git a/src/spicelib/devices/vccs/vccsext.h b/src/spicelib/devices/vccs/vccsext.h index 489afcfdd..ba0c4694c 100644 --- a/src/spicelib/devices/vccs/vccsext.h +++ b/src/spicelib/devices/vccs/vccsext.h @@ -4,10 +4,7 @@ Author: 1985 Thomas L. Quarles **********/ extern int VCCSask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int VCCSdelete(GENinstance*); -extern void VCCSdestroy(void); extern int VCCSload(GENmodel*,CKTcircuit*); -extern int VCCSmDelete(GENmodel*); extern int VCCSparam(int,IFvalue*,GENinstance*,IFvalue*); extern int VCCSpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int VCCSsAcLoad(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/vccs/vccsinit.c b/src/spicelib/devices/vccs/vccsinit.c index 9d7c42c1b..2fd5d265d 100644 --- a/src/spicelib/devices/vccs/vccsinit.c +++ b/src/spicelib/devices/vccs/vccsinit.c @@ -42,9 +42,9 @@ SPICEdev VCCSinfo = { .DEVfindBranch = NULL, .DEVacLoad = VCCSload, .DEVaccept = NULL, - .DEVdestroy = VCCSdestroy, - .DEVmodDelete = VCCSmDelete, - .DEVdelete = VCCSdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = VCCSask, .DEVmodAsk = NULL, diff --git a/src/spicelib/devices/vccs/vccsmdel.c b/src/spicelib/devices/vccs/vccsmdel.c deleted file mode 100644 index 405f3d64c..000000000 --- a/src/spicelib/devices/vccs/vccsmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "vccsdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -VCCSmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/vcvs/Makefile.am b/src/spicelib/devices/vcvs/Makefile.am index 9f9c548ad..c75d1eb5a 100644 --- a/src/spicelib/devices/vcvs/Makefile.am +++ b/src/spicelib/devices/vcvs/Makefile.am @@ -6,15 +6,12 @@ libvcvs_la_SOURCES = \ vcvs.c \ vcvsask.c \ vcvsdefs.h \ - vcvsdel.c \ - vcvsdest.c \ vcvsext.h \ vcvsfbr.c \ vcvsinit.c \ vcvsinit.h \ vcvsitf.h \ vcvsload.c \ - vcvsmdel.c \ vcvspar.c \ vcvspzld.c \ vcvssacl.c \ diff --git a/src/spicelib/devices/vcvs/vcvsdel.c b/src/spicelib/devices/vcvs/vcvsdel.c deleted file mode 100644 index db3837718..000000000 --- a/src/spicelib/devices/vcvs/vcvsdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "vcvsdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -VCVSdelete(GENinstance *gen_inst) -{ - NG_IGNORE(gen_inst); - return OK; -} diff --git a/src/spicelib/devices/vcvs/vcvsdest.c b/src/spicelib/devices/vcvs/vcvsdest.c deleted file mode 100644 index c287fc948..000000000 --- a/src/spicelib/devices/vcvs/vcvsdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "vcvsdefs.h" -#include "ngspice/suffix.h" - - -void -VCVSdestroy(void) -{ -} diff --git a/src/spicelib/devices/vcvs/vcvsext.h b/src/spicelib/devices/vcvs/vcvsext.h index 7dcbf52f6..9643fdd65 100644 --- a/src/spicelib/devices/vcvs/vcvsext.h +++ b/src/spicelib/devices/vcvs/vcvsext.h @@ -4,11 +4,8 @@ Author: 1985 Thomas L. Quarles **********/ extern int VCVSask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); -extern int VCVSdelete(GENinstance*); -extern void VCVSdestroy(void); extern int VCVSfindBr(CKTcircuit*,GENmodel*,IFuid); extern int VCVSload(GENmodel*,CKTcircuit*); -extern int VCVSmDelete(GENmodel*); extern int VCVSparam(int,IFvalue*,GENinstance*,IFvalue*); extern int VCVSpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int VCVSsAcLoad(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/vcvs/vcvsinit.c b/src/spicelib/devices/vcvs/vcvsinit.c index 4e7766121..46259affc 100644 --- a/src/spicelib/devices/vcvs/vcvsinit.c +++ b/src/spicelib/devices/vcvs/vcvsinit.c @@ -42,9 +42,9 @@ SPICEdev VCVSinfo = { .DEVfindBranch = VCVSfindBr, .DEVacLoad = VCVSload, .DEVaccept = NULL, - .DEVdestroy = VCVSdestroy, - .DEVmodDelete = VCVSmDelete, - .DEVdelete = VCVSdelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, + .DEVdelete = NULL, .DEVsetic = NULL, .DEVask = VCVSask, .DEVmodAsk = NULL, diff --git a/src/spicelib/devices/vcvs/vcvsmdel.c b/src/spicelib/devices/vcvs/vcvsmdel.c deleted file mode 100644 index 2609821bf..000000000 --- a/src/spicelib/devices/vcvs/vcvsmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "vcvsdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -VCVSmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/src/spicelib/devices/vsrc/Makefile.am b/src/spicelib/devices/vsrc/Makefile.am index 05daca1b3..782d8c908 100644 --- a/src/spicelib/devices/vsrc/Makefile.am +++ b/src/spicelib/devices/vsrc/Makefile.am @@ -9,14 +9,12 @@ libvsrc_la_SOURCES = \ vsrcask.c \ vsrcdefs.h \ vsrcdel.c \ - vsrcdest.c \ vsrcext.h \ vsrcfbr.c \ vsrcinit.c \ vsrcinit.h \ vsrcitf.h \ vsrcload.c \ - vsrcmdel.c \ vsrcpar.c \ vsrcpzld.c \ vsrcpzs.c \ diff --git a/src/spicelib/devices/vsrc/vsrcdefs.h b/src/spicelib/devices/vsrc/vsrcdefs.h index 773526296..3e3a188a5 100644 --- a/src/spicelib/devices/vsrc/vsrcdefs.h +++ b/src/spicelib/devices/vsrc/vsrcdefs.h @@ -164,7 +164,8 @@ typedef struct sVSRCmodel { } VSRCmodel; /* source function types (shared with current sources) */ -#ifndef PULSE +#ifndef PULSE_FUN_TYPES +#define PULSE_FUN_TYPES #define PULSE 1 #define SINE 2 #define EXP 3 @@ -174,7 +175,7 @@ typedef struct sVSRCmodel { #define TRNOISE 7 #define TRRANDOM 8 #define EXTERNAL 9 -#endif /*PULSE*/ +#endif /* device parameters */ #define VSRC_DC 1 diff --git a/src/spicelib/devices/vsrc/vsrcdest.c b/src/spicelib/devices/vsrc/vsrcdest.c deleted file mode 100644 index 561b7c8f9..000000000 --- a/src/spicelib/devices/vsrc/vsrcdest.c +++ /dev/null @@ -1,14 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "vsrcdefs.h" -#include "ngspice/suffix.h" - - -void -VSRCdestroy(void) -{ -} diff --git a/src/spicelib/devices/vsrc/vsrcext.h b/src/spicelib/devices/vsrc/vsrcext.h index de67ded0b..c607e430d 100644 --- a/src/spicelib/devices/vsrc/vsrcext.h +++ b/src/spicelib/devices/vsrc/vsrcext.h @@ -7,11 +7,9 @@ extern int VSRCaccept(CKTcircuit*,GENmodel*); extern int VSRCacLoad(GENmodel*,CKTcircuit*); extern int VSRCask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int VSRCdelete(GENinstance*); -extern void VSRCdestroy(void); extern int VSRCfindBr(CKTcircuit*,GENmodel*,IFuid); extern int VSRCload(GENmodel*,CKTcircuit*); extern int VSRCmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int VSRCmDelete(GENmodel*); extern int VSRCparam(int,IFvalue*,GENinstance*,IFvalue*); extern int VSRCpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int VSRCsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); diff --git a/src/spicelib/devices/vsrc/vsrcinit.c b/src/spicelib/devices/vsrc/vsrcinit.c index 91ef2a4be..9f9415eef 100644 --- a/src/spicelib/devices/vsrc/vsrcinit.c +++ b/src/spicelib/devices/vsrc/vsrcinit.c @@ -49,8 +49,8 @@ SPICEdev VSRCinfo = { .DEVfindBranch = VSRCfindBr, .DEVacLoad = VSRCacLoad, .DEVaccept = VSRCaccept, - .DEVdestroy = VSRCdestroy, - .DEVmodDelete = VSRCmDelete, + .DEVdestroy = NULL, + .DEVmodDelete = NULL, .DEVdelete = VSRCdelete, .DEVsetic = NULL, .DEVask = VSRCask, diff --git a/src/spicelib/devices/vsrc/vsrcmdel.c b/src/spicelib/devices/vsrc/vsrcmdel.c deleted file mode 100644 index 9971b2f79..000000000 --- a/src/spicelib/devices/vsrc/vsrcmdel.c +++ /dev/null @@ -1,17 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarles -**********/ - -#include "ngspice/ngspice.h" -#include "vsrcdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -VSRCmDelete(GENmodel *gen_model) -{ - NG_IGNORE(gen_model); - return OK; -} diff --git a/visualc/cuspice.vcxproj b/visualc/cuspice.vcxproj index 9c5ea4bf3..cf72c4df5 100644 --- a/visualc/cuspice.vcxproj +++ b/visualc/cuspice.vcxproj @@ -1367,7 +1367,6 @@ - @@ -1378,14 +1377,12 @@ - - @@ -1404,15 +1401,12 @@ - - - @@ -1427,13 +1421,10 @@ - - - @@ -1454,13 +1445,10 @@ - - - @@ -1473,13 +1461,10 @@ - - - @@ -1492,13 +1477,10 @@ - - - @@ -1510,12 +1492,9 @@ - - - @@ -1529,12 +1508,9 @@ - - - @@ -1548,8 +1524,6 @@ - - @@ -1569,8 +1543,6 @@ - - @@ -1590,8 +1562,6 @@ - - @@ -1612,8 +1582,6 @@ - - @@ -1634,8 +1602,6 @@ - - @@ -1656,8 +1622,6 @@ - - @@ -1678,8 +1642,6 @@ - - @@ -1697,13 +1659,10 @@ - - - @@ -1719,11 +1678,8 @@ - - - @@ -1734,12 +1690,9 @@ - - - @@ -1774,8 +1727,6 @@ - - @@ -1788,24 +1739,18 @@ - - - - - - @@ -1818,15 +1763,12 @@ - - - @@ -1843,13 +1785,10 @@ - - - @@ -1859,13 +1798,10 @@ - - - @@ -1876,8 +1812,6 @@ - - @@ -1896,14 +1830,11 @@ - - - @@ -1916,8 +1847,6 @@ - - @@ -1925,7 +1854,6 @@ - @@ -1937,12 +1865,9 @@ - - - @@ -1956,9 +1881,6 @@ - - - @@ -1970,22 +1892,17 @@ - - - - - @@ -1996,15 +1913,12 @@ - - - @@ -2017,12 +1931,9 @@ - - - @@ -2032,13 +1943,10 @@ - - - @@ -2048,15 +1956,12 @@ - - - @@ -2069,14 +1974,12 @@ - - @@ -2094,14 +1997,12 @@ - - @@ -2119,14 +2020,12 @@ - - @@ -2142,7 +2041,7 @@ - + @@ -2157,14 +2056,12 @@ - - @@ -2179,12 +2076,9 @@ - - - @@ -2201,13 +2095,10 @@ - - - @@ -2217,12 +2108,9 @@ - - - @@ -2233,11 +2121,8 @@ - - - @@ -2245,23 +2130,17 @@ - - - - - - @@ -2270,12 +2149,10 @@ - - @@ -2286,11 +2163,8 @@ - - - @@ -2300,12 +2174,9 @@ - - - @@ -2318,11 +2189,9 @@ - -