Browse Source

MOS6 update ("m" and "dtemp")

pre-master-46
pnenzi 23 years ago
parent
commit
29c808d51d
  1. 3
      src/spicelib/devices/mos6/mos6.c
  2. 61
      src/spicelib/devices/mos6/mos6ask.c
  3. 5
      src/spicelib/devices/mos6/mos6conv.c
  4. 6
      src/spicelib/devices/mos6/mos6defs.h
  5. 4
      src/spicelib/devices/mos6/mos6dest.c
  6. 24
      src/spicelib/devices/mos6/mos6ext.h
  7. 5
      src/spicelib/devices/mos6/mos6ic.c
  8. 62
      src/spicelib/devices/mos6/mos6load.c
  9. 8
      src/spicelib/devices/mos6/mos6mask.c
  10. 6
      src/spicelib/devices/mos6/mos6mpar.c
  11. 15
      src/spicelib/devices/mos6/mos6par.c
  12. 15
      src/spicelib/devices/mos6/mos6set.c
  13. 13
      src/spicelib/devices/mos6/mos6temp.c
  14. 6
      src/spicelib/devices/mos6/mos6trun.c

3
src/spicelib/devices/mos6/mos6.c

@ -4,7 +4,6 @@ Author: 1989 Takayasu Sakurai
**********/
#include "ngspice.h"
#include <stdio.h>
#include "devdefs.h"
#include "ifsim.h"
#include "mos6defs.h"
@ -13,6 +12,7 @@ Author: 1989 Takayasu Sakurai
IFparm MOS6pTable[] = { /* parameters */
IOPU("l", MOS6_L, IF_REAL , "Length"),
IOPU("w", MOS6_W, IF_REAL , "Width"),
IOPU("m", MOS6_M, IF_REAL , "Parallel Multiplier"),
IOPU("ad", MOS6_AD, IF_REAL , "Drain area"),
IOPU("as", MOS6_AS, IF_REAL , "Source area"),
IOPU("pd", MOS6_PD, IF_REAL , "Drain perimeter"),
@ -35,6 +35,7 @@ IFparm MOS6pTable[] = { /* parameters */
IOPAU("icvgs", MOS6_IC_VGS, IF_REAL , "Initial G-S voltage"),
IOPAU("icvbs", MOS6_IC_VBS, IF_REAL , "Initial B-S voltage"),
IOPU("temp", MOS6_TEMP, IF_REAL, "Instance temperature"),
IOPU("dtemp", MOS6_DTEMP, IF_REAL, "Instance temperature difference"),
IP( "ic", MOS6_IC, IF_REALVEC, "Vector of D-S, G-S, B-S voltages"),
IP( "sens_l", MOS6_L_SENS, IF_FLAG, "flag to request sensitivity WRT length"),
IP( "sens_w", MOS6_W_SENS, IF_FLAG, "flag to request sensitivity WRT width"),

61
src/spicelib/devices/mos6/mos6ask.c

@ -5,7 +5,6 @@ Modified: 2000 AlansFixes
**********/
#include "ngspice.h"
#include <stdio.h>
#include "const.h"
#include "ifsim.h"
#include "cktdefs.h"
@ -16,12 +15,8 @@ Modified: 2000 AlansFixes
/*ARGSUSED*/
int
MOS6ask(ckt,inst,which,value,select)
CKTcircuit *ckt;
GENinstance *inst;
int which;
IFvalue *value;
IFvalue *select;
MOS6ask(CKTcircuit *ckt, GENinstance *inst, int which,
IFvalue *value, IFvalue *select)
{
MOS6instance *here = (MOS6instance*)inst;
double vr;
@ -32,37 +27,52 @@ MOS6ask(ckt,inst,which,value,select)
static char *msg = "Current and power not available for ac analysis";
switch(which) {
case MOS6_TEMP:
value->rValue = here->MOS6temp-CONSTCtoK;
value->rValue = here->MOS6temp - CONSTCtoK;
return(OK);
case MOS6_DTEMP:
value->rValue = here->MOS6dtemp;
return(OK);
case MOS6_CGS:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS6capgs);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CGD:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS6capgd);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_L:
value->rValue = here->MOS6l;
return(OK);
case MOS6_W:
value->rValue = here->MOS6w;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_M:
value->rValue = here->MOS6m;
return(OK);
case MOS6_AS:
value->rValue = here->MOS6sourceArea;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_AD:
value->rValue = here->MOS6drainArea;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_PS:
value->rValue = here->MOS6sourcePerimiter;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_PD:
value->rValue = here->MOS6drainPerimiter;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_NRS:
value->rValue = here->MOS6sourceSquares;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_NRD:
value->rValue = here->MOS6drainSquares;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_OFF:
value->rValue = here->MOS6off;
@ -96,21 +106,25 @@ MOS6ask(ckt,inst,which,value,select)
return(OK);
case MOS6_SOURCECONDUCT:
value->rValue = here->MOS6sourceConductance;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_DRAINCONDUCT:
value->rValue = here->MOS6drainConductance;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_SOURCERESIST:
if (here->MOS6sNodePrime != here->MOS6sNode)
value->rValue = 1.0 / here->MOS6sourceConductance;
else
value->rValue = 0.0;
value->rValue /= here->MOS6m;
return(OK);
case MOS6_DRAINRESIST:
if (here->MOS6dNodePrime != here->MOS6dNode)
value->rValue = 1.0 / here->MOS6drainConductance;
else
value->rValue = 0.0;
value->rValue /= here->MOS6m;
return(OK);
case MOS6_VON:
value->rValue = here->MOS6von;
@ -126,45 +140,59 @@ MOS6ask(ckt,inst,which,value,select)
return(OK);
case MOS6_CD:
value->rValue = here->MOS6cd;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CBS:
value->rValue = here->MOS6cbs;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CBD:
value->rValue = here->MOS6cbd;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_GMBS:
value->rValue = here->MOS6gmbs;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_GM:
value->rValue = here->MOS6gm;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_GDS:
value->rValue = here->MOS6gds;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_GBD:
value->rValue = here->MOS6gbd;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_GBS:
value->rValue = here->MOS6gbs;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CAPBD:
value->rValue = here->MOS6capbd;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CAPBS:
value->rValue = here->MOS6capbs;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CAPZEROBIASBD:
value->rValue = here->MOS6Cbd;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CAPZEROBIASBDSW:
value->rValue = here->MOS6Cbdsw;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CAPZEROBIASBS:
value->rValue = here->MOS6Cbs;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CAPZEROBIASBSSW:
value->rValue = here->MOS6Cbssw;
value->rValue *= here->MOS6m;
return(OK);
case MOS6_VBD:
value->rValue = *(ckt->CKTstate0 + here->MOS6vbd);
@ -183,24 +211,30 @@ MOS6ask(ckt,inst,which,value,select)
/* add overlap capacitance */
value->rValue += (here->sMOS6modPtr->MOS6gateSourceOverlapCapFactor)
* (here->MOS6w);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_QGS:
value->rValue = *(ckt->CKTstate0 + here->MOS6qgs);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CQGS:
value->rValue = *(ckt->CKTstate0 + here->MOS6cqgs);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CAPGD:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS6capgd);
/* add overlap capacitance */
value->rValue += (here->sMOS6modPtr->MOS6gateSourceOverlapCapFactor)
* (here->MOS6w);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_QGD:
value->rValue = *(ckt->CKTstate0 + here->MOS6qgd);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CQGD:
value->rValue = *(ckt->CKTstate0 + here->MOS6cqgd);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CAPGB:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS6capgb);
@ -208,24 +242,31 @@ MOS6ask(ckt,inst,which,value,select)
value->rValue += (here->sMOS6modPtr->MOS6gateBulkOverlapCapFactor)
* (here->MOS6l
-2*(here->sMOS6modPtr->MOS6latDiff));
value->rValue *= here->MOS6m;
return(OK);
case MOS6_QGB:
value->rValue = *(ckt->CKTstate0 + here->MOS6qgb);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CQGB:
value->rValue = *(ckt->CKTstate0 + here->MOS6cqgb);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_QBD:
value->rValue = *(ckt->CKTstate0 + here->MOS6qbd);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CQBD:
value->rValue = *(ckt->CKTstate0 + here->MOS6cqbd);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_QBS:
value->rValue = *(ckt->CKTstate0 + here->MOS6qbs);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CQBS:
value->rValue = *(ckt->CKTstate0 + here->MOS6cqbs);
value->rValue *= here->MOS6m;
return(OK);
case MOS6_L_SENS_DC:
if(ckt->CKTsenInfo && here->MOS6sens_l){
@ -353,6 +394,7 @@ MOS6ask(ckt,inst,which,value,select)
value->rValue = here->MOS6cbd + here->MOS6cbs - *(ckt->CKTstate0
+ here->MOS6cqgb);
}
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CG :
if (ckt->CKTcurrentAnalysis & DOING_AC) {
@ -370,6 +412,7 @@ MOS6ask(ckt,inst,which,value,select)
*(ckt->CKTstate0 + here->MOS6cqgd) + *(ckt->CKTstate0 +
here->MOS6cqgs);
}
value->rValue *= here->MOS6m;
return(OK);
case MOS6_CS :
if (ckt->CKTcurrentAnalysis & DOING_AC) {
@ -388,6 +431,7 @@ MOS6ask(ckt,inst,which,value,select)
*(ckt->CKTstate0 + here->MOS6cqgs);
}
}
value->rValue *= here->MOS6m;
return(OK);
case MOS6_POWER :
if (ckt->CKTcurrentAnalysis & DOING_AC) {
@ -420,6 +464,7 @@ MOS6ask(ckt,inst,which,value,select)
}
value->rValue += temp * *(ckt->CKTrhsOld + here->MOS6sNode);
}
value->rValue *= here->MOS6m;
return(OK);
default:
return(E_BADPARM);

