Added "dtemp". Cleaned the code a bit. Updated DEVICES.
This commit is contained in:
parent
5c26919de1
commit
b5112c0d47
|
|
@ -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>
|
||||
|
||||
* src/spicelib/devices/mos6/*: Added "m"
|
||||
|
|
|
|||
6
DEVICES
6
DEVICES
|
|
@ -262,7 +262,11 @@ MOS9 - Level 9 MOS model
|
|||
Ver: N/A
|
||||
Class: M
|
||||
Level: 9
|
||||
Status: TO BE TESTED
|
||||
Status:
|
||||
|
||||
Enhancements over the original model:
|
||||
|
||||
- Temperature difference from circuit temperature
|
||||
|
||||
|
||||
BSIM1 - BSIM model level 1
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ Modified: Alan Gillespie
|
|||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "devdefs.h"
|
||||
#include "ifsim.h"
|
||||
#include "mos9defs.h"
|
||||
|
|
@ -39,6 +38,7 @@ IFparm MOS9pTable[] = { /* parameters */
|
|||
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("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_w", MOS9_W_SENS, IF_FLAG, "flag to request sensitivity WRT width"),
|
||||
OPU("dnode", MOS9_DNODE, IF_INTEGER, "Number of drain node"),
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "mos9defs.h"
|
||||
#include "sperror.h"
|
||||
|
|
@ -15,9 +14,7 @@ Modified: Alan Gillespie
|
|||
|
||||
|
||||
int
|
||||
MOS9acLoad(inModel,ckt)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
MOS9acLoad(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
MOS9instance *here;
|
||||
|
|
@ -40,6 +37,7 @@ MOS9acLoad(inModel,ckt)
|
|||
for( ; model != NULL; model = model->MOS9nextModel) {
|
||||
for(here = model->MOS9instances; here!= NULL;
|
||||
here = here->MOS9nextInstance) {
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
if (here->MOS9mode < 0) {
|
||||
xnrm=0;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ Modified: Alan Gillespie
|
|||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "const.h"
|
||||
#include "ifsim.h"
|
||||
#include "cktdefs.h"
|
||||
|
|
@ -16,12 +15,8 @@ Modified: Alan Gillespie
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
MOS9ask(ckt,inst,which,value,select)
|
||||
CKTcircuit *ckt;
|
||||
GENinstance *inst;
|
||||
int which;
|
||||
IFvalue *value;
|
||||
IFvalue *select;
|
||||
MOS9ask(CKTcircuit *ckt, GENinstance *inst, int which,
|
||||
IFvalue *value, IFvalue *select)
|
||||
{
|
||||
MOS9instance *here = (MOS9instance *)inst;
|
||||
double vr;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ Modified: Alan Gillespie
|
|||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "mos9defs.h"
|
||||
#include "sperror.h"
|
||||
|
|
@ -13,9 +12,7 @@ Modified: Alan Gillespie
|
|||
#include "suffix.h"
|
||||
|
||||
int
|
||||
MOS9convTest(inModel,ckt)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
MOS9convTest(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
MOS9instance *here;
|
||||
|
|
@ -37,6 +34,7 @@ MOS9convTest(inModel,ckt)
|
|||
for( ; model != NULL; model = model->MOS9nextModel) {
|
||||
for(here = model->MOS9instances; here!= NULL;
|
||||
here = here->MOS9nextInstance) {
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
vbs = model->MOS9type * (
|
||||
*(ckt->CKTrhs+here->MOS9bNode) -
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ typedef struct sMOS9instance {
|
|||
double MOS9sourceConductance; /*conductance of source(or 0):set in setup*/
|
||||
double MOS9drainConductance; /*conductance of drain(or 0):set in setup*/
|
||||
double MOS9temp; /* operating temperature of this instance */
|
||||
double MOS9dtemp; /* instance temperature difference */
|
||||
|
||||
double MOS9tTransconductance; /* temperature corrected transconductance*/
|
||||
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 MOS9tempGiven :1; /* instance temperature specified */
|
||||
unsigned MOS9dtempGiven :1; /* instance temperature difference specified*/
|
||||
|
||||
unsigned MOS9mGiven :1;
|
||||
|
||||
|
|
@ -499,6 +501,7 @@ typedef struct sMOS9model { /* model structure for a resistor */
|
|||
#define MOS9_SOURCERESIST 78
|
||||
#define MOS9_DRAINRESIST 79
|
||||
#define MOS9_M 80
|
||||
#define MOS9_DTEMP 81
|
||||
|
||||
/* model parameters */
|
||||
#define MOS9_MOD_VTO 101
|
||||
|
|
@ -558,3 +561,4 @@ typedef struct sMOS9model { /* model structure for a resistor */
|
|||
#include "mos9ext.h"
|
||||
|
||||
#endif /*MOS9*/
|
||||
|
||||
|
|
|
|||
|
|
@ -7,17 +7,13 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "mos9defs.h"
|
||||
#include "sperror.h"
|
||||
#include "suffix.h"
|
||||
|
||||
|
||||
int
|
||||
MOS9delete(inModel,name,inst)
|
||||
GENmodel *inModel;
|
||||
IFuid name;
|
||||
GENinstance **inst;
|
||||
MOS9delete(GENmodel *inModel, IFuid name, GENinstance **inst)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
MOS9instance **fast = (MOS9instance **)inst;
|
||||
|
|
|
|||
|
|
@ -7,14 +7,12 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "mos9defs.h"
|
||||
#include "suffix.h"
|
||||
|
||||
|
||||
void
|
||||
MOS9destroy(inModel)
|
||||
GENmodel **inModel;
|
||||
MOS9destroy(GENmodel **inModel)
|
||||
{
|
||||
MOS9model **model = (MOS9model **)inModel;
|
||||
MOS9instance *here;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ Modified: Alan Gillespie
|
|||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "mos9defs.h"
|
||||
#include "sperror.h"
|
||||
|
|
@ -57,6 +56,7 @@ for( ; model != NULL; model = model->MOS9nextModel ) {
|
|||
for (here = model->MOS9instances; here != NULL ;
|
||||
here=here->MOS9nextInstance) {
|
||||
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
|
||||
/* loading starts here */
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ Modified: Alan Gillespie
|
|||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "devdefs.h"
|
||||
#include "mos9defs.h"
|
||||
|
|
@ -16,15 +15,13 @@ Modified: Alan Gillespie
|
|||
#include "suffix.h"
|
||||
|
||||
int
|
||||
MOS9dSetup(inModel,ckt)
|
||||
GENmodel *inModel;
|
||||
register CKTcircuit *ckt;
|
||||
MOS9dSetup(GENmodel *inModel, CKTcircuit *ckt)
|
||||
/* actually load the current value into the
|
||||
* sparse matrix previously provided
|
||||
*/
|
||||
{
|
||||
register MOS9model *model = (MOS9model *)inModel;
|
||||
register MOS9instance *here;
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
MOS9instance *here;
|
||||
double Beta;
|
||||
double DrainSatCur;
|
||||
double EffectiveLength;
|
||||
|
|
@ -69,6 +66,7 @@ next: for( ; model != NULL; model = model->MOS9nextModel ) {
|
|||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS9instances; here != NULL ;
|
||||
here=here->MOS9nextInstance) {
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
vt = CONSTKoverQ * here->MOS9temp;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "mos9defs.h"
|
||||
#include "sperror.h"
|
||||
|
|
@ -15,9 +14,7 @@ Modified: Alan Gillespie
|
|||
|
||||
|
||||
int
|
||||
MOS9getic(inModel,ckt)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
MOS9getic(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
MOS9instance *here;
|
||||
|
|
@ -28,6 +25,8 @@ MOS9getic(inModel,ckt)
|
|||
|
||||
for( ; model ; model = model->MOS9nextModel) {
|
||||
for(here = model->MOS9instances; here ; here = here->MOS9nextInstance) {
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
if(!here->MOS9icVBSGiven) {
|
||||
here->MOS9icVBS =
|
||||
*(ckt->CKTrhs + here->MOS9bNode) -
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ Modified: Alan Gillespie
|
|||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "devdefs.h"
|
||||
#include "mos9defs.h"
|
||||
|
|
@ -15,9 +14,7 @@ Modified: Alan Gillespie
|
|||
#include "suffix.h"
|
||||
|
||||
int
|
||||
MOS9load(inModel,ckt)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
MOS9load(GENmodel *inModel, CKTcircuit *ckt)
|
||||
/* actually load the current value into the
|
||||
* sparse matrix previously provided
|
||||
*/
|
||||
|
|
@ -77,7 +74,9 @@ MOS9load(inModel,ckt)
|
|||
double capgd; /* total gate-drain capacitance */
|
||||
double capgb; /* total gate-bulk capacitance */
|
||||
int Check;
|
||||
#ifndef NOBYPASS
|
||||
double tempv;
|
||||
#endif /*NOBYPASS*/
|
||||
int error;
|
||||
#ifdef CAPBYPASS
|
||||
int senflag;
|
||||
|
|
@ -108,6 +107,7 @@ next:
|
|||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS9instances; here != NULL ;
|
||||
here=here->MOS9nextInstance) {
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
vt = CONSTKoverQ * here->MOS9temp;
|
||||
Check=1;
|
||||
|
|
@ -122,10 +122,6 @@ next:
|
|||
|
||||
}
|
||||
SenCond = ckt->CKTsenInfo && here->MOS9senPertFlag;
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9pta");
|
||||
asm("mos9pta:");
|
||||
#endif /* DETAILPROF */
|
||||
|
||||
/* first, we compute a few useful values - these could be
|
||||
* pre-computed, but for historical reasons are still done
|
||||
|
|
@ -198,10 +194,6 @@ asm("mos9pta:");
|
|||
goto next1;
|
||||
}
|
||||
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9ptax");
|
||||
asm("mos9ptax:");
|
||||
#endif /* DETAILPROF */
|
||||
|
||||
/*
|
||||
* ok - now to do the start-up operations
|
||||
|
|
@ -256,10 +248,6 @@ asm("mos9ptax:");
|
|||
#endif /*PREDICTOR*/
|
||||
|
||||
/* now some common crunching for some more useful quantities */
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9ptay");
|
||||
asm("mos9ptay:");
|
||||
#endif /* DETAILPROF */
|
||||
|
||||
vbd=vbs-vds;
|
||||
vgd=vgs-vds;
|
||||
|
|
@ -293,11 +281,7 @@ asm("mos9ptay:");
|
|||
here->MOS9cbd +
|
||||
here->MOS9gbd * delvbd +
|
||||
here->MOS9gbs * delvbs ;
|
||||
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9ptb");
|
||||
asm("mos9ptb:");
|
||||
#endif /* DETAILPROF */
|
||||
#ifndef NOBYPASS
|
||||
/* now lets see if we can bypass (ugh) */
|
||||
/* the following mess should be one if statement, but
|
||||
* many compilers can't handle it all at once, so it
|
||||
|
|
@ -351,11 +335,7 @@ asm("mos9ptb:");
|
|||
}
|
||||
goto bypass;
|
||||
}
|
||||
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9ptc");
|
||||
asm("mos9ptc:");
|
||||
#endif /* DETAILPROF */
|
||||
#endif /*NOBYPASS*/
|
||||
/* ok - bypass is out, do it the hard way */
|
||||
|
||||
von = model->MOS9type * here->MOS9von;
|
||||
|
|
@ -396,10 +376,6 @@ asm("mos9ptc:");
|
|||
|
||||
} else {
|
||||
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9ptd");
|
||||
asm("mos9ptd:");
|
||||
#endif /* DETAILPROF */
|
||||
/* ok - not one of the simple cases, so we have to
|
||||
* look at all of the possibilities for why we were
|
||||
* 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
|
||||
* real work
|
||||
|
|
@ -474,10 +446,6 @@ next1: if(vbs <= -3*vt) {
|
|||
here->MOS9mode = -1;
|
||||
}
|
||||
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9ptf");
|
||||
asm("mos9ptf:");
|
||||
#endif /* DETAILPROF */
|
||||
{
|
||||
/*
|
||||
* 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 */
|
||||
|
||||
|
|
@ -1076,10 +1040,7 @@ asm("mos9ptg:");
|
|||
}
|
||||
#endif /*CAPZEROBYPASS*/
|
||||
}
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9pth");
|
||||
asm("mos9pth:");
|
||||
#endif /* DETAILPROF */
|
||||
|
||||
if(SenCond && (ckt->CKTsenInfo->SENmode==TRANSEN)) goto next2;
|
||||
|
||||
if ( ckt->CKTmode & MODETRAN ) {
|
||||
|
|
@ -1107,10 +1068,7 @@ asm("mos9pth:");
|
|||
here->MOS9cbs += *(ckt->CKTstate0 + here->MOS9cqbs);
|
||||
}
|
||||
}
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9pti");
|
||||
asm("mos9pti:");
|
||||
#endif /* DETAILPROF */
|
||||
|
||||
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 */
|
||||
|
||||
|
|
@ -1136,10 +1091,7 @@ next2: *(ckt->CKTstate0 + here->MOS9vbs) = vbs;
|
|||
*(ckt->CKTstate0 + here->MOS9vgs) = vgs;
|
||||
*(ckt->CKTstate0 + here->MOS9vds) = vds;
|
||||
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9ptk");
|
||||
asm("mos9ptk:");
|
||||
#endif /* DETAILPROF */
|
||||
|
||||
|
||||
/*
|
||||
* meyer's capacitor model
|
||||
|
|
@ -1195,10 +1147,7 @@ asm("mos9ptk:");
|
|||
here->MOS9cgb = capgb;
|
||||
}
|
||||
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9ptl");
|
||||
asm("mos9ptl:");
|
||||
#endif /* DETAILPROF */
|
||||
|
||||
/*
|
||||
* store small-signal parameters (for meyer's model)
|
||||
* all parameters already stored, so done...
|
||||
|
|
@ -1242,10 +1191,7 @@ asm("mos9ptl:");
|
|||
}
|
||||
bypass:
|
||||
if(SenCond) continue;
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9ptm");
|
||||
asm("mos9ptm:");
|
||||
#endif /* DETAILPROF */
|
||||
|
||||
|
||||
if ( (ckt->CKTmode & (MODEINITTRAN)) ||
|
||||
(! (ckt->CKTmode & (MODETRAN)) ) ) {
|
||||
|
|
@ -1284,10 +1230,7 @@ asm("mos9ptm:");
|
|||
* store charge storage info for meyer's cap in lx table
|
||||
*/
|
||||
|
||||
#ifdef DETAILPROF
|
||||
asm(" .globl mos9ptn");
|
||||
asm("mos9ptn:");
|
||||
#endif /* DETAILPROF */
|
||||
|
||||
/*
|
||||
* load current vector
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "const.h"
|
||||
#include "ifsim.h"
|
||||
#include "cktdefs.h"
|
||||
|
|
@ -19,11 +18,7 @@ Modified: Alan Gillespie
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
MOS9mAsk(ckt,inst,which,value)
|
||||
CKTcircuit *ckt;
|
||||
GENmodel *inst;
|
||||
int which;
|
||||
IFvalue *value;
|
||||
MOS9mAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
|
||||
{
|
||||
MOS9model *here = (MOS9model *)inst;
|
||||
switch(which) {
|
||||
|
|
|
|||
|
|
@ -7,17 +7,13 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "mos9defs.h"
|
||||
#include "sperror.h"
|
||||
#include "suffix.h"
|
||||
|
||||
|
||||
int
|
||||
MOS9mDelete(inModel,modname,kill)
|
||||
GENmodel **inModel;
|
||||
IFuid modname;
|
||||
GENmodel *kill;
|
||||
MOS9mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill)
|
||||
{
|
||||
MOS9model **model = (MOS9model **)inModel;
|
||||
MOS9model *modfast = (MOS9model *)kill;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "const.h"
|
||||
#include "ifsim.h"
|
||||
#include "mos9defs.h"
|
||||
|
|
@ -16,10 +15,7 @@ Modified: Alan Gillespie
|
|||
|
||||
|
||||
int
|
||||
MOS9mParam(param,value,inModel)
|
||||
int param;
|
||||
IFvalue *value;
|
||||
GENmodel *inModel;
|
||||
MOS9mParam(int param, IFvalue *value, GENmodel *inModel)
|
||||
{
|
||||
register MOS9model *model = (MOS9model *)inModel;
|
||||
switch(param) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ Modified: Alan Gillespie
|
|||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "mos9defs.h"
|
||||
#include "cktdefs.h"
|
||||
#include "iferrmsg.h"
|
||||
|
|
@ -25,13 +24,8 @@ extern void NevalSrc();
|
|||
extern double Nintegrate();
|
||||
|
||||
int
|
||||
MOS9noise (mode, operation, genmodel, ckt, data, OnDens)
|
||||
int mode;
|
||||
int operation;
|
||||
GENmodel *genmodel;
|
||||
CKTcircuit *ckt;
|
||||
Ndata *data;
|
||||
double *OnDens;
|
||||
MOS9noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt,
|
||||
Ndata *data, double *OnDens)
|
||||
{
|
||||
MOS9model *firstModel = (MOS9model *) genmodel;
|
||||
MOS9model *model;
|
||||
|
|
@ -56,6 +50,8 @@ MOS9noise (mode, operation, genmodel, ckt, data, OnDens)
|
|||
|
||||
for (model=firstModel; model != NULL; model=model->MOS9nextModel) {
|
||||
for (inst=model->MOS9instances; inst != NULL; inst=inst->MOS9nextInstance) {
|
||||
if (inst->MOS9owner != ARCHme) continue;
|
||||
|
||||
switch (operation) {
|
||||
|
||||
case N_OPEN:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "const.h"
|
||||
#include "ifsim.h"
|
||||
#include "mos9defs.h"
|
||||
|
|
@ -17,11 +16,8 @@ Modified: Alan Gillespie
|
|||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
MOS9param(param,value,inst,select)
|
||||
int param;
|
||||
IFvalue *value;
|
||||
GENinstance *inst;
|
||||
IFvalue *select;
|
||||
MOS9param(int param, IFvalue *value, GENinstance *inst,
|
||||
IFvalue *select)
|
||||
{
|
||||
MOS9instance *here = (MOS9instance *)inst;
|
||||
switch(param) {
|
||||
|
|
@ -81,6 +77,10 @@ MOS9param(param,value,inst,select)
|
|||
here->MOS9temp = value->rValue+CONSTCtoK;
|
||||
here->MOS9tempGiven = TRUE;
|
||||
break;
|
||||
case MOS9_DTEMP:
|
||||
here->MOS9dtemp = value->rValue;
|
||||
here->MOS9dtempGiven = TRUE;
|
||||
break;
|
||||
case MOS9_IC:
|
||||
switch(value->v.numValue){
|
||||
case 3:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "complex.h"
|
||||
#include "mos9defs.h"
|
||||
|
|
@ -16,10 +15,7 @@ Modified: Alan Gillespie
|
|||
|
||||
|
||||
int
|
||||
MOS9pzLoad(inModel,ckt,s)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
SPcomplex *s;
|
||||
MOS9pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
MOS9instance *here;
|
||||
|
|
@ -42,6 +38,7 @@ MOS9pzLoad(inModel,ckt,s)
|
|||
for( ; model != NULL; model = model->MOS9nextModel) {
|
||||
for(here = model->MOS9instances; here!= NULL;
|
||||
here = here->MOS9nextInstance) {
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
if (here->MOS9mode < 0) {
|
||||
xnrm=0;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Thomas L. Quarles
|
||||
Modified: Alan Gillespie
|
||||
|
||||
This function is obsolete (was used by an old sensitivity analysis)
|
||||
**********/
|
||||
|
||||
/* actually load the current ac sensitivity
|
||||
|
|
@ -9,7 +11,6 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "smpdefs.h"
|
||||
#include "cktdefs.h"
|
||||
#include "const.h"
|
||||
|
|
@ -18,9 +19,7 @@ Modified: Alan Gillespie
|
|||
#include "suffix.h"
|
||||
|
||||
int
|
||||
MOS9sAcLoad(inModel,ckt)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
MOS9sAcLoad(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
MOS9instance *here;
|
||||
|
|
@ -133,6 +132,7 @@ CKTcircuit *ckt;
|
|||
for( ; model != NULL; model = model->MOS9nextModel) {
|
||||
for(here = model->MOS9instances; here!= NULL;
|
||||
here = here->MOS9nextInstance) {
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
/* save the unperturbed values in the state vector */
|
||||
for(i=0; i <= 16; i++)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ Modified: Alan Gillespie
|
|||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "smpdefs.h"
|
||||
#include "cktdefs.h"
|
||||
#include "mos9defs.h"
|
||||
|
|
@ -17,11 +16,7 @@ Modified: Alan Gillespie
|
|||
#define EPSSIL (11.7 * 8.854214871e-12)
|
||||
|
||||
int
|
||||
MOS9setup(matrix,inModel,ckt,states)
|
||||
SMPmatrix *matrix;
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
int *states;
|
||||
MOS9setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||
/* load the MOS9 device structure with those pointers needed later
|
||||
* for fast matrix loading
|
||||
*/
|
||||
|
|
@ -152,10 +147,11 @@ MOS9setup(matrix,inModel,ckt,states)
|
|||
CKTnode *tmpNode;
|
||||
IFuid tmpName;
|
||||
|
||||
if (here->MOS9owner == ARCHme) {
|
||||
/* allocate a chunk of the state vector */
|
||||
here->MOS9states = *states;
|
||||
*states += MOS9NUMSTATES;
|
||||
|
||||
}
|
||||
if(!here->MOS9drainAreaGiven) {
|
||||
here->MOS9drainArea = ckt->CKTdefaultMosAD;
|
||||
}
|
||||
|
|
@ -263,9 +259,7 @@ if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\
|
|||
}
|
||||
|
||||
int
|
||||
MOS9unsetup(inModel,ckt)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
MOS9unsetup(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS9model *model;
|
||||
MOS9instance *here;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Thomas L. Quarles
|
||||
Modified: Alan Gillespie
|
||||
|
||||
This function is obsolete (was used by an old sensitivity analysis)
|
||||
**********/
|
||||
|
||||
/* actually load the current sensitivity
|
||||
|
|
@ -9,7 +11,6 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "smpdefs.h"
|
||||
#include "cktdefs.h"
|
||||
#include "mos9defs.h"
|
||||
|
|
@ -17,9 +18,7 @@ Modified: Alan Gillespie
|
|||
#include "suffix.h"
|
||||
|
||||
int
|
||||
MOS9sLoad(inModel,ckt)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
MOS9sLoad(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
MOS9instance *here;
|
||||
|
|
@ -101,7 +100,7 @@ CKTcircuit *ckt;
|
|||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS9instances; here != NULL ;
|
||||
here=here->MOS9nextInstance) {
|
||||
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
#ifdef SENSDEBUG
|
||||
printf("senload instance name %s\n",here->MOS9name);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Thomas L. Quarles
|
||||
Modified: Alan Gillespie
|
||||
|
||||
This function is obsolete (was used by an old sensitivity analysis)
|
||||
**********/
|
||||
|
||||
/* Pretty print the sensitivity info for all the MOS9
|
||||
|
|
@ -9,7 +11,6 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "smpdefs.h"
|
||||
#include "cktdefs.h"
|
||||
#include "mos9defs.h"
|
||||
|
|
@ -17,14 +18,12 @@ Modified: Alan Gillespie
|
|||
#include "suffix.h"
|
||||
|
||||
void
|
||||
MOS9sPrint(inModel,ckt)
|
||||
GENmodel *inModel;
|
||||
register CKTcircuit *ckt;
|
||||
MOS9sPrint(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
register MOS9model *model = (MOS9model *)inModel;
|
||||
register MOS9instance *here;
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
MOS9instance *here;
|
||||
|
||||
printf("LEVEL 3 MOSFETS (AG) -----------------\n");
|
||||
printf("LEVEL 9 MOSFETS (AG) -----------------\n");
|
||||
/* loop through all the MOS9 models */
|
||||
for( ; model != NULL; model = model->MOS9nextModel ) {
|
||||
|
||||
|
|
@ -33,6 +32,7 @@ MOS9sPrint(inModel,ckt)
|
|||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS9instances; here != NULL ;
|
||||
here=here->MOS9nextInstance) {
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
printf(" Instance name:%s\n",here->MOS9name);
|
||||
printf(" Drain, Gate , Source nodes: %s, %s ,%s\n",
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Thomas L. Quarles
|
||||
Modified: Alan Gillespie
|
||||
|
||||
This function is obsolete (was used by an old sensitivity analysis)
|
||||
**********/
|
||||
|
||||
/* loop through all the devices and
|
||||
|
|
@ -9,7 +11,6 @@ Modified: Alan Gillespie
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "smpdefs.h"
|
||||
#include "cktdefs.h"
|
||||
#include "mos9defs.h"
|
||||
|
|
@ -17,9 +18,7 @@ Modified: Alan Gillespie
|
|||
#include "suffix.h"
|
||||
|
||||
int
|
||||
MOS9sSetup(info,inModel)
|
||||
SENstruct *info;
|
||||
GENmodel *inModel;
|
||||
MOS9sSetup(SENstruct *info, GENmodel *inModel)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
MOS9instance *here;
|
||||
|
|
@ -30,6 +29,7 @@ MOS9sSetup(info,inModel)
|
|||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS9instances; here != NULL ;
|
||||
here=here->MOS9nextInstance) {
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
|
||||
if(here->MOS9senParmNo){
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@
|
|||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Thomas L. Quarles
|
||||
Modified: Alan Gillespie
|
||||
|
||||
This function is obsolete (was used by an old sensitivity analysis)
|
||||
**********/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "ngspice.h"
|
||||
#include "smpdefs.h"
|
||||
#include "cktdefs.h"
|
||||
|
|
@ -13,9 +14,7 @@ Modified: Alan Gillespie
|
|||
#include "suffix.h"
|
||||
|
||||
int
|
||||
MOS9sUpdate(inModel,ckt)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
MOS9sUpdate(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
MOS9instance *here;
|
||||
|
|
@ -56,6 +55,7 @@ CKTcircuit *ckt;
|
|||
/* loop through all the instances of the model */
|
||||
for (here = model->MOS9instances; here != NULL ;
|
||||
here=here->MOS9nextInstance) {
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
|
||||
#ifdef SENSDEBUG
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ Modified: Alan Gillespie
|
|||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "mos9defs.h"
|
||||
#include "const.h"
|
||||
|
|
@ -16,9 +15,7 @@ Modified: Alan Gillespie
|
|||
#define EPSSIL (11.7 * 8.854214871e-12)
|
||||
|
||||
int
|
||||
MOS9temp(inModel,ckt)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
MOS9temp(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
MOS9model *model = (MOS9model *)inModel;
|
||||
MOS9instance *here;
|
||||
|
|
@ -127,11 +124,16 @@ MOS9temp(inModel,ckt)
|
|||
double arg; /* 1 - fc */
|
||||
double sarg; /* (1-fc) ^^ (-mj) */
|
||||
double sargsw; /* (1-fc) ^^ (-mjsw) */
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
/* perform the parameter defaulting */
|
||||
|
||||
if(!here->MOS9dtempGiven) {
|
||||
here->MOS9dtemp = 0.0;
|
||||
}
|
||||
|
||||
if(!here->MOS9tempGiven) {
|
||||
here->MOS9temp = ckt->CKTtemp;
|
||||
here->MOS9temp = ckt->CKTtemp + here->MOS9dtemp;
|
||||
}
|
||||
vt = here->MOS9temp * CONSTKoverQ;
|
||||
ratio = here->MOS9temp/model->MOS9tnom;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ Modified: Alan Gillespie
|
|||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "mos9defs.h"
|
||||
#include "sperror.h"
|
||||
|
|
@ -22,6 +21,8 @@ MOS9trunc(inModel,ckt,timeStep)
|
|||
|
||||
for( ; model != NULL; model = model->MOS9nextModel) {
|
||||
for(here=model->MOS9instances;here!=NULL;here = here->MOS9nextInstance){
|
||||
if (here->MOS9owner != ARCHme) continue;
|
||||
|
||||
CKTterr(here->MOS9qgs,ckt,timeStep);
|
||||
CKTterr(here->MOS9qgd,ckt,timeStep);
|
||||
CKTterr(here->MOS9qgb,ckt,timeStep);
|
||||
|
|
|
|||
Loading…
Reference in New Issue