Added "m" and "dtemp" and pole-zero analysis. Updated DEVICES.
This commit is contained in:
parent
d0d274f49f
commit
42edf017c8
|
|
@ -1,6 +1,9 @@
|
|||
2003-12-30 Paolo Nenzi <p.nenzi@ieee.org>
|
||||
|
||||
* src/spicelib/devices/jfet/jfetpzld.c: gspr and gdpr were initialized
|
||||
* src/spicelibe/devices/hfet2/*: Added parallel multipler and "dtemp"
|
||||
parameters. Added pole-zero analysis and parallel code switches.
|
||||
|
||||
* src/spicelib/devices/jfet/jfetpzld.c: gspr and gdpr were initialized
|
||||
with Resist and not Conduct, corrected!
|
||||
|
||||
* src/spicelib/devices/hfet1/*: Added parallel multiplier and "dtemp" to
|
||||
|
|
|
|||
16
DEVICES
16
DEVICES
|
|
@ -222,9 +222,19 @@ HFET - HFET Level 1 (Ytterdal)
|
|||
- Added pole-zero analysis
|
||||
|
||||
|
||||
HFET2 - HFET Level 2
|
||||
Initial release.
|
||||
|
||||
HFET2 - HFET Level 2 (Ytterdal)
|
||||
Initial Release.
|
||||
Ver: N/A
|
||||
Class: Z
|
||||
Level: 6
|
||||
Status:
|
||||
|
||||
|
||||
Enhancements over the original model:
|
||||
|
||||
- Parallel multiplier
|
||||
- Instance temperature as difference for circuit temperature
|
||||
- Added pole-zero analysis
|
||||
|
||||
***************************************************************************
|
||||
*************************** MES devices ***************************
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ libhfet2_a_SOURCES = \
|
|||
hfet2mdel.c \
|
||||
hfet2mpar.c \
|
||||
hfet2param.c \
|
||||
hfet2pzl.c \
|
||||
hfet2setup.c \
|
||||
hfet2temp.c \
|
||||
hfet2trunc.c
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
/**********
|
||||
Imported from MacSpice3f4 - Antony Wilson
|
||||
Modified: Paolo Nenzi
|
||||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "ifsim.h"
|
||||
#include "devdefs.h"
|
||||
#include "hfet2defs.h"
|
||||
|
|
@ -8,32 +11,34 @@
|
|||
|
||||
|
||||
IFparm HFET2pTable[] = { /* parameters */
|
||||
OP("off", HFET2_OFF, IF_FLAG ,""),
|
||||
IOP("l", HFET2_LENGTH, IF_REAL ,""),
|
||||
IOP("w", HFET2_WIDTH, IF_REAL ,""),
|
||||
IOP("icvds", HFET2_IC_VDS, IF_REAL ,""),
|
||||
IOP("icvgs", HFET2_IC_VGS, IF_REAL ,""),
|
||||
IOP("temp", HFET2_TEMP, IF_REAL ,""),
|
||||
OP("dnode", HFET2_DRAINNODE, IF_INTEGER ,""),
|
||||
OP("gnode", HFET2_GATENODE, IF_INTEGER ,""),
|
||||
OP("snode", HFET2_SOURCENODE, IF_INTEGER ,""),
|
||||
OP("dprimenode",HFET2_DRAINPRIMENODE, IF_INTEGER ,""),
|
||||
OP("sprimenode",HFET2_SOURCEPRIMENODE,IF_INTEGER ,""),
|
||||
OP("vgs", HFET2_VGS, IF_REAL ,""),
|
||||
OP("vgd", HFET2_VGD, IF_REAL ,""),
|
||||
OP("cg", HFET2_CG, IF_REAL ,""),
|
||||
OP("cd", HFET2_CD, IF_REAL ,""),
|
||||
OP("cgd", HFET2_CGD, IF_REAL ,""),
|
||||
OP("gm", HFET2_GM, IF_REAL ,""),
|
||||
OP("gds", HFET2_GDS, IF_REAL ,""),
|
||||
OP("ggs", HFET2_GGS, IF_REAL ,""),
|
||||
OP("ggd", HFET2_GGD, IF_REAL ,""),
|
||||
OP("qgs", HFET2_QGS, IF_REAL ,""),
|
||||
OP("cqgs", HFET2_CQGS, IF_REAL ,""),
|
||||
OP("qgd", HFET2_QGD, IF_REAL ,""),
|
||||
OP("cqgd", HFET2_CQGD, IF_REAL ,""),
|
||||
OP("cs", HFET2_CS, IF_REAL ,""),
|
||||
OP("p", HFET2_POWER, IF_REAL ,"")
|
||||
OP("off", HFET2_OFF, IF_FLAG ,"Device initialli OFF"),
|
||||
IOP("l", HFET2_LENGTH, IF_REAL ,"Length of device"),
|
||||
IOP("w", HFET2_WIDTH, IF_REAL ,"Width of device"),
|
||||
IOP("m", HFET2_M, IF_REAL ,"Parallel Multiplier"),
|
||||
IOP("icvds", HFET2_IC_VDS, IF_REAL ,"Initial D-S voltage"),
|
||||
IOP("icvgs", HFET2_IC_VGS, IF_REAL ,"Initial G-S voltage"),
|
||||
IOP("temp", HFET2_TEMP, IF_REAL ,"Instance temperature"),
|
||||
IOP("dtemp", HFET2_DTEMP, IF_REAL ,"Instance temperature difference"),
|
||||
OP("dnode", HFET2_DRAINNODE, IF_INTEGER ,"Number of drain node"),
|
||||
OP("gnode", HFET2_GATENODE, IF_INTEGER ,"Number of gate node"),
|
||||
OP("snode", HFET2_SOURCENODE, IF_INTEGER ,"Number of source node"),
|
||||
OP("dprimenode",HFET2_DRAINPRIMENODE, IF_INTEGER ,"Number of internal drain node"),
|
||||
OP("sprimenode",HFET2_SOURCEPRIMENODE,IF_INTEGER ,"Number of internal source node"),
|
||||
OP("vgs", HFET2_VGS, IF_REAL ,"Gate-Source voltage"),
|
||||
OP("vgd", HFET2_VGD, IF_REAL ,"Gate-Drain voltage"),
|
||||
OP("cg", HFET2_CG, IF_REAL ,"Gate capacitance"),
|
||||
OP("cd", HFET2_CD, IF_REAL ,"Drain capacitance"),
|
||||
OP("cgd", HFET2_CGD, IF_REAL ,"Gate_Drain capacitance"),
|
||||
OP("gm", HFET2_GM, IF_REAL ,"Transconductance"),
|
||||
OP("gds", HFET2_GDS, IF_REAL ,"Drain-Source conductance"),
|
||||
OP("ggs", HFET2_GGS, IF_REAL ,"Gate-Source conductance"),
|
||||
OP("ggd", HFET2_GGD, IF_REAL ,"Gate-Drain conductance"),
|
||||
OP("qgs", HFET2_QGS, IF_REAL ,"Gate-Source charge storage"),
|
||||
OP("cqgs", HFET2_CQGS, IF_REAL ,"Capacitance due to gate-source charge storage"),
|
||||
OP("qgd", HFET2_QGD, IF_REAL ,"Gate-Drain charge storage"),
|
||||
OP("cqgd", HFET2_CQGD, IF_REAL ,"Capacitance due to gate-drain charge storage"),
|
||||
OP("cs", HFET2_CS, IF_REAL ,"Source current"),
|
||||
OP("p", HFET2_POWER, IF_REAL ,"Power dissipated by the mesfet")
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -74,10 +79,10 @@ IFparm HFET2mPTable[] = { /* model parameters */
|
|||
IOP( "vs", HFET2_MOD_VS, IF_REAL,"Saturation velocity"),
|
||||
IOP( "vsigma", HFET2_MOD_VSIGMA, IF_REAL,""),
|
||||
IOP( "vsigmat", HFET2_MOD_VSIGMAT, IF_REAL,""),
|
||||
IOP( "vt0", HFET2_MOD_VTO, IF_REAL,""),
|
||||
IOP( "vt0", HFET2_MOD_VTO, IF_REAL,"Pinch-off voltage"),
|
||||
IOP( "vt1", HFET2_MOD_VT1, IF_REAL,""),
|
||||
IOP( "vt2", HFET2_MOD_VT2, IF_REAL,""),
|
||||
IOP( "vto", HFET2_MOD_VTO, IF_REAL,"")
|
||||
IOP( "vto", HFET2_MOD_VTO, IF_REAL,"Pinch-off voltage")
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
/**********
|
||||
Imported from MacSpice3f4 - Antony Wilson
|
||||
Modified: Paolo Nenzi
|
||||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "hfet2defs.h"
|
||||
#include "sperror.h"
|
||||
#include "suffix.h"
|
||||
|
||||
|
||||
int HFET2acLoad(inModel, ckt)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
int HFET2acLoad(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
|
||||
HFET2model *model = (HFET2model*)inModel;
|
||||
|
|
@ -23,10 +24,17 @@ CKTcircuit *ckt;
|
|||
double ggd;
|
||||
double xgd;
|
||||
|
||||
double m;
|
||||
|
||||
for( ; model != NULL; model = model->HFET2nextModel )
|
||||
{
|
||||
for( here = model->HFET2instances; here != NULL; here = here->HFET2nextInstance)
|
||||
{
|
||||
for( here = model->HFET2instances; here != NULL;
|
||||
here = here->HFET2nextInstance) {
|
||||
|
||||
if (here->HFET2owner != ARCHme) continue;
|
||||
|
||||
m = here->HFET2m;
|
||||
|
||||
gdpr=model->HFET2drainConduct;
|
||||
gspr=model->HFET2sourceConduct;
|
||||
gm= *(ckt->CKTstate0 + here->HFET2gm) ;
|
||||
|
|
@ -35,28 +43,29 @@ CKTcircuit *ckt;
|
|||
xgs= *(ckt->CKTstate0 + here->HFET2qgs) * ckt->CKTomega ;
|
||||
ggd= *(ckt->CKTstate0 + here->HFET2ggd) ;
|
||||
xgd= *(ckt->CKTstate0 + here->HFET2qgd) * ckt->CKTomega ;
|
||||
*(here->HFET2drainDrainPtr ) += gdpr;
|
||||
*(here->HFET2gateGatePtr ) += ggd+ggs;
|
||||
*(here->HFET2gateGatePtr +1) += xgd+xgs;
|
||||
*(here->HFET2sourceSourcePtr ) += gspr;
|
||||
*(here->HFET2drainPrimeDrainPrimePtr ) += gdpr+gds+ggd;
|
||||
*(here->HFET2drainPrimeDrainPrimePtr +1) += xgd;
|
||||
*(here->HFET2sourcePriHFET2ourcePrimePtr ) += gspr+gds+gm+ggs;
|
||||
*(here->HFET2sourcePriHFET2ourcePrimePtr +1) += xgs;
|
||||
*(here->HFET2drainDrainPrimePtr ) -= gdpr;
|
||||
*(here->HFET2gateDrainPrimePtr ) -= ggd;
|
||||
*(here->HFET2gateDrainPrimePtr +1) -= xgd;
|
||||
*(here->HFET2gateSourcePrimePtr ) -= ggs;
|
||||
*(here->HFET2gateSourcePrimePtr +1) -= xgs;
|
||||
*(here->HFET2sourceSourcePrimePtr ) -= gspr;
|
||||
*(here->HFET2drainPrimeDrainPtr ) -= gdpr;
|
||||
*(here->HFET2drainPrimeGatePtr ) += (-ggd+gm);
|
||||
*(here->HFET2drainPrimeGatePtr +1) -= xgd;
|
||||
*(here->HFET2drainPriHFET2ourcePrimePtr ) += (-gds-gm);
|
||||
*(here->HFET2sourcePrimeGatePtr ) += (-ggs-gm);
|
||||
*(here->HFET2sourcePrimeGatePtr +1) -= xgs;
|
||||
*(here->HFET2sourcePriHFET2ourcePtr ) -= gspr;
|
||||
*(here->HFET2sourcePrimeDrainPrimePtr ) -= gds;
|
||||
|
||||
*(here->HFET2drainDrainPtr ) += m * (gdpr);
|
||||
*(here->HFET2gateGatePtr ) += m * (ggd+ggs);
|
||||
*(here->HFET2gateGatePtr +1) += m * (xgd+xgs);
|
||||
*(here->HFET2sourceSourcePtr ) += m * (gspr);
|
||||
*(here->HFET2drainPrimeDrainPrimePtr ) += m * (gdpr+gds+ggd);
|
||||
*(here->HFET2drainPrimeDrainPrimePtr +1) += m * (xgd);
|
||||
*(here->HFET2sourcePriHFET2ourcePrimePtr ) += m * (gspr+gds+gm+ggs);
|
||||
*(here->HFET2sourcePriHFET2ourcePrimePtr +1) += m * (xgs);
|
||||
*(here->HFET2drainDrainPrimePtr ) -= m * (gdpr);
|
||||
*(here->HFET2gateDrainPrimePtr ) -= m * (ggd);
|
||||
*(here->HFET2gateDrainPrimePtr +1) -= m * (xgd);
|
||||
*(here->HFET2gateSourcePrimePtr ) -= m * (ggs);
|
||||
*(here->HFET2gateSourcePrimePtr +1) -= m * (xgs);
|
||||
*(here->HFET2sourceSourcePrimePtr ) -= m * (gspr);
|
||||
*(here->HFET2drainPrimeDrainPtr ) -= m * (gdpr);
|
||||
*(here->HFET2drainPrimeGatePtr ) += m * (-ggd+gm);
|
||||
*(here->HFET2drainPrimeGatePtr +1) -= m * (xgd);
|
||||
*(here->HFET2drainPriHFET2ourcePrimePtr ) += m * (-gds-gm);
|
||||
*(here->HFET2sourcePrimeGatePtr ) += m * (-ggs-gm);
|
||||
*(here->HFET2sourcePrimeGatePtr +1) -= m * (xgs);
|
||||
*(here->HFET2sourcePriHFET2ourcePtr ) -= m * (gspr);
|
||||
*(here->HFET2sourcePrimeDrainPrimePtr ) -= m * (gds);
|
||||
}
|
||||
}
|
||||
return(OK);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ Imported into HFET2 source: Paolo Nenzi 2001
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "devdefs.h"
|
||||
#include "ifsim.h"
|
||||
|
|
@ -18,12 +17,8 @@ Imported into HFET2 source: Paolo Nenzi 2001
|
|||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
HFET2ask(ckt,inst,which,value,select)
|
||||
CKTcircuit *ckt;
|
||||
GENinstance *inst;
|
||||
int which;
|
||||
IFvalue *value;
|
||||
IFvalue *select;
|
||||
HFET2ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
|
||||
IFvalue *select)
|
||||
{
|
||||
HFET2instance *here = (HFET2instance*)inst;
|
||||
static char *msg = "Current and power not available in ac analysis";
|
||||
|
|
@ -32,7 +27,8 @@ HFET2ask(ckt,inst,which,value,select)
|
|||
value->rValue = here->HFET2length;
|
||||
return (OK);
|
||||
case HFET2_WIDTH:
|
||||
value->rValue = here->HFET2width;
|
||||
value->rValue = here->HFET2width;
|
||||
value->rValue *= here->HFET2m;
|
||||
case HFET2_IC_VDS:
|
||||
value->rValue = here->HFET2icVDS;
|
||||
return (OK);
|
||||
|
|
@ -58,7 +54,9 @@ HFET2ask(ckt,inst,which,value,select)
|
|||
value->iValue = here->HFET2sourcePrimeNode;
|
||||
return (OK);
|
||||
case HFET2_TEMP:
|
||||
value->rValue = here->HFET2temp;
|
||||
value->rValue = here->HFET2temp - CONSTCtoK;
|
||||
case HFET2_DTEMP:
|
||||
value->rValue = here->HFET2dtemp;
|
||||
case HFET2_VGS:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HFET2vgs);
|
||||
return (OK);
|
||||
|
|
@ -67,36 +65,47 @@ HFET2ask(ckt,inst,which,value,select)
|
|||
return (OK);
|
||||
case HFET2_CG:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HFET2cg);
|
||||
value->rValue *= here->HFET2m;
|
||||
return (OK);
|
||||
case HFET2_CD:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HFET2cd);
|
||||
value->rValue *= here->HFET2m;
|
||||
return (OK);
|
||||
case HFET2_CGD:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HFET2cgd);
|
||||
value->rValue *= here->HFET2m;
|
||||
return (OK);
|
||||
case HFET2_GM:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HFET2gm);
|
||||
value->rValue *= here->HFET2m;
|
||||
return (OK);
|
||||
case HFET2_GDS:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HFET2gds);
|
||||
value->rValue *= here->HFET2m;
|
||||
return (OK);
|
||||
case HFET2_GGS:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HFET2ggs);
|
||||
value->rValue *= here->HFET2m;
|
||||
return (OK);
|
||||
case HFET2_GGD:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HFET2ggd);
|
||||
value->rValue *= here->HFET2m;
|
||||
return (OK);
|
||||
case HFET2_QGS:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HFET2qgs);
|
||||
value->rValue *= here->HFET2m;
|
||||
return (OK);
|
||||
case HFET2_CQGS:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HFET2cqgs);
|
||||
value->rValue *= here->HFET2m;
|
||||
return (OK);
|
||||
case HFET2_QGD:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HFET2qgd);
|
||||
value->rValue *= here->HFET2m;
|
||||
return (OK);
|
||||
case HFET2_CQGD:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HFET2cqgd);
|
||||
value->rValue *= here->HFET2m;
|
||||
return (OK);
|
||||
case HFET2_CS :
|
||||
if (ckt->CKTcurrentAnalysis & DOING_AC) {
|
||||
|
|
@ -107,6 +116,7 @@ HFET2ask(ckt,inst,which,value,select)
|
|||
} else {
|
||||
value->rValue = -*(ckt->CKTstate0 + here->HFET2cd);
|
||||
value->rValue -= *(ckt->CKTstate0 + here->HFET2cg);
|
||||
value->rValue *= here->HFET2m;
|
||||
}
|
||||
return(OK);
|
||||
case HFET2_POWER :
|
||||
|
|
@ -123,6 +133,7 @@ HFET2ask(ckt,inst,which,value,select)
|
|||
value->rValue -= (*(ckt->CKTstate0+here->HFET2cd) +
|
||||
*(ckt->CKTstate0 + here->HFET2cg)) *
|
||||
*(ckt->CKTrhsOld + here->HFET2sourceNode);
|
||||
value->rValue *= here->HFET2m;
|
||||
}
|
||||
return(OK);
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ typedef struct sHFET2instance {
|
|||
int HFET2sourcePrimeNode;
|
||||
double HFET2length;
|
||||
double HFET2width;
|
||||
double HFET2m;
|
||||
double HFET2temp;
|
||||
double HFET2dtemp;
|
||||
double HFET2tLambda;
|
||||
double HFET2tMu;
|
||||
double HFET2tNmax;
|
||||
|
|
@ -64,11 +66,13 @@ typedef struct sHFET2instance {
|
|||
int HFET2mode;
|
||||
int HFET2off;
|
||||
|
||||
unsigned HFET2icVDSGiven : 1;
|
||||
unsigned HFET2icVGSGiven : 1;
|
||||
unsigned HFET2icVDSGiven : 1;
|
||||
unsigned HFET2icVGSGiven : 1;
|
||||
unsigned HFET2lengthGiven : 1;
|
||||
unsigned HFET2widthGiven : 1;
|
||||
unsigned HFET2tempGiven : 1;
|
||||
unsigned HFET2widthGiven : 1;
|
||||
unsigned HFET2mGiven : 1;
|
||||
unsigned HFET2tempGiven : 1;
|
||||
unsigned HFET2dtempGiven : 1;
|
||||
|
||||
double HFET2n0;
|
||||
double HFET2n01;
|
||||
|
|
@ -186,6 +190,8 @@ typedef struct sHFET2model {
|
|||
#define HFET2_CS 7
|
||||
#define HFET2_POWER 8
|
||||
#define HFET2_TEMP 9
|
||||
#define HFET2_DTEMP 10
|
||||
#define HFET2_M 11
|
||||
|
||||
/* model parameters */
|
||||
#define HFET2_MOD_NHFET 101
|
||||
|
|
|
|||
|
|
@ -7,17 +7,13 @@ Imported into hfet2 model: Paolo Nenzi 2001
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "hfet2defs.h"
|
||||
#include "sperror.h"
|
||||
#include "suffix.h"
|
||||
|
||||
|
||||
int
|
||||
HFET2delete(inModel,name,inst)
|
||||
GENmodel *inModel;
|
||||
IFuid name;
|
||||
GENinstance **inst;
|
||||
HFET2delete(GENmodel *inModel, IFuid name, GENinstance **inst)
|
||||
{
|
||||
HFET2model *model = (HFET2model*)inModel;
|
||||
HFET2instance **fast = (HFET2instance**)inst;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
/**********
|
||||
Imported from MacSpice3f4 - Antony Wilson
|
||||
Modified: Paolo Nenzi
|
||||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "hfet2defs.h"
|
||||
#include "suffix.h"
|
||||
|
||||
|
||||
void HFET2destroy(inModel)
|
||||
GENmodel **inModel;
|
||||
void HFET2destroy(GENmodel **inModel)
|
||||
{
|
||||
|
||||
HFET2model **model = (HFET2model**)inModel;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ Copyright 1993: T. Ytterdal, K. Lee, M. Shur and T. A. Fjeldly. All rights reser
|
|||
Author: Trond Ytterdal
|
||||
**********/
|
||||
|
||||
#ifdef __STDC__
|
||||
extern int HFET2acLoad(GENmodel*,CKTcircuit*);
|
||||
extern int HFET2ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*);
|
||||
extern int HFET2delete(GENmodel*,IFuid,GENinstance**);
|
||||
|
|
@ -14,25 +13,8 @@ extern int HFET2mAsk(CKTcircuit*,GENmodel*,int,IFvalue*);
|
|||
extern int HFET2mDelete(GENmodel**,IFuid,GENmodel*);
|
||||
extern int HFET2mParam(int,IFvalue*,GENmodel*);
|
||||
extern int HFET2param(int,IFvalue*,GENinstance*,IFvalue*);
|
||||
extern int HFET2pzLoad(GENmodel*, CKTcircuit*, SPcomplex*);
|
||||
extern int HFET2setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
|
||||
extern int HFET2temp(GENmodel*,CKTcircuit*);
|
||||
extern int HFET2trunc(GENmodel*,CKTcircuit*,double*);
|
||||
extern int HFET2unsetup( GENmodel*,CKTcircuit*);
|
||||
|
||||
#else /* stdc */
|
||||
extern int HFET2acLoad();
|
||||
extern int HFET2ask();
|
||||
extern int HFET2delete();
|
||||
extern void HFET2destroy();
|
||||
extern int HFET2getic();
|
||||
extern int HFET2load();
|
||||
extern int HFETAmAsk();
|
||||
extern int HFETAmDelete();
|
||||
extern int HFET2mParam();
|
||||
extern int HFET2param();
|
||||
extern int HFET2setup();
|
||||
extern int HFET2temp();
|
||||
extern int HFET2trunc();
|
||||
extern int HFET2unsetup();
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
/**********
|
||||
Imported from MacSpice3f4 - Antony Wilson
|
||||
Modified: Paolo Nenzi
|
||||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "hfet2defs.h"
|
||||
#include "sperror.h"
|
||||
#include "suffix.h"
|
||||
|
||||
|
||||
int HFET2getic(inModel, ckt)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
int HFET2getic(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
|
||||
HFET2model *model = (HFET2model*)inModel;
|
||||
|
|
@ -17,6 +18,8 @@ CKTcircuit *ckt;
|
|||
|
||||
for( ; model ; model = model->HFET2nextModel) {
|
||||
for(here = model->HFET2instances; here ; here = here->HFET2nextInstance) {
|
||||
if (here->HFET2owner != ARCHme) continue;
|
||||
|
||||
if(!here->HFET2icVDSGiven) {
|
||||
here->HFET2icVDS = *(ckt->CKTrhs + here->HFET2drainNode) -
|
||||
*(ckt->CKTrhs + here->HFET2sourceNode);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ SPICEdev HFET2info = {
|
|||
DEVsetic : HFET2getic,
|
||||
DEVask : HFET2ask,
|
||||
DEVmodAsk : HFET2mAsk,
|
||||
DEVpzLoad : NULL,
|
||||
DEVpzLoad : HFET2pzLoad,
|
||||
DEVconvTest : NULL,
|
||||
DEVsenSetup : NULL,
|
||||
DEVsenLoad : NULL,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
/**********
|
||||
Imported from MacSpice3f4 - Antony Wilson
|
||||
Modified: Paolo Nenzi
|
||||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "devdefs.h"
|
||||
#include "cktdefs.h"
|
||||
#include "hfet2defs.h"
|
||||
|
|
@ -16,13 +19,11 @@ static void hfeta2(HFET2model *model, HFET2instance *here, CKTcircuit *ckt,
|
|||
double *gds, double *capgs, double *capgd);
|
||||
|
||||
|
||||
int HFET2load(inModel, ckt)
|
||||
GENmodel *inModel;
|
||||
register CKTcircuit *ckt;
|
||||
int HFET2load(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
|
||||
register HFET2model *model = (HFET2model*)inModel;
|
||||
register HFET2instance *here;
|
||||
HFET2model *model = (HFET2model*)inModel;
|
||||
HFET2instance *here;
|
||||
double capgd;
|
||||
double capgs;
|
||||
double cd;
|
||||
|
|
@ -59,8 +60,14 @@ register CKTcircuit *ckt;
|
|||
int error;
|
||||
int inverse;
|
||||
|
||||
double m;
|
||||
|
||||
for( ; model != NULL; model = model->HFET2nextModel ) {
|
||||
for(here = model->HFET2instances; here != NULL; here=here->HFET2nextInstance) {
|
||||
for(here = model->HFET2instances; here != NULL;
|
||||
here=here->HFET2nextInstance) {
|
||||
|
||||
if (here->HFET2owner != ARCHme) continue;
|
||||
|
||||
gdpr = model->HFET2drainConduct;
|
||||
gspr = model->HFET2sourceConduct;
|
||||
vcrit = VCRIT;
|
||||
|
|
@ -283,30 +290,33 @@ register CKTcircuit *ckt;
|
|||
// load current vector
|
||||
|
||||
load:
|
||||
|
||||
m = here->HFET2m;
|
||||
|
||||
ceqgd=model->HFET2type*(cgd-ggd*vgd);
|
||||
ceqgs=model->HFET2type*((cg-cgd)-ggs*vgs);
|
||||
cdreq=model->HFET2type*((cd+cgd)-gds*vds-gm*vgs);
|
||||
*(ckt->CKTrhs + here->HFET2gateNode) += (-ceqgs-ceqgd);
|
||||
*(ckt->CKTrhs + here->HFET2drainPrimeNode) += (-cdreq+ceqgd);
|
||||
*(ckt->CKTrhs + here->HFET2sourcePrimeNode) += (cdreq+ceqgs);
|
||||
*(ckt->CKTrhs + here->HFET2gateNode) += m * (-ceqgs-ceqgd);
|
||||
*(ckt->CKTrhs + here->HFET2drainPrimeNode) += m * (-cdreq+ceqgd);
|
||||
*(ckt->CKTrhs + here->HFET2sourcePrimeNode) += m * (cdreq+ceqgs);
|
||||
|
||||
// load y matrix
|
||||
|
||||
*(here->HFET2drainDrainPrimePtr) += (-gdpr);
|
||||
*(here->HFET2gateDrainPrimePtr) += (-ggd);
|
||||
*(here->HFET2gateSourcePrimePtr) += (-ggs);
|
||||
*(here->HFET2sourceSourcePrimePtr) += (-gspr);
|
||||
*(here->HFET2drainPrimeDrainPtr) += (-gdpr);
|
||||
*(here->HFET2drainPrimeGatePtr) += (gm-ggd);
|
||||
*(here->HFET2drainPriHFET2ourcePrimePtr) += (-gds-gm);
|
||||
*(here->HFET2sourcePrimeGatePtr) += (-ggs-gm);
|
||||
*(here->HFET2sourcePriHFET2ourcePtr) += (-gspr);
|
||||
*(here->HFET2sourcePrimeDrainPrimePtr) += (-gds);
|
||||
*(here->HFET2drainDrainPtr) += (gdpr);
|
||||
*(here->HFET2gateGatePtr) += (ggd+ggs);
|
||||
*(here->HFET2sourceSourcePtr) += (gspr);
|
||||
*(here->HFET2drainPrimeDrainPrimePtr) += (gdpr+gds+ggd);
|
||||
*(here->HFET2sourcePriHFET2ourcePrimePtr) += (gspr+gds+gm+ggs);
|
||||
*(here->HFET2drainDrainPrimePtr) += m * (-gdpr);
|
||||
*(here->HFET2gateDrainPrimePtr) += m * (-ggd);
|
||||
*(here->HFET2gateSourcePrimePtr) += m * (-ggs);
|
||||
*(here->HFET2sourceSourcePrimePtr) += m * (-gspr);
|
||||
*(here->HFET2drainPrimeDrainPtr) += m * (-gdpr);
|
||||
*(here->HFET2drainPrimeGatePtr) += m * (gm-ggd);
|
||||
*(here->HFET2drainPriHFET2ourcePrimePtr) += m * (-gds-gm);
|
||||
*(here->HFET2sourcePrimeGatePtr) += m * (-ggs-gm);
|
||||
*(here->HFET2sourcePriHFET2ourcePtr) += m * (-gspr);
|
||||
*(here->HFET2sourcePrimeDrainPrimePtr) += m * (-gds);
|
||||
*(here->HFET2drainDrainPtr) += m * (gdpr);
|
||||
*(here->HFET2gateGatePtr) += m * (ggd+ggs);
|
||||
*(here->HFET2sourceSourcePtr) += m * (gspr);
|
||||
*(here->HFET2drainPrimeDrainPrimePtr) += m * (gdpr+gds+ggd);
|
||||
*(here->HFET2sourcePriHFET2ourcePrimePtr) += m * (gspr+gds+gm+ggs);
|
||||
}
|
||||
}
|
||||
return(OK);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ Imported into HFET2 model: Paolo Nenzi 2001
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "cktdefs.h"
|
||||
#include "devdefs.h"
|
||||
#include "ifsim.h"
|
||||
|
|
@ -18,11 +17,7 @@ Imported into HFET2 model: Paolo Nenzi 2001
|
|||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
HFET2mAsk(ckt,inst,which,value)
|
||||
CKTcircuit *ckt;
|
||||
GENmodel *inst;
|
||||
int which;
|
||||
IFvalue *value;
|
||||
HFET2mAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
|
||||
{
|
||||
HFET2model *here = (HFET2model*)inst;
|
||||
switch(which) {
|
||||
|
|
|
|||
|
|
@ -7,17 +7,13 @@ Imported into hfet2 model: Paolo Nenzi 2001
|
|||
*/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "hfet2defs.h"
|
||||
#include "sperror.h"
|
||||
#include "suffix.h"
|
||||
|
||||
|
||||
int
|
||||
HFET2mDelete(inModel,modname,kill)
|
||||
GENmodel **inModel;
|
||||
IFuid modname;
|
||||
GENmodel *kill;
|
||||
HFET2mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill)
|
||||
{
|
||||
HFET2model **model = (HFET2model**)inModel;
|
||||
HFET2model *modfast = (HFET2model*)kill;
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
/**********
|
||||
Imported from MacSpice3f4 - Antony Wilson
|
||||
Modified: Paolo Nenzi
|
||||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "ifsim.h"
|
||||
#include "hfet2defs.h"
|
||||
#include "sperror.h"
|
||||
#include "suffix.h"
|
||||
|
||||
|
||||
int HFET2mParam(param, value, inModel)
|
||||
int param;
|
||||
IFvalue *value;
|
||||
GENmodel *inModel;
|
||||
int HFET2mParam(int param, IFvalue *value, GENmodel *inModel)
|
||||
{
|
||||
|
||||
HFET2model *model = (HFET2model*)inModel;
|
||||
|
|
|
|||
|
|
@ -1,17 +1,16 @@
|
|||
/**********
|
||||
Imported from MacSpice3f4 - Antony Wilson
|
||||
Modified: Paolo Nenzi
|
||||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "ifsim.h"
|
||||
#include "hfet2defs.h"
|
||||
#include "sperror.h"
|
||||
#include "suffix.h"
|
||||
|
||||
|
||||
int HFET2param(param, value, inst, select)
|
||||
int param;
|
||||
IFvalue *value;
|
||||
GENinstance *inst;
|
||||
IFvalue *select;
|
||||
int HFET2param(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
|
||||
{
|
||||
|
||||
HFET2instance *here = (HFET2instance*)inst;
|
||||
|
|
@ -45,13 +44,21 @@ IFvalue *select;
|
|||
}
|
||||
break;
|
||||
case HFET2_TEMP:
|
||||
TEMP = value->rValue+CONSTCtoK;
|
||||
TEMP = value->rValue + CONSTCtoK;
|
||||
here->HFET2tempGiven = TRUE;
|
||||
break;
|
||||
case HFET2_DTEMP:
|
||||
here->HFET2dtemp = value->rValue;
|
||||
here->HFET2dtempGiven = TRUE;
|
||||
break;
|
||||
case HFET2_WIDTH:
|
||||
W = value->rValue;
|
||||
here->HFET2widthGiven = TRUE;
|
||||
break;
|
||||
case HFET2_M:
|
||||
here->HFET2m = value->rValue;
|
||||
here->HFET2mGiven = TRUE;
|
||||
break;
|
||||
default:
|
||||
return(E_BADPARM);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
/**********
|
||||
Author: 2003 Paolo Nenzi
|
||||
**********/
|
||||
/*
|
||||
*/
|
||||
|
||||
|
||||
#include "ngspice.h"
|
||||
#include "cktdefs.h"
|
||||
#include "hfet2defs.h"
|
||||
#include "sperror.h"
|
||||
#include "suffix.h"
|
||||
|
||||
|
||||
int HFET2pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
|
||||
{
|
||||
|
||||
HFET2model *model = (HFET2model*)inModel;
|
||||
HFET2instance *here;
|
||||
double gdpr;
|
||||
double gspr;
|
||||
double gm;
|
||||
double gds;
|
||||
double ggs;
|
||||
double xgs;
|
||||
double ggd;
|
||||
double xgd;
|
||||
|
||||
double m;
|
||||
|
||||
for( ; model != NULL; model = model->HFET2nextModel )
|
||||
{
|
||||
for( here = model->HFET2instances; here != NULL;
|
||||
here = here->HFET2nextInstance) {
|
||||
|
||||
if (here->HFET2owner != ARCHme) continue;
|
||||
|
||||
m = here->HFET2m;
|
||||
|
||||
gdpr=model->HFET2drainConduct;
|
||||
gspr=model->HFET2sourceConduct;
|
||||
gm= *(ckt->CKTstate0 + here->HFET2gm) ;
|
||||
gds= *(ckt->CKTstate0 + here->HFET2gds) ;
|
||||
ggs= *(ckt->CKTstate0 + here->HFET2ggs) ;
|
||||
xgs= *(ckt->CKTstate0 + here->HFET2qgs) ;
|
||||
ggd= *(ckt->CKTstate0 + here->HFET2ggd) ;
|
||||
xgd= *(ckt->CKTstate0 + here->HFET2qgd) ;
|
||||
|
||||
*(here->HFET2drainDrainPtr ) += m * (gdpr);
|
||||
*(here->HFET2gateGatePtr ) += m * (ggd+ggs);
|
||||
*(here->HFET2gateGatePtr) += m * ((xgd+xgs) * s->real);
|
||||
*(here->HFET2gateGatePtr +1) += m * ((xgd+xgs) * s->imag);
|
||||
*(here->HFET2sourceSourcePtr ) += m * (gspr);
|
||||
*(here->HFET2drainPrimeDrainPrimePtr ) += m * (gdpr+gds+ggd);
|
||||
*(here->HFET2drainPrimeDrainPrimePtr) += m * (xgd * s->real);
|
||||
*(here->HFET2drainPrimeDrainPrimePtr +1) += m * (xgd * s->imag);
|
||||
*(here->HFET2sourcePriHFET2ourcePrimePtr ) += m * (gspr+gds+gm+ggs);
|
||||
*(here->HFET2sourcePriHFET2ourcePrimePtr) += m * (xgs * s->real);
|
||||
*(here->HFET2sourcePriHFET2ourcePrimePtr +1) += m * (xgs * s->imag);
|
||||
*(here->HFET2drainDrainPrimePtr ) -= m * (gdpr);
|
||||
*(here->HFET2gateDrainPrimePtr ) -= m * (ggd);
|
||||
*(here->HFET2gateDrainPrimePtr) -= m * (xgd * s->real);
|
||||
*(here->HFET2gateDrainPrimePtr +1) -= m * (xgd * s->imag);
|
||||
*(here->HFET2gateSourcePrimePtr ) -= m * (ggs);
|
||||
*(here->HFET2gateSourcePrimePtr) -= m * (xgs * s->real);
|
||||
*(here->HFET2gateSourcePrimePtr +1) -= m * (xgs * s->imag);
|
||||
*(here->HFET2sourceSourcePrimePtr ) -= m * (gspr);
|
||||
*(here->HFET2drainPrimeDrainPtr ) -= m * (gdpr);
|
||||
*(here->HFET2drainPrimeGatePtr ) += m * (-ggd+gm);
|
||||
*(here->HFET2drainPrimeGatePtr) -= m * (xgd * s->real);
|
||||
*(here->HFET2drainPrimeGatePtr +1) -= m * (xgd * s->imag);
|
||||
*(here->HFET2drainPriHFET2ourcePrimePtr ) += m * (-gds-gm);
|
||||
*(here->HFET2sourcePrimeGatePtr ) += m * (-ggs-gm);
|
||||
*(here->HFET2sourcePrimeGatePtr) -= m * (xgs * s->real);
|
||||
*(here->HFET2sourcePrimeGatePtr +1) -= m * (xgs * s->imag);
|
||||
*(here->HFET2sourcePriHFET2ourcePtr ) -= m * (gspr);
|
||||
*(here->HFET2sourcePrimeDrainPrimePtr ) -= m * (gds);
|
||||
}
|
||||
}
|
||||
return(OK);
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
/**********
|
||||
Imported from MacSpice3f4 - Antony Wilson
|
||||
Modified: Paolo Nenzi
|
||||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "smpdefs.h"
|
||||
#include "cktdefs.h"
|
||||
#include "hfet2defs.h"
|
||||
|
|
@ -9,11 +12,7 @@
|
|||
#include "suffix.h"
|
||||
|
||||
|
||||
int HFET2setup(matrix, inModel, ckt, states)
|
||||
SMPmatrix *matrix;
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
int *states;
|
||||
int HFET2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||
{
|
||||
|
||||
HFET2model *model = (HFET2model*)inModel;
|
||||
|
|
@ -115,21 +114,25 @@ int *states;
|
|||
/* loop through all the instances of the model */
|
||||
|
||||
|
||||
for (here = model->HFET2instances; here != NULL; here=here->HFET2nextInstance) {
|
||||
for (here = model->HFET2instances; here != NULL;
|
||||
here=here->HFET2nextInstance) {
|
||||
|
||||
CKTnode *tmpNode;
|
||||
IFuid tmpName;
|
||||
|
||||
|
||||
if (here->HFET2owner != ARCHme) goto matrixpointers;
|
||||
|
||||
here->HFET2state = *states;
|
||||
*states += 13;
|
||||
|
||||
if(!here->HFET2lengthGiven)
|
||||
L = 1e-6;
|
||||
if(!here->HFET2tempGiven)
|
||||
TEMP = ckt->CKTtemp;
|
||||
L = 1e-6;
|
||||
if(!here->HFET2widthGiven)
|
||||
W = 20e-6;
|
||||
|
||||
if(!here->HFET2mGiven)
|
||||
here->HFET2m = 1.0;
|
||||
|
||||
matrixpointers:
|
||||
if(model->HFET2rs != 0 && here->HFET2sourcePrimeNode==0) {
|
||||
error = CKTmkVolt(ckt,&tmp,here->HFET2name,"source");
|
||||
if(error) return(error);
|
||||
|
|
@ -195,9 +198,7 @@ if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\
|
|||
|
||||
|
||||
int
|
||||
HFET2unsetup(inModel,ckt)
|
||||
GENmodel *inModel;
|
||||
CKTcircuit *ckt;
|
||||
HFET2unsetup(GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
HFET2model *model;
|
||||
HFET2instance *here;
|
||||
|
|
@ -220,14 +221,8 @@ HFET2unsetup(inModel,ckt)
|
|||
CKTdltNNum(ckt, here->HFET2sourcePrimeNode);
|
||||
here->HFET2sourcePrimeNode = 0;
|
||||
}
|
||||
/*if (here->HFET2gateNode
|
||||
&& here->HFET2gateNode != here->HFET2gateNode)
|
||||
{
|
||||
CKTdltNNum(ckt, here->HFET2gateNode);
|
||||
here->HFET2gateNode = 0;
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
/**********
|
||||
Imported from MacSpice3f4 - Antony Wilson
|
||||
Modified: Paolo Nenzi
|
||||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "smpdefs.h"
|
||||
#include "cktdefs.h"
|
||||
#include "hfet2defs.h"
|
||||
|
|
@ -16,6 +19,8 @@ CKTcircuit *ckt;
|
|||
|
||||
HFET2instance *here;
|
||||
HFET2model *model = (HFET2model*)inModel;
|
||||
double vt;
|
||||
double tdiff;
|
||||
|
||||
for( ; model != NULL; model = model->HFET2nextModel ) {
|
||||
if(model->HFET2rd != 0)
|
||||
|
|
@ -31,9 +36,19 @@ CKTcircuit *ckt;
|
|||
if(!model->HFET2vt2Given)
|
||||
VT2 = VTO;
|
||||
DELTA2 = DELTA*DELTA;
|
||||
for (here = model->HFET2instances; here != NULL; here=here->HFET2nextInstance) {
|
||||
double vt = CONSTKoverQ*TEMP;
|
||||
double tdiff = TEMP - ckt->CKTnomTemp;
|
||||
for (here = model->HFET2instances; here != NULL;
|
||||
here=here->HFET2nextInstance) {
|
||||
|
||||
if (here->HFET2owner != ARCHme) continue;
|
||||
|
||||
if(!here->HFET2dtempGiven)
|
||||
here->HFET2dtemp = 0.0;
|
||||
if(!here->HFET2tempGiven)
|
||||
TEMP = ckt->CKTtemp + here->HFET2dtemp;
|
||||
|
||||
vt = CONSTKoverQ*TEMP;
|
||||
tdiff = TEMP - ckt->CKTnomTemp;
|
||||
|
||||
TLAMBDA = LAMBDA + KLAMBDA*tdiff;
|
||||
TMU = MU - KMU*tdiff;
|
||||
TNMAX = NMAX - KNMAX*tdiff;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,11 @@ double *tiHFET2tep;
|
|||
HFET2instance *here;
|
||||
|
||||
for( ; model != NULL; model = model->HFET2nextModel) {
|
||||
for(here=model->HFET2instances;here!=NULL;here = here->HFET2nextInstance){
|
||||
for(here=model->HFET2instances;here!=NULL;
|
||||
here = here->HFET2nextInstance){
|
||||
|
||||
if (here->HFET2owner != ARCHme) continue;
|
||||
|
||||
CKTterr(here->HFET2qgs,ckt,tiHFET2tep);
|
||||
CKTterr(here->HFET2qgd,ckt,tiHFET2tep);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue