Browse Source

Added "dtemp" and cleaned code.

pre-master-46
pnenzi 23 years ago
parent
commit
16e22904e0
  1. 1
      src/spicelib/devices/mos1/mos1.c
  2. 4
      src/spicelib/devices/mos1/mos1acld.c
  3. 13
      src/spicelib/devices/mos1/mos1ask.c
  4. 4
      src/spicelib/devices/mos1/mos1conv.c
  5. 3
      src/spicelib/devices/mos1/mos1defs.h
  6. 5
      src/spicelib/devices/mos1/mos1del.c
  7. 3
      src/spicelib/devices/mos1/mos1dest.c
  8. 5
      src/spicelib/devices/mos1/mos1dist.c
  9. 4
      src/spicelib/devices/mos1/mos1dset.c
  10. 27
      src/spicelib/devices/mos1/mos1ext.h
  11. 4
      src/spicelib/devices/mos1/mos1ic.c
  12. 4
      src/spicelib/devices/mos1/mos1load.c
  13. 6
      src/spicelib/devices/mos1/mos1mask.c
  14. 5
      src/spicelib/devices/mos1/mos1mdel.c
  15. 7
      src/spicelib/devices/mos1/mos1mpar.c
  16. 9
      src/spicelib/devices/mos1/mos1noi.c
  17. 10
      src/spicelib/devices/mos1/mos1par.c
  18. 7
      src/spicelib/devices/mos1/mos1pzld.c
  19. 6
      src/spicelib/devices/mos1/mos1sacl.c
  20. 11
      src/spicelib/devices/mos1/mos1set.c
  21. 6
      src/spicelib/devices/mos1/mos1sld.c
  22. 6
      src/spicelib/devices/mos1/mos1sprt.c
  23. 6
      src/spicelib/devices/mos1/mos1sset.c
  24. 6
      src/spicelib/devices/mos1/mos1supd.c
  25. 10
      src/spicelib/devices/mos1/mos1temp.c
  26. 5
      src/spicelib/devices/mos1/mos1trun.c

1
src/spicelib/devices/mos1/mos1.c

@ -25,6 +25,7 @@ IFparm MOS1pTable[] = { /* parameters */
IOPU("icvgs", MOS1_IC_VGS, IF_REAL , "Initial G-S voltage"),
IOPU("icvbs", MOS1_IC_VBS, IF_REAL , "Initial B-S voltage"),
IOPU("temp", MOS1_TEMP, IF_REAL, "Instance temperature"),
IOPU("dtemp", MOS1_DTEMP, IF_REAL, "Instance temperature difference"),
IP( "ic", MOS1_IC, IF_REALVEC, "Vector of D-S, G-S, B-S voltages"),
IP( "sens_l", MOS1_L_SENS, IF_FLAG, "flag to request sensitivity WRT length"),
IP( "sens_w", MOS1_W_SENS, IF_FLAG, "flag to request sensitivity WRT width"),

4
src/spicelib/devices/mos1/mos1acld.c

@ -14,9 +14,7 @@ Modified: 2000 AlansFixes
int
MOS1acLoad(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS1acLoad(GENmodel *inModel, CKTcircuit *ckt)
{
MOS1model *model = (MOS1model*)inModel;
MOS1instance *here;

13
src/spicelib/devices/mos1/mos1ask.c

@ -15,12 +15,8 @@ Modified: 2000 AlansFixes
/*ARGSUSED*/
int
MOS1ask(ckt,inst,which,value,select)
CKTcircuit *ckt;
GENinstance *inst;
int which;
IFvalue *value;
IFvalue *select;
MOS1ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
IFvalue *select)
{
MOS1instance *here = (MOS1instance*)inst;
double vr;
@ -31,7 +27,10 @@ MOS1ask(ckt,inst,which,value,select)
static char *msg = "Current and power not available for ac analysis";
switch(which) {
case MOS1_TEMP:
value->rValue = here->MOS1temp-CONSTCtoK;
value->rValue = here->MOS1temp - CONSTCtoK;
return(OK);
case MOS1_DTEMP:
value->rValue = here->MOS1dtemp;
return(OK);
case MOS1_CGS:
value->rValue = 2* *(ckt->CKTstate0 + here->MOS1capgs);

4
src/spicelib/devices/mos1/mos1conv.c

@ -10,9 +10,7 @@ Author: 1985 Thomas L. Quarles
#include "suffix.h"
int
MOS1convTest(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS1convTest(GENmodel *inModel, CKTcircuit *ckt)
{
MOS1model *model = (MOS1model*)inModel;
MOS1instance *here;

3
src/spicelib/devices/mos1/mos1defs.h

@ -45,6 +45,7 @@ typedef struct sMOS1instance {
double MOS1sourceConductance; /*conductance of source(or 0):set in setup*/
double MOS1drainConductance; /*conductance of drain(or 0):set in setup*/
double MOS1temp; /* operating temperature of this instance */
double MOS1dtemp; /* operating temperature of the instance relative to circuit temperature*/
double MOS1tTransconductance; /* temperature corrected transconductance*/
double MOS1tSurfMob; /* temperature corrected surface mobility */
@ -159,6 +160,7 @@ typedef struct sMOS1instance {
unsigned MOS1off:1; /* non-zero to indicate device is off for dc analysis*/
unsigned MOS1tempGiven :1; /* instance temperature specified */
unsigned MOS1dtempGiven :1; /* instance delta temperature specified */
unsigned MOS1mGiven :1;
unsigned MOS1lGiven :1;
unsigned MOS1wGiven :1;
@ -411,6 +413,7 @@ typedef struct sMOS1model { /* model structure for a resistor */
#define MOS1_POWER 19
#define MOS1_TEMP 20
#define MOS1_M 21
#define MOS1_DTEMP 22
/* model paramerers */
#define MOS1_MOD_VTO 101
#define MOS1_MOD_KP 102

5
src/spicelib/devices/mos1/mos1del.c

@ -12,10 +12,7 @@ Author: 1985 Thomas L. Quarles
int
MOS1delete(inModel,name,inst)
GENmodel *inModel;
IFuid name;
GENinstance **inst;
MOS1delete(GENmodel *inModel, IFuid name, GENinstance **inst)
{
MOS1model *model = (MOS1model *)inModel;
MOS1instance **fast = (MOS1instance **)inst;

3
src/spicelib/devices/mos1/mos1dest.c

@ -11,8 +11,7 @@ Author: 1985 Thomas L. Quarles
void
MOS1destroy(inModel)
GENmodel **inModel;
MOS1destroy(GENmodel **inModel)
{
MOS1model **model = (MOS1model**)inModel;
MOS1instance *here;

5
src/spicelib/devices/mos1/mos1dist.c

@ -11,10 +11,7 @@ Author: 1988 Jaijeet S Roychowdhury
#include "suffix.h"
int
MOS1disto(mode,genmodel,ckt)
GENmodel *genmodel;
CKTcircuit *ckt;
int mode;
MOS1disto(int mode, GENmodel *genmodel, CKTcircuit *ckt)
/* assuming here that ckt->CKTomega has been initialised to
* the correct value

4
src/spicelib/devices/mos1/mos1dset.c

@ -13,9 +13,7 @@ Author: 1988 Jaijeet S Roychowdhury
#include "suffix.h"
int
MOS1dSetup(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS1dSetup(GENmodel *inModel, CKTcircuit *ckt)
/* actually load the current value into the
* sparse matrix previously provided
*/

27
src/spicelib/devices/mos1/mos1ext.h

@ -4,7 +4,6 @@ Author: 1985 Thomas L. Quarles
Modified: 2000 AlansFixes
**********/
#ifdef __STDC__
extern int MOS1acLoad(GENmodel *,CKTcircuit*);
extern int MOS1ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*);
extern int MOS1delete(GENmodel*,IFuid,GENinstance**);
@ -29,29 +28,3 @@ extern int MOS1convTest(GENmodel*,CKTcircuit*);
extern int MOS1disto(int,GENmodel*,CKTcircuit*);
extern int MOS1noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
extern int MOS1dSetup(GENmodel*,CKTcircuit*);
#else /* stdc */
extern int MOS1acLoad();
extern int MOS1ask();
extern int MOS1delete();
extern void MOS1destroy();
extern int MOS1getic();
extern int MOS1load();
extern int MOS1mAsk();
extern int MOS1mDelete();
extern int MOS1mParam();
extern int MOS1param();
extern int MOS1pzLoad();
extern int MOS1sAcLoad();
extern int MOS1sLoad();
extern void MOS1sPrint();
extern int MOS1sSetup();
extern int MOS1sUpdate();
extern int MOS1setup();
extern int MOS1unsetup();
extern int MOS1temp();
extern int MOS1trunc();
extern int MOS1convTest();
extern int MOS1disto();
extern int MOS1noise();
#endif /* stdc */

4
src/spicelib/devices/mos1/mos1ic.c

@ -13,9 +13,7 @@ Author: 1985 Thomas L. Quarles
int
MOS1getic(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS1getic(GENmodel *inModel, CKTcircuit *ckt)
{
MOS1model *model = (MOS1model *)inModel;
MOS1instance *here;

4
src/spicelib/devices/mos1/mos1load.c

@ -14,9 +14,7 @@ Modified: 2000 AlansFixes
#include "suffix.h"
int
MOS1load(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS1load(GENmodel *inModel, CKTcircuit *ckt)
/* actually load the current value into the
* sparse matrix previously provided
*/

6
src/spicelib/devices/mos1/mos1mask.c

@ -14,11 +14,7 @@ Author: 1987 Thomas L. Quarles
/*ARGSUSED*/
int
MOS1mAsk(ckt,inst,which,value)
CKTcircuit *ckt;
GENmodel *inst;
int which;
IFvalue *value;
MOS1mAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
{
MOS1model *model = (MOS1model *)inst;
switch(which) {

5
src/spicelib/devices/mos1/mos1mdel.c

@ -12,10 +12,7 @@ Author: 1985 Thomas L. Quarles
int
MOS1mDelete(inModel,modname,kill)
GENmodel **inModel;
IFuid modname;
GENmodel *kill;
MOS1mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill)
{
MOS1model **model = (MOS1model **)inModel;
MOS1model *modfast = (MOS1model *)kill;

7
src/spicelib/devices/mos1/mos1mpar.c

@ -11,15 +11,12 @@ Author: 1985 Thomas L. Quarles
#include "suffix.h"
int
MOS1mParam(param,value,inModel)
int param;
IFvalue *value;
GENmodel *inModel;
MOS1mParam(int param, IFvalue *value, GENmodel *inModel)
{
MOS1model *model = (MOS1model *)inModel;
switch(param) {
case MOS1_MOD_TNOM:
model->MOS1tnom = value->rValue+CONSTCtoK;
model->MOS1tnom = value->rValue + CONSTCtoK;
model->MOS1tnomGiven = TRUE;
break;
case MOS1_MOD_VTO:

9
src/spicelib/devices/mos1/mos1noi.c

@ -24,13 +24,8 @@ extern void NevalSrc();
extern double Nintegrate();
int
MOS1noise (mode, operation, genmodel, ckt, data, OnDens)
int mode;
int operation;
GENmodel *genmodel;
CKTcircuit *ckt;
Ndata *data;
double *OnDens;
MOS1noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt,
Ndata *data, double *OnDens)
{
MOS1model *firstModel = (MOS1model *) genmodel;
MOS1model *model;

10
src/spicelib/devices/mos1/mos1par.c

@ -16,11 +16,7 @@ Modified: 2000 AlansFixes
/* ARGSUSED */
int
MOS1param(param,value,inst,select)
int param;
IFvalue *value;
GENinstance *inst;
IFvalue *select;
MOS1param(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
{
MOS1instance *here = (MOS1instance *)inst;
switch(param) {
@ -28,6 +24,10 @@ MOS1param(param,value,inst,select)
here->MOS1temp = value->rValue+CONSTCtoK;
here->MOS1tempGiven = TRUE;
break;
case MOS1_DTEMP:
here->MOS1dtemp = value->rValue;
here->MOS1dtempGiven = TRUE;
break;
case MOS1_M:
here->MOS1m = value->rValue;
here->MOS1mGiven = TRUE;

7
src/spicelib/devices/mos1/mos1pzld.c

@ -15,10 +15,7 @@ Modified: 2000 AlansFixes
int
MOS1pzLoad(inModel,ckt,s)
GENmodel *inModel;
CKTcircuit *ckt;
SPcomplex *s;
MOS1pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
{
MOS1model *model = (MOS1model*)inModel;
MOS1instance *here;
@ -72,7 +69,7 @@ MOS1pzLoad(inModel,ckt,s)
xgb = capgb;
xbd = here->MOS1capbd;
xbs = here->MOS1capbs;
/*printf("mos2: xgs=%g, xgd=%g, xgb=%g, xbd=%g, xbs=%g\n",
/*printf("mos1: xgs=%g, xgd=%g, xgb=%g, xbd=%g, xbs=%g\n",
xgs,xgd,xgb,xbd,xbs);*/
/*
* load matrix

6
src/spicelib/devices/mos1/mos1sacl.c

@ -1,6 +1,8 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
This function is obsolete (was used by an old sensitivity analysis)
**********/
#include "ngspice.h"
@ -16,9 +18,7 @@ Author: 1985 Thomas L. Quarles
*/
int
MOS1sAcLoad(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS1sAcLoad(GENmodel *inModel, CKTcircuit *ckt)
{
MOS1model *model = (MOS1model*)inModel;
MOS1instance *here;

11
src/spicelib/devices/mos1/mos1set.c

@ -16,11 +16,8 @@ Modified: 2000 AlansFixes
#include "suffix.h"
int
MOS1setup(matrix,inModel,ckt,states)
SMPmatrix *matrix;
GENmodel *inModel;
CKTcircuit *ckt;
int *states;
MOS1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt,
int *states)
{
MOS1model *model = (MOS1model *)inModel;
MOS1instance *here;
@ -214,9 +211,7 @@ if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\
}
int
MOS1unsetup(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS1unsetup(GENmodel *inModel, CKTcircuit *ckt)
{
MOS1model *model;
MOS1instance *here;

6
src/spicelib/devices/mos1/mos1sld.c

@ -1,6 +1,8 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
This function is obsolete (was used by an old sensitivity analysis)
**********/
/* actually load the current sensitivity
@ -15,9 +17,7 @@ Author: 1985 Thomas L. Quarles
#include "suffix.h"
int
MOS1sLoad(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS1sLoad(GENmodel *inModel, CKTcircuit *ckt)
{
MOS1model *model = (MOS1model *)inModel;
MOS1instance *here;

6
src/spicelib/devices/mos1/mos1sprt.c

@ -2,6 +2,8 @@
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
Modified: 2000 AlansFixes
This function is obsolete (was used by an old sensitivity analysis)
**********/
/* Pretty print the sensitivity info for all
@ -16,9 +18,7 @@ Modified: 2000 AlansFixes
#include "suffix.h"
void
MOS1sPrint(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS1sPrint(GENmodel *inModel, CKTcircuit *ckt)
/* Pretty print the sensitivity info for all the MOS1
* devices in the circuit.
*/

6
src/spicelib/devices/mos1/mos1sset.c

@ -1,6 +1,8 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
This function is obsolete (was used by an old sensitivity analysis)
**********/
#include "ngspice.h"
@ -11,9 +13,7 @@ Author: 1985 Thomas L. Quarles
#include "suffix.h"
int
MOS1sSetup(info,inModel)
SENstruct *info;
GENmodel *inModel;
MOS1sSetup(SENstruct *info, GENmodel *inModel)
/* loop through all the devices and
* allocate parameter #s to design parameters
*/

6
src/spicelib/devices/mos1/mos1supd.c

@ -1,6 +1,8 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
This function is obsolete (was used by an old sensitivity analysis)
**********/
#include "ngspice.h"
@ -13,9 +15,7 @@ Author: 1985 Thomas L. Quarles
/* update the charge sensitivities and their derivatives */
int
MOS1sUpdate(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS1sUpdate(GENmodel *inModel, CKTcircuit *ckt)
{
MOS1model *model = (MOS1model *)inModel;
MOS1instance *here;

10
src/spicelib/devices/mos1/mos1temp.c

@ -12,9 +12,7 @@ Modified: 2000 AlansFixes
#include "suffix.h"
int
MOS1temp(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
MOS1temp(GENmodel *inModel, CKTcircuit *ckt)
{
MOS1model *model = (MOS1model *)inModel;
MOS1instance *here;
@ -122,8 +120,12 @@ MOS1temp(inModel,ckt)
if (here->MOS1owner != ARCHme) continue;
/* perform the parameter defaulting */
if(!here->MOS1dtempGiven) {
here->MOS1dtemp = 0.0;
}
if(!here->MOS1tempGiven) {
here->MOS1temp = ckt->CKTtemp;
here->MOS1temp = ckt->CKTtemp + here->MOS1dtemp;
}
vt = here->MOS1temp * CONSTKoverQ;
ratio = here->MOS1temp/model->MOS1tnom;

5
src/spicelib/devices/mos1/mos1trun.c

@ -13,10 +13,7 @@ Author: 1985 Thomas L. Quarles
int
MOS1trunc(inModel,ckt,timeStep)
GENmodel *inModel;
CKTcircuit *ckt;
double *timeStep;
MOS1trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep)
{
MOS1model *model = (MOS1model *)inModel;
MOS1instance *here;

Loading…
Cancel
Save