Added "dtemp". Cleaned the code a bit. Updated DEVICES.

This commit is contained in:
pnenzi 2003-12-08 21:11:56 +00:00
parent 5c26919de1
commit b5112c0d47
28 changed files with 104 additions and 188 deletions

View File

@ -1,3 +1,10 @@
2003-12-08 Paolo Nenzi <p.nenzi@ieee.org>
* src/spicelib/devices/mos9/*: Added
"dtemp" parameters.
* DEVICES: Updated MOS9 status.
2003-12-08 Paolo Nenzi <p.nenzi@ieee.org> 2003-12-08 Paolo Nenzi <p.nenzi@ieee.org>
* src/spicelib/devices/mos6/*: Added "m" * src/spicelib/devices/mos6/*: Added "m"

View File

@ -262,7 +262,11 @@ MOS9 - Level 9 MOS model
Ver: N/A Ver: N/A
Class: M Class: M
Level: 9 Level: 9
Status: TO BE TESTED Status:
Enhancements over the original model:
- Temperature difference from circuit temperature
BSIM1 - BSIM model level 1 BSIM1 - BSIM model level 1

View File

@ -5,7 +5,6 @@ Modified: Alan Gillespie
**********/ **********/
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "devdefs.h" #include "devdefs.h"
#include "ifsim.h" #include "ifsim.h"
#include "mos9defs.h" #include "mos9defs.h"
@ -39,6 +38,7 @@ IFparm MOS9pTable[] = { /* parameters */
IOPAU("icvbs", MOS9_IC_VBS, IF_REAL , "Initial B-S voltage"), IOPAU("icvbs", MOS9_IC_VBS, IF_REAL , "Initial B-S voltage"),
IOPU("ic", MOS9_IC, IF_REALVEC, "Vector of D-S, G-S, B-S voltages"), IOPU("ic", MOS9_IC, IF_REALVEC, "Vector of D-S, G-S, B-S voltages"),
IOPU("temp", MOS9_TEMP, IF_REAL , "Instance operating temperature"), IOPU("temp", MOS9_TEMP, IF_REAL , "Instance operating temperature"),
IOPU("dtemp", MOS9_DTEMP, IF_REAL , "Instance operating temperature difference"),
IP("sens_l", MOS9_L_SENS, IF_FLAG, "flag to request sensitivity WRT length"), IP("sens_l", MOS9_L_SENS, IF_FLAG, "flag to request sensitivity WRT length"),
IP("sens_w", MOS9_W_SENS, IF_FLAG, "flag to request sensitivity WRT width"), IP("sens_w", MOS9_W_SENS, IF_FLAG, "flag to request sensitivity WRT width"),
OPU("dnode", MOS9_DNODE, IF_INTEGER, "Number of drain node"), OPU("dnode", MOS9_DNODE, IF_INTEGER, "Number of drain node"),

View File

@ -7,7 +7,6 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h" #include "cktdefs.h"
#include "mos9defs.h" #include "mos9defs.h"
#include "sperror.h" #include "sperror.h"
@ -15,9 +14,7 @@ Modified: Alan Gillespie
int int
MOS9acLoad(inModel,ckt) MOS9acLoad(GENmodel *inModel, CKTcircuit *ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{ {
MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *)inModel;
MOS9instance *here; MOS9instance *here;
@ -40,6 +37,7 @@ MOS9acLoad(inModel,ckt)
for( ; model != NULL; model = model->MOS9nextModel) { for( ; model != NULL; model = model->MOS9nextModel) {
for(here = model->MOS9instances; here!= NULL; for(here = model->MOS9instances; here!= NULL;
here = here->MOS9nextInstance) { here = here->MOS9nextInstance) {
if (here->MOS9owner != ARCHme) continue;
if (here->MOS9mode < 0) { if (here->MOS9mode < 0) {
xnrm=0; xnrm=0;

View File

@ -5,7 +5,6 @@ Modified: Alan Gillespie
**********/ **********/
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "const.h" #include "const.h"
#include "ifsim.h" #include "ifsim.h"
#include "cktdefs.h" #include "cktdefs.h"
@ -16,12 +15,8 @@ Modified: Alan Gillespie
/*ARGSUSED*/ /*ARGSUSED*/
int int
MOS9ask(ckt,inst,which,value,select) MOS9ask(CKTcircuit *ckt, GENinstance *inst, int which,
CKTcircuit *ckt; IFvalue *value, IFvalue *select)
GENinstance *inst;
int which;
IFvalue *value;
IFvalue *select;
{ {
MOS9instance *here = (MOS9instance *)inst; MOS9instance *here = (MOS9instance *)inst;
double vr; double vr;

View File

@ -5,7 +5,6 @@ Modified: Alan Gillespie
**********/ **********/
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h" #include "cktdefs.h"
#include "mos9defs.h" #include "mos9defs.h"
#include "sperror.h" #include "sperror.h"
@ -13,9 +12,7 @@ Modified: Alan Gillespie
#include "suffix.h" #include "suffix.h"
int int
MOS9convTest(inModel,ckt) MOS9convTest(GENmodel *inModel, CKTcircuit *ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{ {
MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *)inModel;
MOS9instance *here; MOS9instance *here;
@ -37,6 +34,7 @@ MOS9convTest(inModel,ckt)
for( ; model != NULL; model = model->MOS9nextModel) { for( ; model != NULL; model = model->MOS9nextModel) {
for(here = model->MOS9instances; here!= NULL; for(here = model->MOS9instances; here!= NULL;
here = here->MOS9nextInstance) { here = here->MOS9nextInstance) {
if (here->MOS9owner != ARCHme) continue;
vbs = model->MOS9type * ( vbs = model->MOS9type * (
*(ckt->CKTrhs+here->MOS9bNode) - *(ckt->CKTrhs+here->MOS9bNode) -

View File

@ -43,6 +43,7 @@ typedef struct sMOS9instance {
double MOS9sourceConductance; /*conductance of source(or 0):set in setup*/ double MOS9sourceConductance; /*conductance of source(or 0):set in setup*/
double MOS9drainConductance; /*conductance of drain(or 0):set in setup*/ double MOS9drainConductance; /*conductance of drain(or 0):set in setup*/
double MOS9temp; /* operating temperature of this instance */ double MOS9temp; /* operating temperature of this instance */
double MOS9dtemp; /* instance temperature difference */
double MOS9tTransconductance; /* temperature corrected transconductance*/ double MOS9tTransconductance; /* temperature corrected transconductance*/
double MOS9tSurfMob; /* temperature corrected surface mobility */ double MOS9tSurfMob; /* temperature corrected surface mobility */
@ -91,6 +92,7 @@ typedef struct sMOS9instance {
unsigned MOS9off :1;/* non-zero to indicate device is off for dc analysis*/ unsigned MOS9off :1;/* non-zero to indicate device is off for dc analysis*/
unsigned MOS9tempGiven :1; /* instance temperature specified */ unsigned MOS9tempGiven :1; /* instance temperature specified */
unsigned MOS9dtempGiven :1; /* instance temperature difference specified*/
unsigned MOS9mGiven :1; unsigned MOS9mGiven :1;
@ -498,7 +500,8 @@ typedef struct sMOS9model { /* model structure for a resistor */
#define MOS9_TEMP 77 #define MOS9_TEMP 77
#define MOS9_SOURCERESIST 78 #define MOS9_SOURCERESIST 78
#define MOS9_DRAINRESIST 79 #define MOS9_DRAINRESIST 79
#define MOS9_M 80 #define MOS9_M 80
#define MOS9_DTEMP 81
/* model parameters */ /* model parameters */
#define MOS9_MOD_VTO 101 #define MOS9_MOD_VTO 101
@ -558,3 +561,4 @@ typedef struct sMOS9model { /* model structure for a resistor */
#include "mos9ext.h" #include "mos9ext.h"
#endif /*MOS9*/ #endif /*MOS9*/

View File

@ -7,17 +7,13 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "mos9defs.h" #include "mos9defs.h"
#include "sperror.h" #include "sperror.h"
#include "suffix.h" #include "suffix.h"
int int
MOS9delete(inModel,name,inst) MOS9delete(GENmodel *inModel, IFuid name, GENinstance **inst)
GENmodel *inModel;
IFuid name;
GENinstance **inst;
{ {
MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *)inModel;
MOS9instance **fast = (MOS9instance **)inst; MOS9instance **fast = (MOS9instance **)inst;

View File

@ -7,14 +7,12 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "mos9defs.h" #include "mos9defs.h"
#include "suffix.h" #include "suffix.h"
void void
MOS9destroy(inModel) MOS9destroy(GENmodel **inModel)
GENmodel **inModel;
{ {
MOS9model **model = (MOS9model **)inModel; MOS9model **model = (MOS9model **)inModel;
MOS9instance *here; MOS9instance *here;

View File

@ -5,7 +5,6 @@ Modified: Alan Gillespie
**********/ **********/
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h" #include "cktdefs.h"
#include "mos9defs.h" #include "mos9defs.h"
#include "sperror.h" #include "sperror.h"
@ -55,8 +54,9 @@ for( ; model != NULL; model = model->MOS9nextModel ) {
/* loop through all the instances of the model */ /* loop through all the instances of the model */
for (here = model->MOS9instances; here != NULL ; for (here = model->MOS9instances; here != NULL ;
here=here->MOS9nextInstance) { here=here->MOS9nextInstance) {
if (here->MOS9owner != ARCHme) continue;
/* loading starts here */ /* loading starts here */

View File

@ -5,7 +5,6 @@ Modified: Alan Gillespie
**********/ **********/
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h" #include "cktdefs.h"
#include "devdefs.h" #include "devdefs.h"
#include "mos9defs.h" #include "mos9defs.h"
@ -16,15 +15,13 @@ Modified: Alan Gillespie
#include "suffix.h" #include "suffix.h"
int int
MOS9dSetup(inModel,ckt) MOS9dSetup(GENmodel *inModel, CKTcircuit *ckt)
GENmodel *inModel;
register CKTcircuit *ckt;
/* actually load the current value into the /* actually load the current value into the
* sparse matrix previously provided * sparse matrix previously provided
*/ */
{ {
register MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *)inModel;
register MOS9instance *here; MOS9instance *here;
double Beta; double Beta;
double DrainSatCur; double DrainSatCur;
double EffectiveLength; double EffectiveLength;
@ -69,6 +66,7 @@ next: for( ; model != NULL; model = model->MOS9nextModel ) {
/* loop through all the instances of the model */ /* loop through all the instances of the model */
for (here = model->MOS9instances; here != NULL ; for (here = model->MOS9instances; here != NULL ;
here=here->MOS9nextInstance) { here=here->MOS9nextInstance) {
if (here->MOS9owner != ARCHme) continue;
vt = CONSTKoverQ * here->MOS9temp; vt = CONSTKoverQ * here->MOS9temp;

View File

@ -7,7 +7,6 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h" #include "cktdefs.h"
#include "mos9defs.h" #include "mos9defs.h"
#include "sperror.h" #include "sperror.h"
@ -15,9 +14,7 @@ Modified: Alan Gillespie
int int
MOS9getic(inModel,ckt) MOS9getic(GENmodel *inModel, CKTcircuit *ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{ {
MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *)inModel;
MOS9instance *here; MOS9instance *here;
@ -28,6 +25,8 @@ MOS9getic(inModel,ckt)
for( ; model ; model = model->MOS9nextModel) { for( ; model ; model = model->MOS9nextModel) {
for(here = model->MOS9instances; here ; here = here->MOS9nextInstance) { for(here = model->MOS9instances; here ; here = here->MOS9nextInstance) {
if (here->MOS9owner != ARCHme) continue;
if(!here->MOS9icVBSGiven) { if(!here->MOS9icVBSGiven) {
here->MOS9icVBS = here->MOS9icVBS =
*(ckt->CKTrhs + here->MOS9bNode) - *(ckt->CKTrhs + here->MOS9bNode) -

View File

@ -5,7 +5,6 @@ Modified: Alan Gillespie
**********/ **********/
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h" #include "cktdefs.h"
#include "devdefs.h" #include "devdefs.h"
#include "mos9defs.h" #include "mos9defs.h"
@ -15,9 +14,7 @@ Modified: Alan Gillespie
#include "suffix.h" #include "suffix.h"
int int
MOS9load(inModel,ckt) MOS9load(GENmodel *inModel, CKTcircuit *ckt)
GENmodel *inModel;
CKTcircuit *ckt;
/* actually load the current value into the /* actually load the current value into the
* sparse matrix previously provided * sparse matrix previously provided
*/ */
@ -77,7 +74,9 @@ MOS9load(inModel,ckt)
double capgd; /* total gate-drain capacitance */ double capgd; /* total gate-drain capacitance */
double capgb; /* total gate-bulk capacitance */ double capgb; /* total gate-bulk capacitance */
int Check; int Check;
#ifndef NOBYPASS
double tempv; double tempv;
#endif /*NOBYPASS*/
int error; int error;
#ifdef CAPBYPASS #ifdef CAPBYPASS
int senflag; int senflag;
@ -108,6 +107,7 @@ next:
/* loop through all the instances of the model */ /* loop through all the instances of the model */
for (here = model->MOS9instances; here != NULL ; for (here = model->MOS9instances; here != NULL ;
here=here->MOS9nextInstance) { here=here->MOS9nextInstance) {
if (here->MOS9owner != ARCHme) continue;
vt = CONSTKoverQ * here->MOS9temp; vt = CONSTKoverQ * here->MOS9temp;
Check=1; Check=1;
@ -122,10 +122,6 @@ next:
} }
SenCond = ckt->CKTsenInfo && here->MOS9senPertFlag; SenCond = ckt->CKTsenInfo && here->MOS9senPertFlag;
#ifdef DETAILPROF
asm(" .globl mos9pta");
asm("mos9pta:");
#endif /* DETAILPROF */
/* first, we compute a few useful values - these could be /* first, we compute a few useful values - these could be
* pre-computed, but for historical reasons are still done * pre-computed, but for historical reasons are still done
@ -198,10 +194,6 @@ asm("mos9pta:");
goto next1; goto next1;
} }
#ifdef DETAILPROF
asm(" .globl mos9ptax");
asm("mos9ptax:");
#endif /* DETAILPROF */
/* /*
* ok - now to do the start-up operations * ok - now to do the start-up operations
@ -256,10 +248,6 @@ asm("mos9ptax:");
#endif /*PREDICTOR*/ #endif /*PREDICTOR*/
/* now some common crunching for some more useful quantities */ /* now some common crunching for some more useful quantities */
#ifdef DETAILPROF
asm(" .globl mos9ptay");
asm("mos9ptay:");
#endif /* DETAILPROF */
vbd=vbs-vds; vbd=vbs-vds;
vgd=vgs-vds; vgd=vgs-vds;
@ -293,11 +281,7 @@ asm("mos9ptay:");
here->MOS9cbd + here->MOS9cbd +
here->MOS9gbd * delvbd + here->MOS9gbd * delvbd +
here->MOS9gbs * delvbs ; here->MOS9gbs * delvbs ;
#ifndef NOBYPASS
#ifdef DETAILPROF
asm(" .globl mos9ptb");
asm("mos9ptb:");
#endif /* DETAILPROF */
/* now lets see if we can bypass (ugh) */ /* now lets see if we can bypass (ugh) */
/* the following mess should be one if statement, but /* the following mess should be one if statement, but
* many compilers can't handle it all at once, so it * many compilers can't handle it all at once, so it
@ -351,11 +335,7 @@ asm("mos9ptb:");
} }
goto bypass; goto bypass;
} }
#endif /*NOBYPASS*/
#ifdef DETAILPROF
asm(" .globl mos9ptc");
asm("mos9ptc:");
#endif /* DETAILPROF */
/* ok - bypass is out, do it the hard way */ /* ok - bypass is out, do it the hard way */
von = model->MOS9type * here->MOS9von; von = model->MOS9type * here->MOS9von;
@ -396,10 +376,6 @@ asm("mos9ptc:");
} else { } else {
#ifdef DETAILPROF
asm(" .globl mos9ptd");
asm("mos9ptd:");
#endif /* DETAILPROF */
/* ok - not one of the simple cases, so we have to /* ok - not one of the simple cases, so we have to
* look at all of the possibilities for why we were * look at all of the possibilities for why we were
* called. We still just initialize the three voltages * called. We still just initialize the three voltages
@ -422,10 +398,6 @@ asm("mos9ptd:");
} }
} }
#ifdef DETAILPROF
asm(" .globl mos9pte");
asm("mos9pte:");
#endif /* DETAILPROF */
/* /*
* now all the preliminaries are over - we can start doing the * now all the preliminaries are over - we can start doing the
* real work * real work
@ -474,10 +446,6 @@ next1: if(vbs <= -3*vt) {
here->MOS9mode = -1; here->MOS9mode = -1;
} }
#ifdef DETAILPROF
asm(" .globl mos9ptf");
asm("mos9ptf:");
#endif /* DETAILPROF */
{ {
/* /*
* subroutine moseq3(vds,vbs,vgs,gm,gds,gmbs, * subroutine moseq3(vds,vbs,vgs,gm,gds,gmbs,
@ -913,10 +881,6 @@ innerline1000:;
*/ */
} }
#ifdef DETAILPROF
asm(" .globl mos9ptg");
asm("mos9ptg:");
#endif /* DETAILPROF */
/* now deal with n vs p polarity */ /* now deal with n vs p polarity */
@ -1076,10 +1040,7 @@ asm("mos9ptg:");
} }
#endif /*CAPZEROBYPASS*/ #endif /*CAPZEROBYPASS*/
} }
#ifdef DETAILPROF
asm(" .globl mos9pth");
asm("mos9pth:");
#endif /* DETAILPROF */
if(SenCond && (ckt->CKTsenInfo->SENmode==TRANSEN)) goto next2; if(SenCond && (ckt->CKTsenInfo->SENmode==TRANSEN)) goto next2;
if ( ckt->CKTmode & MODETRAN ) { if ( ckt->CKTmode & MODETRAN ) {
@ -1107,10 +1068,7 @@ asm("mos9pth:");
here->MOS9cbs += *(ckt->CKTstate0 + here->MOS9cqbs); here->MOS9cbs += *(ckt->CKTstate0 + here->MOS9cqbs);
} }
} }
#ifdef DETAILPROF
asm(" .globl mos9pti");
asm("mos9pti:");
#endif /* DETAILPROF */
if(SenCond) goto next2; if(SenCond) goto next2;
/* /*
@ -1124,10 +1082,7 @@ asm("mos9pti:");
} }
} }
#ifdef DETAILPROF
asm(" .globl mos9ptj");
asm("mos9ptj:");
#endif /* DETAILPROF */
/* save things away for next time */ /* save things away for next time */
@ -1136,10 +1091,7 @@ next2: *(ckt->CKTstate0 + here->MOS9vbs) = vbs;
*(ckt->CKTstate0 + here->MOS9vgs) = vgs; *(ckt->CKTstate0 + here->MOS9vgs) = vgs;
*(ckt->CKTstate0 + here->MOS9vds) = vds; *(ckt->CKTstate0 + here->MOS9vds) = vds;
#ifdef DETAILPROF
asm(" .globl mos9ptk");
asm("mos9ptk:");
#endif /* DETAILPROF */
/* /*
* meyer's capacitor model * meyer's capacitor model
@ -1195,10 +1147,7 @@ asm("mos9ptk:");
here->MOS9cgb = capgb; here->MOS9cgb = capgb;
} }
#ifdef DETAILPROF
asm(" .globl mos9ptl");
asm("mos9ptl:");
#endif /* DETAILPROF */
/* /*
* store small-signal parameters (for meyer's model) * store small-signal parameters (for meyer's model)
* all parameters already stored, so done... * all parameters already stored, so done...
@ -1242,10 +1191,7 @@ asm("mos9ptl:");
} }
bypass: bypass:
if(SenCond) continue; if(SenCond) continue;
#ifdef DETAILPROF
asm(" .globl mos9ptm");
asm("mos9ptm:");
#endif /* DETAILPROF */
if ( (ckt->CKTmode & (MODEINITTRAN)) || if ( (ckt->CKTmode & (MODEINITTRAN)) ||
(! (ckt->CKTmode & (MODETRAN)) ) ) { (! (ckt->CKTmode & (MODETRAN)) ) ) {
@ -1284,10 +1230,7 @@ asm("mos9ptm:");
* store charge storage info for meyer's cap in lx table * store charge storage info for meyer's cap in lx table
*/ */
#ifdef DETAILPROF
asm(" .globl mos9ptn");
asm("mos9ptn:");
#endif /* DETAILPROF */
/* /*
* load current vector * load current vector
*/ */

View File

@ -7,7 +7,6 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "const.h" #include "const.h"
#include "ifsim.h" #include "ifsim.h"
#include "cktdefs.h" #include "cktdefs.h"
@ -19,11 +18,7 @@ Modified: Alan Gillespie
/*ARGSUSED*/ /*ARGSUSED*/
int int
MOS9mAsk(ckt,inst,which,value) MOS9mAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
CKTcircuit *ckt;
GENmodel *inst;
int which;
IFvalue *value;
{ {
MOS9model *here = (MOS9model *)inst; MOS9model *here = (MOS9model *)inst;
switch(which) { switch(which) {

View File

@ -7,17 +7,13 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "mos9defs.h" #include "mos9defs.h"
#include "sperror.h" #include "sperror.h"
#include "suffix.h" #include "suffix.h"
int int
MOS9mDelete(inModel,modname,kill) MOS9mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill)
GENmodel **inModel;
IFuid modname;
GENmodel *kill;
{ {
MOS9model **model = (MOS9model **)inModel; MOS9model **model = (MOS9model **)inModel;
MOS9model *modfast = (MOS9model *)kill; MOS9model *modfast = (MOS9model *)kill;

View File

@ -7,7 +7,6 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "const.h" #include "const.h"
#include "ifsim.h" #include "ifsim.h"
#include "mos9defs.h" #include "mos9defs.h"
@ -16,10 +15,7 @@ Modified: Alan Gillespie
int int
MOS9mParam(param,value,inModel) MOS9mParam(int param, IFvalue *value, GENmodel *inModel)
int param;
IFvalue *value;
GENmodel *inModel;
{ {
register MOS9model *model = (MOS9model *)inModel; register MOS9model *model = (MOS9model *)inModel;
switch(param) { switch(param) {

View File

@ -5,7 +5,6 @@ Modified: Alan Gillespie
**********/ **********/
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "mos9defs.h" #include "mos9defs.h"
#include "cktdefs.h" #include "cktdefs.h"
#include "iferrmsg.h" #include "iferrmsg.h"
@ -25,13 +24,8 @@ extern void NevalSrc();
extern double Nintegrate(); extern double Nintegrate();
int int
MOS9noise (mode, operation, genmodel, ckt, data, OnDens) MOS9noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt,
int mode; Ndata *data, double *OnDens)
int operation;
GENmodel *genmodel;
CKTcircuit *ckt;
Ndata *data;
double *OnDens;
{ {
MOS9model *firstModel = (MOS9model *) genmodel; MOS9model *firstModel = (MOS9model *) genmodel;
MOS9model *model; MOS9model *model;
@ -56,6 +50,8 @@ MOS9noise (mode, operation, genmodel, ckt, data, OnDens)
for (model=firstModel; model != NULL; model=model->MOS9nextModel) { for (model=firstModel; model != NULL; model=model->MOS9nextModel) {
for (inst=model->MOS9instances; inst != NULL; inst=inst->MOS9nextInstance) { for (inst=model->MOS9instances; inst != NULL; inst=inst->MOS9nextInstance) {
if (inst->MOS9owner != ARCHme) continue;
switch (operation) { switch (operation) {
case N_OPEN: case N_OPEN:

View File

@ -7,7 +7,6 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "const.h" #include "const.h"
#include "ifsim.h" #include "ifsim.h"
#include "mos9defs.h" #include "mos9defs.h"
@ -17,11 +16,8 @@ Modified: Alan Gillespie
/* ARGSUSED */ /* ARGSUSED */
int int
MOS9param(param,value,inst,select) MOS9param(int param, IFvalue *value, GENinstance *inst,
int param; IFvalue *select)
IFvalue *value;
GENinstance *inst;
IFvalue *select;
{ {
MOS9instance *here = (MOS9instance *)inst; MOS9instance *here = (MOS9instance *)inst;
switch(param) { switch(param) {
@ -81,6 +77,10 @@ MOS9param(param,value,inst,select)
here->MOS9temp = value->rValue+CONSTCtoK; here->MOS9temp = value->rValue+CONSTCtoK;
here->MOS9tempGiven = TRUE; here->MOS9tempGiven = TRUE;
break; break;
case MOS9_DTEMP:
here->MOS9dtemp = value->rValue;
here->MOS9dtempGiven = TRUE;
break;
case MOS9_IC: case MOS9_IC:
switch(value->v.numValue){ switch(value->v.numValue){
case 3: case 3:

View File

@ -7,7 +7,6 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h" #include "cktdefs.h"
#include "complex.h" #include "complex.h"
#include "mos9defs.h" #include "mos9defs.h"
@ -16,10 +15,7 @@ Modified: Alan Gillespie
int int
MOS9pzLoad(inModel,ckt,s) MOS9pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
GENmodel *inModel;
CKTcircuit *ckt;
SPcomplex *s;
{ {
MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *)inModel;
MOS9instance *here; MOS9instance *here;
@ -42,6 +38,7 @@ MOS9pzLoad(inModel,ckt,s)
for( ; model != NULL; model = model->MOS9nextModel) { for( ; model != NULL; model = model->MOS9nextModel) {
for(here = model->MOS9instances; here!= NULL; for(here = model->MOS9instances; here!= NULL;
here = here->MOS9nextInstance) { here = here->MOS9nextInstance) {
if (here->MOS9owner != ARCHme) continue;
if (here->MOS9mode < 0) { if (here->MOS9mode < 0) {
xnrm=0; xnrm=0;

View File

@ -2,6 +2,8 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
Modified: Alan Gillespie Modified: Alan Gillespie
This function is obsolete (was used by an old sensitivity analysis)
**********/ **********/
/* actually load the current ac sensitivity /* actually load the current ac sensitivity
@ -9,7 +11,6 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "smpdefs.h" #include "smpdefs.h"
#include "cktdefs.h" #include "cktdefs.h"
#include "const.h" #include "const.h"
@ -18,9 +19,7 @@ Modified: Alan Gillespie
#include "suffix.h" #include "suffix.h"
int int
MOS9sAcLoad(inModel,ckt) MOS9sAcLoad(GENmodel *inModel, CKTcircuit *ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{ {
MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *)inModel;
MOS9instance *here; MOS9instance *here;
@ -133,6 +132,7 @@ CKTcircuit *ckt;
for( ; model != NULL; model = model->MOS9nextModel) { for( ; model != NULL; model = model->MOS9nextModel) {
for(here = model->MOS9instances; here!= NULL; for(here = model->MOS9instances; here!= NULL;
here = here->MOS9nextInstance) { here = here->MOS9nextInstance) {
if (here->MOS9owner != ARCHme) continue;
/* save the unperturbed values in the state vector */ /* save the unperturbed values in the state vector */
for(i=0; i <= 16; i++) for(i=0; i <= 16; i++)

View File

@ -5,7 +5,6 @@ Modified: Alan Gillespie
**********/ **********/
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "smpdefs.h" #include "smpdefs.h"
#include "cktdefs.h" #include "cktdefs.h"
#include "mos9defs.h" #include "mos9defs.h"
@ -17,11 +16,7 @@ Modified: Alan Gillespie
#define EPSSIL (11.7 * 8.854214871e-12) #define EPSSIL (11.7 * 8.854214871e-12)
int int
MOS9setup(matrix,inModel,ckt,states) MOS9setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
SMPmatrix *matrix;
GENmodel *inModel;
CKTcircuit *ckt;
int *states;
/* load the MOS9 device structure with those pointers needed later /* load the MOS9 device structure with those pointers needed later
* for fast matrix loading * for fast matrix loading
*/ */
@ -152,10 +147,11 @@ MOS9setup(matrix,inModel,ckt,states)
CKTnode *tmpNode; CKTnode *tmpNode;
IFuid tmpName; IFuid tmpName;
/* allocate a chunk of the state vector */ if (here->MOS9owner == ARCHme) {
here->MOS9states = *states; /* allocate a chunk of the state vector */
*states += MOS9NUMSTATES; here->MOS9states = *states;
*states += MOS9NUMSTATES;
}
if(!here->MOS9drainAreaGiven) { if(!here->MOS9drainAreaGiven) {
here->MOS9drainArea = ckt->CKTdefaultMosAD; here->MOS9drainArea = ckt->CKTdefaultMosAD;
} }
@ -263,9 +259,7 @@ if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\
} }
int int
MOS9unsetup(inModel,ckt) MOS9unsetup(GENmodel *inModel, CKTcircuit *ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{ {
MOS9model *model; MOS9model *model;
MOS9instance *here; MOS9instance *here;

View File

@ -2,6 +2,8 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
Modified: Alan Gillespie Modified: Alan Gillespie
This function is obsolete (was used by an old sensitivity analysis)
**********/ **********/
/* actually load the current sensitivity /* actually load the current sensitivity
@ -9,7 +11,6 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "smpdefs.h" #include "smpdefs.h"
#include "cktdefs.h" #include "cktdefs.h"
#include "mos9defs.h" #include "mos9defs.h"
@ -17,9 +18,7 @@ Modified: Alan Gillespie
#include "suffix.h" #include "suffix.h"
int int
MOS9sLoad(inModel,ckt) MOS9sLoad(GENmodel *inModel, CKTcircuit *ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{ {
MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *)inModel;
MOS9instance *here; MOS9instance *here;
@ -101,7 +100,7 @@ CKTcircuit *ckt;
/* loop through all the instances of the model */ /* loop through all the instances of the model */
for (here = model->MOS9instances; here != NULL ; for (here = model->MOS9instances; here != NULL ;
here=here->MOS9nextInstance) { here=here->MOS9nextInstance) {
if (here->MOS9owner != ARCHme) continue;
#ifdef SENSDEBUG #ifdef SENSDEBUG
printf("senload instance name %s\n",here->MOS9name); printf("senload instance name %s\n",here->MOS9name);

View File

@ -2,6 +2,8 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
Modified: Alan Gillespie Modified: Alan Gillespie
This function is obsolete (was used by an old sensitivity analysis)
**********/ **********/
/* Pretty print the sensitivity info for all the MOS9 /* Pretty print the sensitivity info for all the MOS9
@ -9,7 +11,6 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "smpdefs.h" #include "smpdefs.h"
#include "cktdefs.h" #include "cktdefs.h"
#include "mos9defs.h" #include "mos9defs.h"
@ -17,14 +18,12 @@ Modified: Alan Gillespie
#include "suffix.h" #include "suffix.h"
void void
MOS9sPrint(inModel,ckt) MOS9sPrint(GENmodel *inModel, CKTcircuit *ckt)
GENmodel *inModel;
register CKTcircuit *ckt;
{ {
register MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *)inModel;
register MOS9instance *here; MOS9instance *here;
printf("LEVEL 3 MOSFETS (AG) -----------------\n"); printf("LEVEL 9 MOSFETS (AG) -----------------\n");
/* loop through all the MOS9 models */ /* loop through all the MOS9 models */
for( ; model != NULL; model = model->MOS9nextModel ) { for( ; model != NULL; model = model->MOS9nextModel ) {
@ -33,6 +32,7 @@ MOS9sPrint(inModel,ckt)
/* loop through all the instances of the model */ /* loop through all the instances of the model */
for (here = model->MOS9instances; here != NULL ; for (here = model->MOS9instances; here != NULL ;
here=here->MOS9nextInstance) { here=here->MOS9nextInstance) {
if (here->MOS9owner != ARCHme) continue;
printf(" Instance name:%s\n",here->MOS9name); printf(" Instance name:%s\n",here->MOS9name);
printf(" Drain, Gate , Source nodes: %s, %s ,%s\n", printf(" Drain, Gate , Source nodes: %s, %s ,%s\n",

View File

@ -2,6 +2,8 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
Modified: Alan Gillespie Modified: Alan Gillespie
This function is obsolete (was used by an old sensitivity analysis)
**********/ **********/
/* loop through all the devices and /* loop through all the devices and
@ -9,7 +11,6 @@ Modified: Alan Gillespie
*/ */
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "smpdefs.h" #include "smpdefs.h"
#include "cktdefs.h" #include "cktdefs.h"
#include "mos9defs.h" #include "mos9defs.h"
@ -17,9 +18,7 @@ Modified: Alan Gillespie
#include "suffix.h" #include "suffix.h"
int int
MOS9sSetup(info,inModel) MOS9sSetup(SENstruct *info, GENmodel *inModel)
SENstruct *info;
GENmodel *inModel;
{ {
MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *)inModel;
MOS9instance *here; MOS9instance *here;
@ -30,6 +29,7 @@ MOS9sSetup(info,inModel)
/* loop through all the instances of the model */ /* loop through all the instances of the model */
for (here = model->MOS9instances; here != NULL ; for (here = model->MOS9instances; here != NULL ;
here=here->MOS9nextInstance) { here=here->MOS9nextInstance) {
if (here->MOS9owner != ARCHme) continue;
if(here->MOS9senParmNo){ if(here->MOS9senParmNo){

View File

@ -2,9 +2,10 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
Modified: Alan Gillespie Modified: Alan Gillespie
This function is obsolete (was used by an old sensitivity analysis)
**********/ **********/
#include <stdio.h>
#include "ngspice.h" #include "ngspice.h"
#include "smpdefs.h" #include "smpdefs.h"
#include "cktdefs.h" #include "cktdefs.h"
@ -13,9 +14,7 @@ Modified: Alan Gillespie
#include "suffix.h" #include "suffix.h"
int int
MOS9sUpdate(inModel,ckt) MOS9sUpdate(GENmodel *inModel, CKTcircuit *ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{ {
MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *)inModel;
MOS9instance *here; MOS9instance *here;
@ -56,6 +55,7 @@ CKTcircuit *ckt;
/* loop through all the instances of the model */ /* loop through all the instances of the model */
for (here = model->MOS9instances; here != NULL ; for (here = model->MOS9instances; here != NULL ;
here=here->MOS9nextInstance) { here=here->MOS9nextInstance) {
if (here->MOS9owner != ARCHme) continue;
#ifdef SENSDEBUG #ifdef SENSDEBUG

View File

@ -5,7 +5,6 @@ Modified: Alan Gillespie
**********/ **********/
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h" #include "cktdefs.h"
#include "mos9defs.h" #include "mos9defs.h"
#include "const.h" #include "const.h"
@ -16,9 +15,7 @@ Modified: Alan Gillespie
#define EPSSIL (11.7 * 8.854214871e-12) #define EPSSIL (11.7 * 8.854214871e-12)
int int
MOS9temp(inModel,ckt) MOS9temp(GENmodel *inModel, CKTcircuit *ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{ {
MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *)inModel;
MOS9instance *here; MOS9instance *here;
@ -127,11 +124,16 @@ MOS9temp(inModel,ckt)
double arg; /* 1 - fc */ double arg; /* 1 - fc */
double sarg; /* (1-fc) ^^ (-mj) */ double sarg; /* (1-fc) ^^ (-mj) */
double sargsw; /* (1-fc) ^^ (-mjsw) */ double sargsw; /* (1-fc) ^^ (-mjsw) */
if (here->MOS9owner != ARCHme) continue;
/* perform the parameter defaulting */ /* perform the parameter defaulting */
if(!here->MOS9dtempGiven) {
here->MOS9dtemp = 0.0;
}
if(!here->MOS9tempGiven) { if(!here->MOS9tempGiven) {
here->MOS9temp = ckt->CKTtemp; here->MOS9temp = ckt->CKTtemp + here->MOS9dtemp;
} }
vt = here->MOS9temp * CONSTKoverQ; vt = here->MOS9temp * CONSTKoverQ;
ratio = here->MOS9temp/model->MOS9tnom; ratio = here->MOS9temp/model->MOS9tnom;

View File

@ -5,7 +5,6 @@ Modified: Alan Gillespie
**********/ **********/
#include "ngspice.h" #include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h" #include "cktdefs.h"
#include "mos9defs.h" #include "mos9defs.h"
#include "sperror.h" #include "sperror.h"
@ -22,6 +21,8 @@ MOS9trunc(inModel,ckt,timeStep)
for( ; model != NULL; model = model->MOS9nextModel) { for( ; model != NULL; model = model->MOS9nextModel) {
for(here=model->MOS9instances;here!=NULL;here = here->MOS9nextInstance){ for(here=model->MOS9instances;here!=NULL;here = here->MOS9nextInstance){
if (here->MOS9owner != ARCHme) continue;
CKTterr(here->MOS9qgs,ckt,timeStep); CKTterr(here->MOS9qgs,ckt,timeStep);
CKTterr(here->MOS9qgd,ckt,timeStep); CKTterr(here->MOS9qgd,ckt,timeStep);
CKTterr(here->MOS9qgb,ckt,timeStep); CKTterr(here->MOS9qgb,ckt,timeStep);