5
src/spicelib/devices/mos6/mos6conv.c

@ -4,16 +4,13 @@ Author: 1989 Takayasu Sakurai
**********/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "mos6defs.h"
#include "sperror.h"
#include "suffix.h"
int
MOS6convTest(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS6convTest(GENmodel *inModel, CKTcircuit *ckt)
{
MOS6model *model = (MOS6model*)inModel;
MOS6instance *here;

6
src/spicelib/devices/mos6/mos6defs.h

@ -31,6 +31,7 @@ typedef struct sMOS6instance {
double MOS6l; /* the length of the channel region */
double MOS6w; /* the width of the channel region */
double MOS6m; /* the parallel multiplier */
double MOS6drainArea; /* the area of the drain diffusion */
double MOS6sourceArea; /* the area of the source diffusion */
double MOS6drainSquares; /* the length of the drain in squares */
@ -40,6 +41,7 @@ typedef struct sMOS6instance {
double MOS6sourceConductance; /*conductance of source(or 0):set in setup*/
double MOS6drainConductance; /*conductance of drain(or 0):set in setup*/
double MOS6temp; /* operating temperature of this instance */
double MOS6dtemp; /* instance temperature difference from circuit */
double MOS6tKv; /* temperature corrected drain linear cond. factor*/
double MOS6tKc; /* temperature corrected saturation cur. factor*/
@ -89,8 +91,10 @@ typedef struct sMOS6instance {
unsigned MOS6off:1; /* non-zero to indicate device is off for dc analysis*/
unsigned MOS6tempGiven :1; /* instance temperature specified */
unsigned MOS6dtempGiven :1;
unsigned MOS6lGiven :1;
unsigned MOS6wGiven :1;
unsigned MOS6mGiven :1;
unsigned MOS6drainAreaGiven :1;
unsigned MOS6sourceAreaGiven :1;
unsigned MOS6drainSquaresGiven :1;
@ -353,6 +357,8 @@ typedef struct sMOS6model { /* model structure for a resistor */
#define MOS6_CS 18
#define MOS6_POWER 19
#define MOS6_TEMP 20
#define MOS6_DTEMP 21
#define MOS6_M 22
/* model paramerers */
#define MOS6_MOD_VTO 101

4
src/spicelib/devices/mos6/mos6dest.c

@ -6,14 +6,12 @@ Author: 1989 Takayasu Sakurai
*/
#include "ngspice.h"
#include <stdio.h>
#include "mos6defs.h"
#include "suffix.h"
void
MOS6destroy(inModel)
GENmodel **inModel;
MOS6destroy(GENmodel **inModel)
{
MOS6model **model = (MOS6model**)inModel;
MOS6instance *here;

24
src/spicelib/devices/mos6/mos6ext.h

@ -3,7 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
**********/
#ifdef __STDC__
extern int MOS6acLoad(GENmodel *,CKTcircuit*);
extern int MOS6ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*);
extern int MOS6delete(GENmodel*,IFuid,GENinstance**);
@ -20,26 +19,3 @@ extern int MOS6unsetup(GENmodel*,CKTcircuit*);
extern int MOS6temp(GENmodel*,CKTcircuit*);
extern int MOS6trunc(GENmodel*,CKTcircuit*,double*);
extern int MOS6convTest(GENmodel*,CKTcircuit*);
#else /* stdc */
extern int MOS6acLoad();
extern int MOS6ask();
extern int MOS6delete();
extern void MOS6destroy();
extern int MOS6getic();
extern int MOS6load();
extern int MOS6mAsk();
extern int MOS6mDelete();
extern int MOS6mParam();
extern int MOS6param();
extern int MOS6pzLoad();
extern int MOS6sAcLoad();
extern int MOS6sLoad();
extern void MOS6sPrint();
extern int MOS6sSetup();
extern int MOS6sUpdate();
extern int MOS6setup();
extern int MOS6unsetup();
extern int MOS6temp();
extern int MOS6trunc();
extern int MOS6convTest();
#endif /* stdc */

5
src/spicelib/devices/mos6/mos6ic.c

@ -6,7 +6,6 @@ Author: 1989 Takayasu Sakurai
*/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "mos6defs.h"
#include "sperror.h"
@ -14,9 +13,7 @@ Author: 1989 Takayasu Sakurai
int
MOS6getic(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS6getic(GENmodel *inModel, CKTcircuit *ckt)
{
MOS6model *model = (MOS6model *)inModel;
MOS6instance *here;

62
src/spicelib/devices/mos6/mos6load.c

@ -5,7 +5,6 @@ Modified: 2000 AlansFixes
**********/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "devdefs.h"
#include "mos6defs.h"
@ -15,9 +14,7 @@ Modified: 2000 AlansFixes
#include "suffix.h"
int
MOS6load(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS6load(GENmodel *inModel, CKTcircuit *ckt)
/* actually load the current value into the
* sparse matrix previously provided
*/
@ -80,6 +77,8 @@ MOS6load(inModel,ckt)
int error;
int SenCond;
int m;
/* loop through all the MOS6 device models */
for( ; model != NULL; model = model->MOS6nextModel ) {
@ -877,6 +876,9 @@ bypass:
/*
* load current vector
*/
m = here->MOS6m;
ceqbs = model->MOS6type *
(here->MOS6cbs-(here->MOS6gbs)*vbs);
ceqbd = model->MOS6type *
@ -893,44 +895,44 @@ bypass:
here->MOS6gm*vgd-here->MOS6gmbs*vbd);
}
*(ckt->CKTrhs + here->MOS6gNode) -=
(model->MOS6type * (ceqgs + ceqgb + ceqgd));
m * (model->MOS6type * (ceqgs + ceqgb + ceqgd));
*(ckt->CKTrhs + here->MOS6bNode) -=
(ceqbs + ceqbd - model->MOS6type * ceqgb);
m * (ceqbs + ceqbd - model->MOS6type * ceqgb);
*(ckt->CKTrhs + here->MOS6dNodePrime) +=
(ceqbd - cdreq + model->MOS6type * ceqgd);
m * (ceqbd - cdreq + model->MOS6type * ceqgd);
*(ckt->CKTrhs + here->MOS6sNodePrime) +=
cdreq + ceqbs + model->MOS6type * ceqgs;
m * (cdreq + ceqbs + model->MOS6type * ceqgs);
/*
* load y matrix
*/
*(here->MOS6DdPtr) += (here->MOS6drainConductance);
*(here->MOS6GgPtr) += ((gcgd+gcgs+gcgb));
*(here->MOS6SsPtr) += (here->MOS6sourceConductance);
*(here->MOS6BbPtr) += (here->MOS6gbd+here->MOS6gbs+gcgb);
*(here->MOS6DdPtr) += m * (here->MOS6drainConductance);
*(here->MOS6GgPtr) += m * ((gcgd+gcgs+gcgb));
*(here->MOS6SsPtr) += m * (here->MOS6sourceConductance);
*(here->MOS6BbPtr) += m * (here->MOS6gbd+here->MOS6gbs+gcgb);
*(here->MOS6DPdpPtr) +=
(here->MOS6drainConductance+here->MOS6gds+
m * (here->MOS6drainConductance+here->MOS6gds+
here->MOS6gbd+xrev*(here->MOS6gm+here->MOS6gmbs)+gcgd);
*(here->MOS6SPspPtr) +=
(here->MOS6sourceConductance+here->MOS6gds+
m * (here->MOS6sourceConductance+here->MOS6gds+
here->MOS6gbs+xnrm*(here->MOS6gm+here->MOS6gmbs)+gcgs);
*(here->MOS6DdpPtr) += (-here->MOS6drainConductance);
*(here->MOS6GbPtr) -= gcgb;
*(here->MOS6GdpPtr) -= gcgd;
*(here->MOS6GspPtr) -= gcgs;
*(here->MOS6SspPtr) += (-here->MOS6sourceConductance);
*(here->MOS6BgPtr) -= gcgb;
*(here->MOS6BdpPtr) -= here->MOS6gbd;
*(here->MOS6BspPtr) -= here->MOS6gbs;
*(here->MOS6DPdPtr) += (-here->MOS6drainConductance);
*(here->MOS6DPgPtr) += ((xnrm-xrev)*here->MOS6gm-gcgd);
*(here->MOS6DPbPtr) += (-here->MOS6gbd+(xnrm-xrev)*here->MOS6gmbs);
*(here->MOS6DPspPtr) += (-here->MOS6gds-xnrm*
*(here->MOS6DdpPtr) += m * (-here->MOS6drainConductance);
*(here->MOS6GbPtr) -= m * gcgb;
*(here->MOS6GdpPtr) -= m * gcgd;
*(here->MOS6GspPtr) -= m * gcgs;
*(here->MOS6SspPtr) += m * (-here->MOS6sourceConductance);
*(here->MOS6BgPtr) -= m * gcgb;
*(here->MOS6BdpPtr) -= m * (here->MOS6gbd);
*(here->MOS6BspPtr) -= m * (here->MOS6gbs);
*(here->MOS6DPdPtr) += m * (-here->MOS6drainConductance);
*(here->MOS6DPgPtr) += m * ((xnrm-xrev)*here->MOS6gm-gcgd);
*(here->MOS6DPbPtr) += m * (-here->MOS6gbd+(xnrm-xrev)*here->MOS6gmbs);
*(here->MOS6DPspPtr) += m * (-here->MOS6gds-xnrm*
(here->MOS6gm+here->MOS6gmbs));
*(here->MOS6SPgPtr) += (-(xnrm-xrev)*here->MOS6gm-gcgs);
*(here->MOS6SPsPtr) += (-here->MOS6sourceConductance);
*(here->MOS6SPbPtr) += (-here->MOS6gbs-(xnrm-xrev)*here->MOS6gmbs);
*(here->MOS6SPdpPtr) += (-here->MOS6gds-xrev*
*(here->MOS6SPgPtr) += m * (-(xnrm-xrev)*here->MOS6gm-gcgs);
*(here->MOS6SPsPtr) += m * (-here->MOS6sourceConductance);
*(here->MOS6SPbPtr) += m * (-here->MOS6gbs-(xnrm-xrev)*here->MOS6gmbs);
*(here->MOS6SPdpPtr) += m * (-here->MOS6gds-xrev*
(here->MOS6gm+here->MOS6gmbs));
}
}

8
src/spicelib/devices/mos6/mos6mask.c

@ -4,7 +4,6 @@ Author: 1989 Takayasu Sakurai
**********/
#include "ngspice.h"
#include <stdio.h>
#include "const.h"
#include "ifsim.h"
#include "mos6defs.h"
@ -12,11 +11,8 @@ Author: 1989 Takayasu Sakurai
#include "suffix.h"
int
MOS6mAsk(ckt,inModel,param,value)
CKTcircuit *ckt;
GENmodel *inModel;
int param;
IFvalue *value;
MOS6mAsk(CKTcircuit *ckt, GENmodel *inModel, int param,
IFvalue *value)
{
MOS6model *model = (MOS6model *)inModel;
switch(param) {

6
src/spicelib/devices/mos6/mos6mpar.c

@ -6,7 +6,6 @@ Author: 1989 Takayasu Sakurai
*/
#include "ngspice.h"
#include <stdio.h>
#include "const.h"
#include "ifsim.h"
#include "mos6defs.h"
@ -15,10 +14,7 @@ Author: 1989 Takayasu Sakurai
int
MOS6mParam(param,value,inModel)
int param;
IFvalue *value;
GENmodel *inModel;
MOS6mParam(int param, IFvalue *value, GENmodel *inModel)
{
MOS6model *model = (MOS6model *)inModel;
switch(param) {

15
src/spicelib/devices/mos6/mos6par.c

@ -6,7 +6,6 @@ Author: 1989 Takayasu Sakurai
*/
#include "ngspice.h"
#include <stdio.h>
#include "const.h"
#include "ifsim.h"
#include "mos6defs.h"
@ -16,11 +15,7 @@ Author: 1989 Takayasu Sakurai
/* ARGSUSED */
int
MOS6param(param,value,inst,select)
int param;
IFvalue *value;
GENinstance *inst;
IFvalue *select;
MOS6param(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
{
MOS6instance *here = (MOS6instance *)inst;
switch(param) {
@ -28,6 +23,10 @@ MOS6param(param,value,inst,select)
here->MOS6temp = value->rValue+CONSTCtoK;
here->MOS6tempGiven = TRUE;
break;
case MOS6_DTEMP:
here->MOS6dtemp = value->rValue;
here->MOS6dtempGiven = TRUE;
break;
case MOS6_W:
here->MOS6w = value->rValue;
here->MOS6wGiven = TRUE;
@ -36,6 +35,10 @@ MOS6param(param,value,inst,select)
here->MOS6l = value->rValue;
here->MOS6lGiven = TRUE;
break;
case MOS6_M:
here->MOS6m = value->rValue;
here->MOS6mGiven = TRUE;
break;
case MOS6_AS:
here->MOS6sourceArea = value->rValue;
here->MOS6sourceAreaGiven = TRUE;

15
src/spicelib/devices/mos6/mos6set.c

@ -9,7 +9,6 @@ Modified: 2000 AlansFixes
*/
#include "ngspice.h"
#include <stdio.h>
#include "smpdefs.h"
#include "cktdefs.h"
#include "mos6defs.h"
@ -17,11 +16,8 @@ Modified: 2000 AlansFixes
#include "suffix.h"
int
MOS6setup(matrix,inModel,ckt,states)
SMPmatrix *matrix;
GENmodel *inModel;
CKTcircuit *ckt;
int *states;
MOS6setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt,
int *states)
{
MOS6model *model = (MOS6model *)inModel;
MOS6instance *here;
@ -142,6 +138,9 @@ MOS6setup(matrix,inModel,ckt,states)
if(!here->MOS6vonGiven) {
here->MOS6von = 0;
}
if(!here->MOS6mGiven) {
here->MOS6m = 1;
}
/* allocate a chunk of the state vector */
@ -224,9 +223,7 @@ if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\
}
int
MOS6unsetup(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS6unsetup(GENmodel *inModel, CKTcircuit *ckt)
{
MOS6model *model;
MOS6instance *here;

13
src/spicelib/devices/mos6/mos6temp.c

@ -4,7 +4,6 @@ Author: 1989 Takayasu Sakurai
**********/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "mos6defs.h"
#include "const.h"
@ -12,9 +11,7 @@ Author: 1989 Takayasu Sakurai
#include "suffix.h"
int
MOS6temp(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS6temp(GENmodel *inModel, CKTcircuit *ckt)
{
MOS6model *model = (MOS6model *)inModel;
MOS6instance *here;
@ -123,11 +120,15 @@ MOS6temp(inModel,ckt)
double arg; /* 1 - fc */
double sarg; /* (1-fc) ^^ (-mj) */
double sargsw; /* (1-fc) ^^ (-mjsw) */
if (here->MOS6owner != ARCHme) continue;
if (here->MOS6owner != ARCHme) continue;
/* perform the parameter defaulting */
if(!here->MOS6dtempGiven) {
here->MOS6dtemp = 0.0;
}
if(!here->MOS6tempGiven) {
here->MOS6temp = ckt->CKTtemp;
here->MOS6temp = ckt->CKTtemp + here->MOS6dtemp;
}
vt = here->MOS6temp * CONSTKoverQ;
ratio = here->MOS6temp/model->MOS6tnom;

6
src/spicelib/devices/mos6/mos6trun.c

@ -6,7 +6,6 @@ Author: 1989 Takayasu Sakurai
*/
#include "ngspice.h"
#include <stdio.h>
#include "cktdefs.h"
#include "mos6defs.h"
#include "sperror.h"
@ -14,10 +13,7 @@ Author: 1989 Takayasu Sakurai
int
MOS6trunc(inModel,ckt,timeStep)
GENmodel *inModel;
CKTcircuit *ckt;
double *timeStep;
MOS6trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep)
{
MOS6model *model = (MOS6model *)inModel;
MOS6instance *here;

Loading…
Cancel
Save