From 0a1a142023a8ad39dc01b5d5d847a6ea132ee1a2 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sat, 2 Oct 2010 10:14:55 +0000 Subject: [PATCH] NAN in parameter output removed --- ChangeLog | 7 ++++++- src/spicelib/devices/jfet/jfetmask.c | 6 ++++++ src/spicelib/devices/mesa/mesadefs.h | 5 ++++- src/spicelib/devices/mesa/mesamask.c | 17 +++++++++++++---- src/spicelib/devices/mesa/mesamparam.c | 3 +++ src/spicelib/devices/mesa/mesasetup.c | 18 +++++++++++++++++- 6 files changed, 49 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae8e83e9b..7048b6a30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +============================ Rework-22 ================================== + +2010-09-26 Holger Vogt + * mesadefs.h, mesamsak.c, mesamparam.c, mesasetup.c + jfetmask.c: remove NAN or exp -312 outputs + 2010-10-01 Robert Larice * src/spicelib/devices/hfet1/hfetmask.c , * src/spicelib/devices/hfet2/hfet2mask.c , @@ -24,7 +30,6 @@ this works around a bug as well, which caused erronous lexer c files to be included in the distribution tar ball -============================ Rework-22 ================================== 2010-09-26 Holger Vogt * .cvsignore: m4 entry removed diff --git a/src/spicelib/devices/jfet/jfetmask.c b/src/spicelib/devices/jfet/jfetmask.c index 6e1afa5a4..70198e576 100644 --- a/src/spicelib/devices/jfet/jfetmask.c +++ b/src/spicelib/devices/jfet/jfetmask.c @@ -68,6 +68,12 @@ JFETmAsk(CKTcircuit *ckt, GENmodel *inModel, int which, IFvalue *value) case JFET_MOD_SOURCECONDUCT: value->rValue = model->JFETsourceConduct; return(OK); + case JFET_MOD_KF: + value->rValue = model->JFETfNcoef; + return(OK); + case JFET_MOD_AF: + value->rValue = model->JFETfNexp; + return(OK); case JFET_MOD_TYPE: if (model->JFETtype == NJF) value->sValue = "njf"; diff --git a/src/spicelib/devices/mesa/mesadefs.h b/src/spicelib/devices/mesa/mesadefs.h index 81c2e9809..0d326dceb 100644 --- a/src/spicelib/devices/mesa/mesadefs.h +++ b/src/spicelib/devices/mesa/mesadefs.h @@ -250,6 +250,8 @@ typedef struct sMESAmodel { /* model structure for a MESAfet */ double MESArsi; double MESAdrainResist; double MESAsourceResist; + double MESAdrainConduct; + double MESAsourceConduct; double MESAgateResist; double MESAri; double MESArf; @@ -284,7 +286,8 @@ typedef struct sMESAmodel { /* model structure for a MESAfet */ double MESAepsi; double MESAcbs; double MESAcas; - + double MESAvcrit; + double MESAsigma; double MESAvpo; double MESAvpou; diff --git a/src/spicelib/devices/mesa/mesamask.c b/src/spicelib/devices/mesa/mesamask.c index 919c883cf..6ddec8c93 100644 --- a/src/spicelib/devices/mesa/mesamask.c +++ b/src/spicelib/devices/mesa/mesamask.c @@ -206,12 +206,21 @@ MESAmAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value) case MESA_MOD_CAS: value->rValue = here->MESAcas; return (OK); - case MESA_MOD_TYPE: - if (here->MESAtype == NMF) + case MESA_MOD_TYPE: + if (here->MESAtype == NMF) value->sValue = "nmf"; - else + else value->sValue = "pmf"; - return (OK); + return (OK); + case MESA_MOD_DRAINCONDUCT: + value->rValue = here->MESAdrainConduct; + return (OK); + case MESA_MOD_SOURCECONDUCT: + value->rValue = here->MESAsourceConduct; + return (OK); + case MESA_MOD_VCRIT: + value->rValue = here->MESAvcrit; + return (OK); default: return (E_BADPARM); } diff --git a/src/spicelib/devices/mesa/mesamparam.c b/src/spicelib/devices/mesa/mesamparam.c index d02d760c0..babcfab4d 100644 --- a/src/spicelib/devices/mesa/mesamparam.c +++ b/src/spicelib/devices/mesa/mesamparam.c @@ -165,6 +165,9 @@ MESAmParam(int param, IFvalue *value, GENmodel *inModel) model->MESAtc = value->rValue; break; case MESA_MOD_NMF: + if(value->iValue) { + model->MESAtype = NMF; + } break; case MESA_MOD_TVTO: model->MESAtvtoGiven = TRUE; diff --git a/src/spicelib/devices/mesa/mesasetup.c b/src/spicelib/devices/mesa/mesasetup.c index dfc0e628e..b5208c414 100644 --- a/src/spicelib/devices/mesa/mesasetup.c +++ b/src/spicelib/devices/mesa/mesasetup.c @@ -28,6 +28,9 @@ MESAsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /* loop through all the diode models */ for( ; model != NULL; model = model->MESAnextModel ) { + if( (model->MESAtype != NMF) ) { + model->MESAtype = NMF; + } if(!model->MESAthresholdGiven) { model->MESAthreshold = -1.26; } @@ -207,7 +210,20 @@ MESAsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } if(!model->MESAcbsGiven) { model->MESAcbs = 1; - } + } + + if(model->MESAdrainResist != 0) { + model->MESAdrainConduct = 1./model->MESAdrainResist; + } else { + model->MESAdrainConduct = 0.; + } + if(model->MESAsourceResist != 0) { + model->MESAsourceConduct = 1./model->MESAsourceResist; + } else { + model->MESAsourceConduct = 0.; + } + + model->MESAvcrit = 0.; /* until model has changed */ /* loop through all the instances of the model */ for (here = model->MESAinstances; here != NULL ;