Updated BSIM4 model to latest version (BSIM4.2.1)
This commit is contained in:
parent
fc8956b08c
commit
84c3d3fbc0
|
|
@ -1,3 +1,7 @@
|
||||||
|
2001-11-25 Emmanuel Rouat <emmanuel.rouat@wanadoo.fr>
|
||||||
|
|
||||||
|
* circuits.h: transfered definition of sstructire 'circ' to ftedefs.h
|
||||||
|
|
||||||
2001-02-07 Paolo Nenzi <p.nenzi@ieee.org>
|
2001-02-07 Paolo Nenzi <p.nenzi@ieee.org>
|
||||||
|
|
||||||
* outitf.c: From a message Alan sento to the mailing list:
|
* outitf.c: From a message Alan sento to the mailing list:
|
||||||
|
|
|
||||||
|
|
@ -6,30 +6,7 @@
|
||||||
#ifndef CIRCUITS_H_INCLUDED
|
#ifndef CIRCUITS_H_INCLUDED
|
||||||
#define CIRCUITS_H_INCLUDED
|
#define CIRCUITS_H_INCLUDED
|
||||||
|
|
||||||
/* The curcuits that are currently available to the user. */
|
|
||||||
|
|
||||||
struct circ {
|
|
||||||
char *ci_name; /* What the circuit can be called. */
|
|
||||||
char *ci_ckt; /* The CKTcircuit structure. */
|
|
||||||
INPtables *ci_symtab; /* The INP symbol table. */
|
|
||||||
struct line *ci_deck; /* The input deck. */
|
|
||||||
struct line *ci_origdeck;/* The input deck, before subckt expansion. */
|
|
||||||
struct line *ci_options;/* The .option cards from the deck... */
|
|
||||||
struct variable *ci_vars; /* ... and the parsed versions. */
|
|
||||||
bool ci_inprogress; /* We are in a break now. */
|
|
||||||
bool ci_runonce; /* So com_run can to a reset if necessary... */
|
|
||||||
wordlist *ci_commands; /* Things to do when this circuit is done. */
|
|
||||||
struct circ *ci_next; /* The next in the list. */
|
|
||||||
char *ci_nodes; /* ccom structs for the nodes... */
|
|
||||||
char *ci_devices; /* and devices in the circuit. */
|
|
||||||
char *ci_filename; /* Where this circuit came from. */
|
|
||||||
char *ci_defTask; /* the default task for this circuit */
|
|
||||||
char *ci_specTask; /* the special task for command line jobs */
|
|
||||||
char *ci_curTask; /* the most recent task for this circuit */
|
|
||||||
char *ci_defOpt; /* the default options anal. for this circuit */
|
|
||||||
char *ci_specOpt; /* the special options anal. for command line jobs */
|
|
||||||
char *ci_curOpt; /* the most recent options anal. for the circuit */
|
|
||||||
} ;
|
|
||||||
|
|
||||||
struct subcirc {
|
struct subcirc {
|
||||||
char *sc_name; /* Whatever... */
|
char *sc_name; /* Whatever... */
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
#include <ngspice.h>
|
#include <ngspice.h>
|
||||||
#include <bool.h>
|
#include <bool.h>
|
||||||
#include <wordlist.h>
|
#include <wordlist.h>
|
||||||
|
#include <ftedefs.h>
|
||||||
#include <inpdefs.h>
|
#include <inpdefs.h>
|
||||||
|
|
||||||
#include "circuits.h"
|
#include "circuits.h"
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
2001-11-25 Emmanuel Rouat <emmanuel.rouat@wanadoo.fr>
|
||||||
|
|
||||||
|
* ftedefs.h: added definition of structure circ (taken from circuits.h)
|
||||||
|
|
||||||
2000-09-09 Arno W. Peters <A.W.Peters@ieee.org>
|
2000-09-09 Arno W. Peters <A.W.Peters@ieee.org>
|
||||||
|
|
||||||
* fteext.h: Removed prototype for com_fourier(). Use
|
* fteext.h: Removed prototype for com_fourier(). Use
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,32 @@ struct save_info {
|
||||||
int used;
|
int used;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* The curcuits that are currently available to the user. */
|
||||||
|
|
||||||
|
struct circ {
|
||||||
|
char *ci_name; /* What the circuit can be called. */
|
||||||
|
char *ci_ckt; /* The CKTcircuit structure. */
|
||||||
|
INPtables *ci_symtab; /* The INP symbol table. */
|
||||||
|
struct line *ci_deck; /* The input deck. */
|
||||||
|
struct line *ci_origdeck;/* The input deck, before subckt expansion. */
|
||||||
|
struct line *ci_options;/* The .option cards from the deck... */
|
||||||
|
struct variable *ci_vars; /* ... and the parsed versions. */
|
||||||
|
bool ci_inprogress; /* We are in a break now. */
|
||||||
|
bool ci_runonce; /* So com_run can to a reset if necessary... */
|
||||||
|
wordlist *ci_commands; /* Things to do when this circuit is done. */
|
||||||
|
struct circ *ci_next; /* The next in the list. */
|
||||||
|
char *ci_nodes; /* ccom structs for the nodes... */
|
||||||
|
char *ci_devices; /* and devices in the circuit. */
|
||||||
|
char *ci_filename; /* Where this circuit came from. */
|
||||||
|
char *ci_defTask; /* the default task for this circuit */
|
||||||
|
char *ci_specTask; /* the special task for command line jobs */
|
||||||
|
char *ci_curTask; /* the most recent task for this circuit */
|
||||||
|
char *ci_defOpt; /* the default options anal. for this circuit */
|
||||||
|
char *ci_specOpt; /* the special options anal. for command line jobs */
|
||||||
|
char *ci_curOpt; /* the most recent options anal. for the circuit */
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
#define mylog10(xx) (((xx) > 0.0) ? log10(xx) : (- log10(HUGE)))
|
#define mylog10(xx) (((xx) > 0.0) ? log10(xx) : (- log10(HUGE)))
|
||||||
|
|
||||||
#include "fteext.h"
|
#include "fteext.h"
|
||||||
|
|
|
||||||
BIN
src/ngspice.idx
BIN
src/ngspice.idx
Binary file not shown.
|
|
@ -1,3 +1,7 @@
|
||||||
|
2001-11-25 Emmanuel Rouat <emmanuel.rouat@wanadoo.fr>
|
||||||
|
|
||||||
|
* *.c *.h: Updated to version BSIM4.2.1
|
||||||
|
|
||||||
2000-04-04 Paolo Nenzi <p.nenzi@ieee.org>
|
2000-04-04 Paolo Nenzi <p.nenzi@ieee.org>
|
||||||
|
|
||||||
* *.c, *.h: Initial bsim4 support. Modified all files to conform
|
* *.c, *.h: Initial bsim4 support. Modified all files to conform
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,20 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4.c of BSIM4.1.0.
|
* File: b4.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
*
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
* Modified by Xuemei Xi, 10/05/2001.
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "devdefs.h"
|
#include "devdefs.h"
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
IFparm BSIM4pTable[] = { /* parameters */
|
IFparm BSIM4pTable[] = { /* parameters */
|
||||||
IOP( "l", BSIM4_L, IF_REAL , "Length"),
|
IOP( "l", BSIM4_L, IF_REAL , "Length"),
|
||||||
|
|
@ -45,9 +47,42 @@ OP( "gds", BSIM4_GDS, IF_REAL, "Gds"),
|
||||||
OP( "vdsat", BSIM4_VDSAT, IF_REAL, "Vdsat"),
|
OP( "vdsat", BSIM4_VDSAT, IF_REAL, "Vdsat"),
|
||||||
OP( "vth", BSIM4_VON, IF_REAL, "Vth"),
|
OP( "vth", BSIM4_VON, IF_REAL, "Vth"),
|
||||||
OP( "id", BSIM4_CD, IF_REAL, "Ids"),
|
OP( "id", BSIM4_CD, IF_REAL, "Ids"),
|
||||||
|
OP( "ibd", BSIM4_CBD, IF_REAL, "Ibd"),
|
||||||
|
OP( "ibs", BSIM4_CBS, IF_REAL, "Ibs"),
|
||||||
|
OP( "isub", BSIM4_CSUB, IF_REAL, "Isub"),
|
||||||
|
OP( "igidl", BSIM4_IGIDL, IF_REAL, "Igidl"),
|
||||||
|
OP( "igisl", BSIM4_IGISL, IF_REAL, "Igisl"),
|
||||||
|
OP( "igs", BSIM4_IGS, IF_REAL, "Igs"),
|
||||||
|
OP( "igd", BSIM4_IGD, IF_REAL, "Igd"),
|
||||||
|
OP( "igb", BSIM4_IGB, IF_REAL, "Igb"),
|
||||||
|
OP( "igcs", BSIM4_IGCS, IF_REAL, "Igcs"),
|
||||||
|
OP( "igcd", BSIM4_IGCD, IF_REAL, "Igcd"),
|
||||||
OP( "vbs", BSIM4_VBS, IF_REAL, "Vbs"),
|
OP( "vbs", BSIM4_VBS, IF_REAL, "Vbs"),
|
||||||
OP( "vgs", BSIM4_VGS, IF_REAL, "Vgs"),
|
OP( "vgs", BSIM4_VGS, IF_REAL, "Vgs"),
|
||||||
OP( "vds", BSIM4_VDS, IF_REAL, "Vds"),
|
OP( "vds", BSIM4_VDS, IF_REAL, "Vds"),
|
||||||
|
OP( "cgg", BSIM4_CGGB, IF_REAL, "Cggb"),
|
||||||
|
OP( "cgs", BSIM4_CGSB, IF_REAL, "Cgsb"),
|
||||||
|
OP( "cgd", BSIM4_CGDB, IF_REAL, "Cgdb"),
|
||||||
|
OP( "cbg", BSIM4_CBGB, IF_REAL, "Cbgb"),
|
||||||
|
OP( "cbd", BSIM4_CBDB, IF_REAL, "Cbdb"),
|
||||||
|
OP( "cbs", BSIM4_CBSB, IF_REAL, "Cbsb"),
|
||||||
|
OP( "cdg", BSIM4_CDGB, IF_REAL, "Cdgb"),
|
||||||
|
OP( "cdd", BSIM4_CDDB, IF_REAL, "Cddb"),
|
||||||
|
OP( "cds", BSIM4_CDSB, IF_REAL, "Cdsb"),
|
||||||
|
OP( "csg", BSIM4_CSGB, IF_REAL, "Csgb"),
|
||||||
|
OP( "csd", BSIM4_CSDB, IF_REAL, "Csdb"),
|
||||||
|
OP( "css", BSIM4_CSSB, IF_REAL, "Cssb"),
|
||||||
|
OP( "cgb", BSIM4_CGBB, IF_REAL, "Cgbb"),
|
||||||
|
OP( "cdb", BSIM4_CDBB, IF_REAL, "Cdbb"),
|
||||||
|
OP( "csb", BSIM4_CSBB, IF_REAL, "Csbb"),
|
||||||
|
OP( "cbb", BSIM4_CBBB, IF_REAL, "Cbbb"),
|
||||||
|
OP( "capbd", BSIM4_CAPBD, IF_REAL, "Capbd"),
|
||||||
|
OP( "capbs", BSIM4_CAPBS, IF_REAL, "Capbs"),
|
||||||
|
OP( "qg", BSIM4_QG, IF_REAL, "Qgate"),
|
||||||
|
OP( "qb", BSIM4_QB, IF_REAL, "Qbulk"),
|
||||||
|
OP( "qd", BSIM4_QD, IF_REAL, "Qdrain"),
|
||||||
|
OP( "qs", BSIM4_QS, IF_REAL, "Qsource"),
|
||||||
|
OP( "qinv", BSIM4_QINV, IF_REAL, "Qinversion"),
|
||||||
};
|
};
|
||||||
|
|
||||||
IFparm BSIM4mPTable[] = { /* model parameters */
|
IFparm BSIM4mPTable[] = { /* model parameters */
|
||||||
|
|
@ -256,6 +291,8 @@ IOP( "clc", BSIM4_MOD_CLC, IF_REAL, "Vdsat parameter for C-V model"),
|
||||||
IOP( "cle", BSIM4_MOD_CLE, IF_REAL, "Vdsat parameter for C-V model"),
|
IOP( "cle", BSIM4_MOD_CLE, IF_REAL, "Vdsat parameter for C-V model"),
|
||||||
IOP( "dwc", BSIM4_MOD_DWC, IF_REAL, "Delta W for C-V model"),
|
IOP( "dwc", BSIM4_MOD_DWC, IF_REAL, "Delta W for C-V model"),
|
||||||
IOP( "dlc", BSIM4_MOD_DLC, IF_REAL, "Delta L for C-V model"),
|
IOP( "dlc", BSIM4_MOD_DLC, IF_REAL, "Delta L for C-V model"),
|
||||||
|
IOP( "xw", BSIM4_MOD_XW, IF_REAL, "W offset for channel width due to mask/etch effect"),
|
||||||
|
IOP( "xl", BSIM4_MOD_XL, IF_REAL, "L offset for channel length due to mask/etch effect"),
|
||||||
IOP( "dlcig", BSIM4_MOD_DLCIG, IF_REAL, "Delta L for Ig model"),
|
IOP( "dlcig", BSIM4_MOD_DLCIG, IF_REAL, "Delta L for Ig model"),
|
||||||
IOP( "dwj", BSIM4_MOD_DWJ, IF_REAL, "Delta W for S/D junctions"),
|
IOP( "dwj", BSIM4_MOD_DWJ, IF_REAL, "Delta W for S/D junctions"),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4acld.c of BSIM4.1.0.
|
* File: b4acld.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Xiaodong Jin, Kanyu M. Cao, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
*
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
* Modified by Xuemei Xi 10/05/2001
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -14,15 +15,16 @@
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
BSIM4acLoad(inModel,ckt)
|
BSIM4acLoad(inModel,ckt)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
register CKTcircuit *ckt;
|
||||||
{
|
{
|
||||||
BSIM4model *model = (BSIM4model*)inModel;
|
register BSIM4model *model = (BSIM4model*)inModel;
|
||||||
BSIM4instance *here;
|
register BSIM4instance *here;
|
||||||
|
|
||||||
double gjbd, gjbs, geltd, gcrg, gcrgg, gcrgd, gcrgs, gcrgb;
|
double gjbd, gjbs, geltd, gcrg, gcrgg, gcrgd, gcrgs, gcrgb;
|
||||||
double xcbgb, xcbdb, xcbsb, xcbbb;
|
double xcbgb, xcbdb, xcbsb, xcbbb;
|
||||||
|
|
@ -50,13 +52,13 @@ double gmr, gmi, gmbsr, gmbsi, gdsr, gdsi;
|
||||||
double FwdSumr, RevSumr, Gmr, Gmbsr, Gdsr;
|
double FwdSumr, RevSumr, Gmr, Gmbsr, Gdsr;
|
||||||
double FwdSumi, RevSumi, Gmi, Gmbsi, Gdsi;
|
double FwdSumi, RevSumi, Gmi, Gmbsi, Gdsi;
|
||||||
struct bsim4SizeDependParam *pParam;
|
struct bsim4SizeDependParam *pParam;
|
||||||
|
double ggidld, ggidlg, ggidlb,ggisld, ggislg, ggislb, ggisls;
|
||||||
|
|
||||||
omega = ckt->CKTomega;
|
omega = ckt->CKTomega;
|
||||||
for (; model != NULL; model = model->BSIM4nextModel)
|
for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
{ for (here = model->BSIM4instances; here!= NULL;
|
{ for (here = model->BSIM4instances; here!= NULL;
|
||||||
here = here->BSIM4nextInstance)
|
here = here->BSIM4nextInstance)
|
||||||
{ if (here->BSIM4owner != ARCHme) continue;
|
{ pParam = here->pParam;
|
||||||
pParam = here->pParam;
|
|
||||||
capbd = here->BSIM4capbd;
|
capbd = here->BSIM4capbd;
|
||||||
capbs = here->BSIM4capbs;
|
capbs = here->BSIM4capbs;
|
||||||
cgso = here->BSIM4cgso;
|
cgso = here->BSIM4cgso;
|
||||||
|
|
@ -148,13 +150,12 @@ struct bsim4SizeDependParam *pParam;
|
||||||
FwdSumi = Gmi + Gmbsi;
|
FwdSumi = Gmi + Gmbsi;
|
||||||
RevSumi = 0.0;
|
RevSumi = 0.0;
|
||||||
|
|
||||||
gbbdp = -(here->BSIM4gbds + here->BSIM4ggidld);
|
gbbdp = -(here->BSIM4gbds);
|
||||||
gbbsp = here->BSIM4gbds + here->BSIM4gbgs + here->BSIM4gbbs
|
gbbsp = here->BSIM4gbds + here->BSIM4gbgs + here->BSIM4gbbs;
|
||||||
- here->BSIM4ggidls;
|
gbdpg = here->BSIM4gbgs;
|
||||||
gbdpg = here->BSIM4gbgs + here->BSIM4ggidlg;
|
gbdpdp = here->BSIM4gbds;
|
||||||
gbdpdp = here->BSIM4gbds + here->BSIM4ggidld;
|
gbdpb = here->BSIM4gbbs;
|
||||||
gbdpb = here->BSIM4gbbs + here->BSIM4ggidlb;
|
gbdpsp = -(gbdpg + gbdpdp + gbdpb);
|
||||||
gbdpsp = -(gbdpg + gbdpdp + gbdpb) + here->BSIM4ggidls;
|
|
||||||
|
|
||||||
gbspdp = 0.0;
|
gbspdp = 0.0;
|
||||||
gbspg = 0.0;
|
gbspg = 0.0;
|
||||||
|
|
@ -292,19 +293,18 @@ struct bsim4SizeDependParam *pParam;
|
||||||
FwdSumi = 0.0;
|
FwdSumi = 0.0;
|
||||||
RevSumi = -(Gmi + Gmbsi);
|
RevSumi = -(Gmi + Gmbsi);
|
||||||
|
|
||||||
gbbsp = -(here->BSIM4gbds + here->BSIM4ggidld);
|
gbbsp = -(here->BSIM4gbds);
|
||||||
gbbdp = here->BSIM4gbds + here->BSIM4gbgs + here->BSIM4gbbs
|
gbbdp = here->BSIM4gbds + here->BSIM4gbgs + here->BSIM4gbbs;
|
||||||
- here->BSIM4ggidls;
|
|
||||||
|
|
||||||
gbdpg = 0.0;
|
gbdpg = 0.0;
|
||||||
gbdpsp = 0.0;
|
gbdpsp = 0.0;
|
||||||
gbdpb = 0.0;
|
gbdpb = 0.0;
|
||||||
gbdpdp = 0.0;
|
gbdpdp = 0.0;
|
||||||
|
|
||||||
gbspg = here->BSIM4gbgs + here->BSIM4ggidlg;
|
gbspg = here->BSIM4gbgs;
|
||||||
gbspsp = here->BSIM4gbds + here->BSIM4ggidld;
|
gbspsp = here->BSIM4gbds;
|
||||||
gbspb = here->BSIM4gbbs + here->BSIM4ggidlb;
|
gbspb = here->BSIM4gbbs;
|
||||||
gbspdp = -(gbspg + gbspsp + gbspb) + here->BSIM4ggidls;
|
gbspdp = -(gbspg + gbspsp + gbspb);
|
||||||
|
|
||||||
if (model->BSIM4igcMod)
|
if (model->BSIM4igcMod)
|
||||||
{ gIstotg = here->BSIM4gIgsg + here->BSIM4gIgcdg;
|
{ gIstotg = here->BSIM4gIgsg + here->BSIM4gIgcdg;
|
||||||
|
|
@ -577,12 +577,37 @@ struct bsim4SizeDependParam *pParam;
|
||||||
*(here->BSIM4BPdpPtr +1) += xcbdb;
|
*(here->BSIM4BPdpPtr +1) += xcbdb;
|
||||||
*(here->BSIM4BPdpPtr) -= gjbd - gbbdp + gIbtotd;
|
*(here->BSIM4BPdpPtr) -= gjbd - gbbdp + gIbtotd;
|
||||||
*(here->BSIM4BPgpPtr +1) += xcbgb;
|
*(here->BSIM4BPgpPtr +1) += xcbgb;
|
||||||
*(here->BSIM4BPgpPtr) -= here->BSIM4gbgs + here->BSIM4ggidlg + gIbtotg;
|
*(here->BSIM4BPgpPtr) -= here->BSIM4gbgs + gIbtotg;
|
||||||
*(here->BSIM4BPspPtr +1) += xcbsb;
|
*(here->BSIM4BPspPtr +1) += xcbsb;
|
||||||
*(here->BSIM4BPspPtr) -= gjbs - gbbsp + gIbtots;
|
*(here->BSIM4BPspPtr) -= gjbs - gbbsp + gIbtots;
|
||||||
*(here->BSIM4BPbpPtr +1) += xcbbb;
|
*(here->BSIM4BPbpPtr +1) += xcbbb;
|
||||||
*(here->BSIM4BPbpPtr) += gjbd + gjbs - here->BSIM4gbbs
|
*(here->BSIM4BPbpPtr) += gjbd + gjbs - here->BSIM4gbbs
|
||||||
- here->BSIM4ggidlb - gIbtotb;
|
- gIbtotb;
|
||||||
|
ggidld = here->BSIM4ggidld;
|
||||||
|
ggidlg = here->BSIM4ggidlg;
|
||||||
|
ggidlb = here->BSIM4ggidlb;
|
||||||
|
ggislg = here->BSIM4ggislg;
|
||||||
|
ggisls = here->BSIM4ggisls;
|
||||||
|
ggislb = here->BSIM4ggislb;
|
||||||
|
|
||||||
|
/* stamp gidl */
|
||||||
|
(*(here->BSIM4DPdpPtr) += ggidld);
|
||||||
|
(*(here->BSIM4DPgpPtr) += ggidlg);
|
||||||
|
(*(here->BSIM4DPspPtr) -= (ggidlg + ggidld) + ggidlb);
|
||||||
|
(*(here->BSIM4DPbpPtr) += ggidlb);
|
||||||
|
(*(here->BSIM4BPdpPtr) -= ggidld);
|
||||||
|
(*(here->BSIM4BPgpPtr) -= ggidlg);
|
||||||
|
(*(here->BSIM4BPspPtr) += (ggidlg + ggidld) + ggidlb);
|
||||||
|
(*(here->BSIM4BPbpPtr) -= ggidlb);
|
||||||
|
/* stamp gisl */
|
||||||
|
(*(here->BSIM4SPdpPtr) -= (ggisls + ggislg) + ggislb);
|
||||||
|
(*(here->BSIM4SPgpPtr) += ggislg);
|
||||||
|
(*(here->BSIM4SPspPtr) += ggisls);
|
||||||
|
(*(here->BSIM4SPbpPtr) += ggislb);
|
||||||
|
(*(here->BSIM4BPdpPtr) += (ggislg + ggisls) + ggislb);
|
||||||
|
(*(here->BSIM4BPgpPtr) -= ggislg);
|
||||||
|
(*(here->BSIM4BPspPtr) -= ggisls);
|
||||||
|
(*(here->BSIM4BPbpPtr) -= ggislb);
|
||||||
|
|
||||||
if (here->BSIM4rbodyMod)
|
if (here->BSIM4rbodyMod)
|
||||||
{ (*(here->BSIM4DPdbPtr +1) += xcdbdb);
|
{ (*(here->BSIM4DPdbPtr +1) += xcdbdb);
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4ask.c of BSIM4.1.0.
|
* File: b4ask.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
*
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
* Modified by Xuemei Xi, 10/05/2001.
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -17,6 +18,7 @@
|
||||||
#include "devdefs.h"
|
#include "devdefs.h"
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
BSIM4ask(ckt,inst,which,value,select)
|
BSIM4ask(ckt,inst,which,value,select)
|
||||||
|
|
@ -164,6 +166,30 @@ BSIM4instance *here = (BSIM4instance*)inst;
|
||||||
case BSIM4_CBD:
|
case BSIM4_CBD:
|
||||||
value->rValue = here->BSIM4cbd;
|
value->rValue = here->BSIM4cbd;
|
||||||
return(OK);
|
return(OK);
|
||||||
|
case BSIM4_CSUB:
|
||||||
|
value->rValue = here->BSIM4csub;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_IGIDL:
|
||||||
|
value->rValue = here->BSIM4Igidl;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_IGISL:
|
||||||
|
value->rValue = here->BSIM4Igisl;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_IGS:
|
||||||
|
value->rValue = here->BSIM4Igs;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_IGD:
|
||||||
|
value->rValue = here->BSIM4Igd;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_IGB:
|
||||||
|
value->rValue = here->BSIM4Igb;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_IGCS:
|
||||||
|
value->rValue = here->BSIM4Igcs;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_IGCD:
|
||||||
|
value->rValue = here->BSIM4Igcd;
|
||||||
|
return(OK);
|
||||||
case BSIM4_GM:
|
case BSIM4_GM:
|
||||||
value->rValue = here->BSIM4gm;
|
value->rValue = here->BSIM4gm;
|
||||||
return(OK);
|
return(OK);
|
||||||
|
|
@ -197,25 +223,28 @@ BSIM4instance *here = (BSIM4instance*)inst;
|
||||||
case BSIM4_CQD:
|
case BSIM4_CQD:
|
||||||
value->rValue = *(ckt->CKTstate0 + here->BSIM4cqd);
|
value->rValue = *(ckt->CKTstate0 + here->BSIM4cqd);
|
||||||
return(OK);
|
return(OK);
|
||||||
case BSIM4_CGG:
|
case BSIM4_QS:
|
||||||
|
value->rValue = *(ckt->CKTstate0 + here->BSIM4qs);
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_CGGB:
|
||||||
value->rValue = here->BSIM4cggb;
|
value->rValue = here->BSIM4cggb;
|
||||||
return(OK);
|
return(OK);
|
||||||
case BSIM4_CGD:
|
case BSIM4_CGDB:
|
||||||
value->rValue = here->BSIM4cgdb;
|
value->rValue = here->BSIM4cgdb;
|
||||||
return(OK);
|
return(OK);
|
||||||
case BSIM4_CGS:
|
case BSIM4_CGSB:
|
||||||
value->rValue = here->BSIM4cgsb;
|
value->rValue = here->BSIM4cgsb;
|
||||||
return(OK);
|
return(OK);
|
||||||
case BSIM4_CDG:
|
case BSIM4_CDGB:
|
||||||
value->rValue = here->BSIM4cdgb;
|
value->rValue = here->BSIM4cdgb;
|
||||||
return(OK);
|
return(OK);
|
||||||
case BSIM4_CDD:
|
case BSIM4_CDDB:
|
||||||
value->rValue = here->BSIM4cddb;
|
value->rValue = here->BSIM4cddb;
|
||||||
return(OK);
|
return(OK);
|
||||||
case BSIM4_CDS:
|
case BSIM4_CDSB:
|
||||||
value->rValue = here->BSIM4cdsb;
|
value->rValue = here->BSIM4cdsb;
|
||||||
return(OK);
|
return(OK);
|
||||||
case BSIM4_CBG:
|
case BSIM4_CBGB:
|
||||||
value->rValue = here->BSIM4cbgb;
|
value->rValue = here->BSIM4cbgb;
|
||||||
return(OK);
|
return(OK);
|
||||||
case BSIM4_CBDB:
|
case BSIM4_CBDB:
|
||||||
|
|
@ -224,6 +253,27 @@ BSIM4instance *here = (BSIM4instance*)inst;
|
||||||
case BSIM4_CBSB:
|
case BSIM4_CBSB:
|
||||||
value->rValue = here->BSIM4cbsb;
|
value->rValue = here->BSIM4cbsb;
|
||||||
return(OK);
|
return(OK);
|
||||||
|
case BSIM4_CSGB:
|
||||||
|
value->rValue = here->BSIM4csgb;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_CSDB:
|
||||||
|
value->rValue = here->BSIM4csdb;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_CSSB:
|
||||||
|
value->rValue = here->BSIM4cssb;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_CGBB:
|
||||||
|
value->rValue = here->BSIM4cgbb;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_CDBB:
|
||||||
|
value->rValue = here->BSIM4cdbb;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_CSBB:
|
||||||
|
value->rValue = here->BSIM4csbb;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_CBBB:
|
||||||
|
value->rValue = here->BSIM4cbbb;
|
||||||
|
return(OK);
|
||||||
case BSIM4_CAPBD:
|
case BSIM4_CAPBD:
|
||||||
value->rValue = here->BSIM4capbd;
|
value->rValue = here->BSIM4capbd;
|
||||||
return(OK);
|
return(OK);
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4check.c of BSIM4.1.0.
|
* File: b4check.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
* Modified by Xuemei Xi, 04/06/2001.
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
* Modified by Xuemei Xi, 10/05/2001.
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -18,12 +19,12 @@
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "devdefs.h"
|
#include "devdefs.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
BSIM4checkModel(model, here, ckt)
|
BSIM4checkModel(model, here, ckt)
|
||||||
BSIM4model *model;
|
register BSIM4model *model;
|
||||||
BSIM4instance *here;
|
register BSIM4instance *here;
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
{
|
{
|
||||||
struct bsim4SizeDependParam *pParam;
|
struct bsim4SizeDependParam *pParam;
|
||||||
|
|
@ -33,22 +34,22 @@ FILE *fplog;
|
||||||
if ((fplog = fopen("bsim4.out", "w")) != NULL)
|
if ((fplog = fopen("bsim4.out", "w")) != NULL)
|
||||||
{ pParam = here->pParam;
|
{ pParam = here->pParam;
|
||||||
fprintf(fplog, "BSIM4: Berkeley Short Channel IGFET Model-4\n");
|
fprintf(fplog, "BSIM4: Berkeley Short Channel IGFET Model-4\n");
|
||||||
fprintf(fplog, "Developed by Dr. Weidong Liu, Xiaodong Jin, Kanyu M. Cao and Prof. Chenming Hu in 2000.\n");
|
fprintf(fplog, "Developed by Weidong Liu, Xuemei Xi , Xiaodong Jin, Kanyu M. Cao and Prof. Chenming Hu in 2001.\n");
|
||||||
fprintf(fplog, "\n");
|
fprintf(fplog, "\n");
|
||||||
fprintf(fplog, "++++++++++ BSIM4 PARAMETER CHECKING BELOW ++++++++++\n");
|
fprintf(fplog, "++++++++++ BSIM4 PARAMETER CHECKING BELOW ++++++++++\n");
|
||||||
|
|
||||||
if (strcmp(model->BSIM4version, "4.1.0") != 0)
|
if (strcmp(model->BSIM4version, "4.2.1") != 0)
|
||||||
{ fprintf(fplog, "Warning: This model is BSIM4.1.0; you specified a wrong version number.\n");
|
{ fprintf(fplog, "Warning: This model is BSIM4.2.1; you specified a wrong version number.\n");
|
||||||
printf("Warning: This model is BSIM4.1.0; you specified a wrong version number.\n");
|
printf("Warning: This model is BSIM4.2.1; you specified a wrong version number.\n");
|
||||||
}
|
}
|
||||||
fprintf(fplog, "Model = %s\n", model->BSIM4modName);
|
fprintf(fplog, "Model = %s\n", model->BSIM4modName);
|
||||||
|
|
||||||
|
|
||||||
if ((here->BSIM4rgateMod == 2) || (here->BSIM4rgateMod == 3))
|
if ((here->BSIM4rgateMod == 2) || (here->BSIM4rgateMod == 3))
|
||||||
{ if ((here->BSIM4trnqsMod == 1) || (here->BSIM4acnqsMod == 1))
|
{ if ((here->BSIM4trnqsMod == 1) || (here->BSIM4acnqsMod == 1))
|
||||||
{ fprintf(fplog, "Warning: You've selected both Rg and charge deficit NQS; select one only.\n");
|
{ fprintf(fplog, "Warning: You've selected both Rg and charge deficit NQS; select one only.\n");
|
||||||
printf("Warning: You've selected both Rg and charge deficit NQS; select one only.\n");
|
printf("Warning: You've selected both Rg and charge deficit NQS; select one only.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -211,10 +212,9 @@ FILE *fplog;
|
||||||
Fatal_Flag = 1;
|
Fatal_Flag = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((here->BSIM4l + model->BSIM4xl) <= model->BSIM4xgl)
|
||||||
if (here->BSIM4l <= model->BSIM4xgl)
|
{ fprintf(fplog, "Fatal: The parameter xgl must be smaller than Ldrawn+XL.\n");
|
||||||
{ fprintf(fplog, "Fatal: The parameter xgl must be smaller than Ldrawn.\n");
|
printf("Fatal: The parameter xgl must be smaller than Ldrawn+XL.\n");
|
||||||
printf("Fatal: The parameter xgl must be smaller than Ldrawn.\n");
|
|
||||||
Fatal_Flag = 1;
|
Fatal_Flag = 1;
|
||||||
}
|
}
|
||||||
if (model->BSIM4ngcon < 1.0)
|
if (model->BSIM4ngcon < 1.0)
|
||||||
|
|
@ -273,64 +273,65 @@ FILE *fplog;
|
||||||
pParam->BSIM4moin);
|
pParam->BSIM4moin);
|
||||||
printf("Warning: Moin = %g is too large.\n", pParam->BSIM4moin);
|
printf("Warning: Moin = %g is too large.\n", pParam->BSIM4moin);
|
||||||
}
|
}
|
||||||
|
if(model->BSIM4capMod ==2) {
|
||||||
if (pParam->BSIM4acde < 0.4)
|
if (pParam->BSIM4acde < 0.4)
|
||||||
{ fprintf(fplog, "Warning: Acde = %g is too small.\n",
|
{ fprintf(fplog, "Warning: Acde = %g is too small.\n",
|
||||||
pParam->BSIM4acde);
|
pParam->BSIM4acde);
|
||||||
printf("Warning: Acde = %g is too small.\n", pParam->BSIM4acde);
|
printf("Warning: Acde = %g is too small.\n", pParam->BSIM4acde);
|
||||||
}
|
}
|
||||||
if (pParam->BSIM4acde > 1.6)
|
if (pParam->BSIM4acde > 1.6)
|
||||||
{ fprintf(fplog, "Warning: Acde = %g is too large.\n",
|
{ fprintf(fplog, "Warning: Acde = %g is too large.\n",
|
||||||
pParam->BSIM4acde);
|
pParam->BSIM4acde);
|
||||||
printf("Warning: Acde = %g is too large.\n", pParam->BSIM4acde);
|
printf("Warning: Acde = %g is too large.\n", pParam->BSIM4acde);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (model->BSIM4paramChk ==1)
|
if (model->BSIM4paramChk ==1)
|
||||||
{
|
{
|
||||||
/* Check L and W parameters */
|
/* Check L and W parameters */
|
||||||
if (pParam->BSIM4leff <= 5.0e-8)
|
if (pParam->BSIM4leff <= 1.0e-9)
|
||||||
{ fprintf(fplog, "Warning: Leff = %g may be too small.\n",
|
{ fprintf(fplog, "Warning: Leff = %g <= 1.0e-9. Recommended Leff >= 1e-8 \n",
|
||||||
pParam->BSIM4leff);
|
pParam->BSIM4leff);
|
||||||
printf("Warning: Leff = %g may be too small.\n",
|
printf("Warning: Leff = %g <= 1.0e-9. Recommended Leff >= 1e-8 \n",
|
||||||
pParam->BSIM4leff);
|
pParam->BSIM4leff);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pParam->BSIM4leffCV <= 5.0e-8)
|
if (pParam->BSIM4leffCV <= 1.0e-9)
|
||||||
{ fprintf(fplog, "Warning: Leff for CV = %g may be too small.\n",
|
{ fprintf(fplog, "Warning: Leff for CV = %g <= 1.0e-9. Recommended LeffCV >=1e-8 \n",
|
||||||
|
pParam->BSIM4leffCV);
|
||||||
|
printf("Warning: Leff for CV = %g <= 1.0e-9. Recommended LeffCV >=1e-8 \n",
|
||||||
pParam->BSIM4leffCV);
|
pParam->BSIM4leffCV);
|
||||||
printf("Warning: Leff for CV = %g may be too small.\n",
|
|
||||||
pParam->BSIM4leffCV);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pParam->BSIM4weff <= 1.0e-7)
|
if (pParam->BSIM4weff <= 1.0e-9)
|
||||||
{ fprintf(fplog, "Warning: Weff = %g may be too small.\n",
|
{ fprintf(fplog, "Warning: Weff = %g <= 1.0e-9. Recommended Weff >=1e-7 \n",
|
||||||
pParam->BSIM4weff);
|
pParam->BSIM4weff);
|
||||||
printf("Warning: Weff = %g may be too small.\n",
|
printf("Warning: Weff = %g <= 1.0e-9. Recommended Weff >=1e-7 \n",
|
||||||
pParam->BSIM4weff);
|
pParam->BSIM4weff);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pParam->BSIM4weffCV <= 1.0e-7)
|
if (pParam->BSIM4weffCV <= 1.0e-9)
|
||||||
{ fprintf(fplog, "Warning: Weff for CV = %g may be too small.\n",
|
{ fprintf(fplog, "Warning: Weff for CV = %g <= 1.0e-9. Recommended WeffCV >= 1e-7 \n",
|
||||||
|
pParam->BSIM4weffCV);
|
||||||
|
printf("Warning: Weff for CV = %g <= 1.0e-9. Recommended WeffCV >= 1e-7 \n",
|
||||||
pParam->BSIM4weffCV);
|
pParam->BSIM4weffCV);
|
||||||
printf("Warning: Weff for CV = %g may be too small.\n",
|
|
||||||
pParam->BSIM4weffCV);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check threshold voltage parameters */
|
/* Check threshold voltage parameters */
|
||||||
if (model->BSIM4toxe < 1.0e-9)
|
if (model->BSIM4toxe < 1.0e-10)
|
||||||
{ fprintf(fplog, "Warning: Toxe = %g is less than 10A.\n",
|
{ fprintf(fplog, "Warning: Toxe = %g is less than 1A. Recommended Toxe >= 5A\n",
|
||||||
model->BSIM4toxe);
|
model->BSIM4toxe);
|
||||||
printf("Warning: Toxe = %g is less than 10A.\n", model->BSIM4toxe);
|
printf("Warning: Toxe = %g is less than 1A. Recommended Toxe >= 5A\n", model->BSIM4toxe);
|
||||||
}
|
}
|
||||||
if (model->BSIM4toxp < 1.0e-9)
|
if (model->BSIM4toxp < 1.0e-10)
|
||||||
{ fprintf(fplog, "Warning: Toxp = %g is less than 10A.\n",
|
{ fprintf(fplog, "Warning: Toxp = %g is less than 1A. Recommended Toxp >= 5A\n",
|
||||||
model->BSIM4toxp);
|
model->BSIM4toxp);
|
||||||
printf("Warning: Toxp = %g is less than 10A.\n", model->BSIM4toxp);
|
printf("Warning: Toxp = %g is less than 1A. Recommended Toxp >= 5A\n", model->BSIM4toxp);
|
||||||
}
|
}
|
||||||
if (model->BSIM4toxm < 1.0e-9)
|
if (model->BSIM4toxm < 1.0e-10)
|
||||||
{ fprintf(fplog, "Warning: Toxm = %g is less than 10A.\n",
|
{ fprintf(fplog, "Warning: Toxm = %g is less than 1A. Recommended Toxm >= 5A\n",
|
||||||
model->BSIM4toxm);
|
model->BSIM4toxm);
|
||||||
printf("Warning: Toxm = %g is less than 10A.\n", model->BSIM4toxm);
|
printf("Warning: Toxm = %g is less than 1A. Recommended Toxm >= 5A\n", model->BSIM4toxm);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pParam->BSIM4ndep <= 1.0e12)
|
if (pParam->BSIM4ndep <= 1.0e12)
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
/**** BSIM4.0.0, Released by Weidong Liu 3/24/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4cvtest.c of BSIM4.0.0.
|
* File: b4cvtest.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
|
*
|
||||||
|
* Modified by Xuemei Xi, 10/05/2001.
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -16,15 +19,16 @@
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "devdefs.h"
|
#include "devdefs.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
BSIM4convTest(inModel,ckt)
|
BSIM4convTest(inModel,ckt)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
register CKTcircuit *ckt;
|
||||||
{
|
{
|
||||||
BSIM4model *model = (BSIM4model*)inModel;
|
register BSIM4model *model = (BSIM4model*)inModel;
|
||||||
BSIM4instance *here;
|
register BSIM4instance *here;
|
||||||
double delvbd, delvbs, delvds, delvgd, delvgs;
|
double delvbd, delvbs, delvds, delvgd, delvgs;
|
||||||
double delvdbd, delvsbs;
|
double delvdbd, delvsbs;
|
||||||
double delvbd_jct, delvbs_jct;
|
double delvbd_jct, delvbs_jct;
|
||||||
|
|
@ -39,9 +43,7 @@ double tol0, tol1, tol2, tol3, tol4, tol5, tol6;
|
||||||
for (; model != NULL; model = model->BSIM4nextModel)
|
for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
{ for (here = model->BSIM4instances; here != NULL ;
|
{ for (here = model->BSIM4instances; here != NULL ;
|
||||||
here=here->BSIM4nextInstance)
|
here=here->BSIM4nextInstance)
|
||||||
{
|
{ vds = model->BSIM4type
|
||||||
if (here->BSIM4owner != ARCHme) continue;
|
|
||||||
vds = model->BSIM4type
|
|
||||||
* (*(ckt->CKTrhsOld + here->BSIM4dNodePrime)
|
* (*(ckt->CKTrhsOld + here->BSIM4dNodePrime)
|
||||||
- *(ckt->CKTrhsOld + here->BSIM4sNodePrime));
|
- *(ckt->CKTrhsOld + here->BSIM4sNodePrime));
|
||||||
vgs = model->BSIM4type
|
vgs = model->BSIM4type
|
||||||
|
|
@ -108,10 +110,11 @@ double tol0, tol1, tol2, tol3, tol4, tol5, tol6;
|
||||||
* delvds + here->BSIM4gIgbb * delvbs;
|
* delvds + here->BSIM4gIgbb * delvbs;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ Idtot = here->BSIM4cd + here->BSIM4cbd;
|
{ Idtot = here->BSIM4cd + here->BSIM4cbd - here->BSIM4Igisl;
|
||||||
cdhat = Idtot + here->BSIM4gbd * delvbd_jct + here->BSIM4gmbs
|
cdhat = Idtot + here->BSIM4gbd * delvbd_jct + here->BSIM4gmbs
|
||||||
* delvbd + here->BSIM4gm * delvgd
|
* delvbd + here->BSIM4gm * delvgd
|
||||||
- here->BSIM4gds * delvds;
|
- here->BSIM4gds * delvds - here->BSIM4ggislg * vgd
|
||||||
|
- here->BSIM4ggislb * vbd + here->BSIM4ggisls * vds;
|
||||||
|
|
||||||
Igstot = here->BSIM4Igs + here->BSIM4Igcd;
|
Igstot = here->BSIM4Igs + here->BSIM4Igcd;
|
||||||
cgshat = Igstot + here->BSIM4gIgsg * delvgs + here->BSIM4gIgcdg * delvgd
|
cgshat = Igstot + here->BSIM4gIgsg * delvgs + here->BSIM4gIgcdg * delvgd
|
||||||
|
|
@ -167,18 +170,20 @@ double tol0, tol1, tol2, tol3, tol4, tol5, tol6;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ibtot = here->BSIM4cbs + here->BSIM4cbd
|
Ibtot = here->BSIM4cbs + here->BSIM4cbd
|
||||||
- here->BSIM4Igidl - here->BSIM4csub;
|
- here->BSIM4Igidl - here->BSIM4Igisl - here->BSIM4csub;
|
||||||
if (here->BSIM4mode >= 0)
|
if (here->BSIM4mode >= 0)
|
||||||
{ cbhat = Ibtot + here->BSIM4gbd * delvbd_jct
|
{ cbhat = Ibtot + here->BSIM4gbd * delvbd_jct
|
||||||
+ here->BSIM4gbs * delvbs_jct - (here->BSIM4gbbs + here->BSIM4ggidlb)
|
+ here->BSIM4gbs * delvbs_jct - (here->BSIM4gbbs + here->BSIM4ggidlb)
|
||||||
* delvbs - (here->BSIM4gbgs + here->BSIM4ggidlg) * delvgs
|
* delvbs - (here->BSIM4gbgs + here->BSIM4ggidlg) * delvgs
|
||||||
- (here->BSIM4gbds + here->BSIM4ggidld) * delvds;
|
- (here->BSIM4gbds + here->BSIM4ggidld) * delvds
|
||||||
|
- here->BSIM4ggislg * delvgd - here->BSIM4ggislb* delvbd + here->BSIM4ggisls * delvds ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ cbhat = Ibtot + here->BSIM4gbs * delvbs_jct + here->BSIM4gbd
|
{ cbhat = Ibtot + here->BSIM4gbs * delvbs_jct + here->BSIM4gbd
|
||||||
* delvbd_jct - (here->BSIM4gbbs + here->BSIM4ggidlb) * delvbd
|
* delvbd_jct - (here->BSIM4gbbs + here->BSIM4ggidlb) * delvbd
|
||||||
- (here->BSIM4gbgs + here->BSIM4ggidlg) * delvgd
|
- (here->BSIM4gbgs + here->BSIM4ggidlg) * delvgd
|
||||||
+ (here->BSIM4gbds + here->BSIM4ggidld) * delvds;
|
+ (here->BSIM4gbds + here->BSIM4ggidld) * delvds
|
||||||
|
- here->BSIM4ggislg * delvgs - here->BSIM4ggislb * delvbs + here->BSIM4ggisls * delvds;
|
||||||
}
|
}
|
||||||
tol6 = ckt->CKTreltol * MAX(fabs(cbhat),
|
tol6 = ckt->CKTreltol * MAX(fabs(cbhat),
|
||||||
fabs(Ibtot)) + ckt->CKTabstol;
|
fabs(Ibtot)) + ckt->CKTabstol;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/1/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4del.c of BSIM4.1.0.
|
* File: b4del.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -14,6 +13,7 @@
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "gendefs.h"
|
#include "gendefs.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4dest.c of BSIM4.1.0.
|
* File: b4dest.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
BSIM4destroy(inModel)
|
BSIM4destroy(inModel)
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4geo.c of BSIM4.1.0.
|
* File: b4geo.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -261,7 +260,8 @@ double nuIntD = 0.0, nuEndD = 0.0, nuIntS = 0.0, nuEndS = 0.0;
|
||||||
*Rtot = Rint;
|
*Rtot = Rint;
|
||||||
else
|
else
|
||||||
*Rtot = Rint * Rend / (Rint + Rend);
|
*Rtot = Rint * Rend / (Rint + Rend);
|
||||||
|
if(*Rtot==0.0)
|
||||||
|
printf("Warning: Zero resistance returned from RdseffGeo\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4getic.c of BSIM4.1.0.
|
* File: b4getic.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -14,7 +13,7 @@
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -27,8 +26,7 @@ BSIM4instance *here;
|
||||||
|
|
||||||
for (; model ; model = model->BSIM4nextModel)
|
for (; model ; model = model->BSIM4nextModel)
|
||||||
{ for (here = model->BSIM4instances; here; here = here->BSIM4nextInstance)
|
{ for (here = model->BSIM4instances; here; here = here->BSIM4nextInstance)
|
||||||
{ if (here->BSIM4owner != ARCHme) continue;
|
{ if (!here->BSIM4icVDSGiven)
|
||||||
if (!here->BSIM4icVDSGiven)
|
|
||||||
{ here->BSIM4icVDS = *(ckt->CKTrhs + here->BSIM4dNode)
|
{ here->BSIM4icVDS = *(ckt->CKTrhs + here->BSIM4dNode)
|
||||||
- *(ckt->CKTrhs + here->BSIM4sNode);
|
- *(ckt->CKTrhs + here->BSIM4sNode);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4ld.c of BSIM4.1.0.
|
* File: b4ld.c of BSIM4.2.1.
|
||||||
* Author: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
* Modified by Xuemei Xi, 10/05/2001.
|
||||||
******/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
@ -18,7 +19,7 @@
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "devdefs.h"
|
#include "devdefs.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
#define MAX_EXP 5.834617425e14
|
#define MAX_EXP 5.834617425e14
|
||||||
#define MIN_EXP 1.713908431e-15
|
#define MIN_EXP 1.713908431e-15
|
||||||
|
|
@ -30,14 +31,15 @@
|
||||||
#define DELTA_3 0.02
|
#define DELTA_3 0.02
|
||||||
#define DELTA_4 0.02
|
#define DELTA_4 0.02
|
||||||
|
|
||||||
|
int BSIM4polyDepletion(double phi, double ngate,double coxe, double Vgs, double *Vgs_eff, double *dVgs_eff_dVg);
|
||||||
|
|
||||||
int
|
int
|
||||||
BSIM4load(inModel,ckt)
|
BSIM4load(inModel,ckt)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
register CKTcircuit *ckt;
|
||||||
{
|
{
|
||||||
BSIM4model *model = (BSIM4model*)inModel;
|
register BSIM4model *model = (BSIM4model*)inModel;
|
||||||
BSIM4instance *here;
|
register BSIM4instance *here;
|
||||||
|
|
||||||
double ceqgstot, dgstot_dvd, dgstot_dvg, dgstot_dvs, dgstot_dvb;
|
double ceqgstot, dgstot_dvd, dgstot_dvg, dgstot_dvs, dgstot_dvb;
|
||||||
double ceqgdtot, dgdtot_dvd, dgdtot_dvg, dgdtot_dvs, dgdtot_dvb;
|
double ceqgdtot, dgdtot_dvd, dgdtot_dvg, dgdtot_dvs, dgdtot_dvb;
|
||||||
|
|
@ -94,7 +96,7 @@ double Igstot, cgshat, Igdtot, cgdhat, Igbtot, cgbhat;
|
||||||
double Vgs_eff, Vfb, dVbs_dVb, Vth_NarrowW;
|
double Vgs_eff, Vfb, dVbs_dVb, Vth_NarrowW;
|
||||||
double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth, dVth_dVb, dVth_dVd;
|
double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth, dVth_dVb, dVth_dVd;
|
||||||
double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg, Nvtms, Nvtmd;
|
double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg, Nvtms, Nvtmd;
|
||||||
double Vgdt, Vgsaddvth, Vgsaddvth2, Vgsaddvth1o3,Vtm;
|
double Vgdt, Vgsaddvth, Vgsaddvth2, Vgsaddvth1o3, Vtm;
|
||||||
double n, dn_dVb, dn_dVd, voffcv, noff, dnoff_dVd, dnoff_dVb;
|
double n, dn_dVb, dn_dVd, voffcv, noff, dnoff_dVd, dnoff_dVb;
|
||||||
double ExpArg, ExpArg1, V0, CoxWLcen, QovCox, LINK;
|
double ExpArg, ExpArg1, V0, CoxWLcen, QovCox, LINK;
|
||||||
double DeltaPhi, dDeltaPhi_dVg;
|
double DeltaPhi, dDeltaPhi_dVg;
|
||||||
|
|
@ -164,6 +166,10 @@ double Cgg, Cgd, Cgs, Cgb, Cdg, Cdd, Cds, Cdb, Qg, Qd;
|
||||||
double Csg, Csd, Css, Csb, Cbg, Cbd, Cbs, Cbb, Qs, Qb;
|
double Csg, Csd, Css, Csb, Cbg, Cbd, Cbs, Cbb, Qs, Qb;
|
||||||
double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Csg1, Csd1, Csb1, Qac0, Qsub0;
|
double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Csg1, Csd1, Csb1, Qac0, Qsub0;
|
||||||
double dQac0_dVg, dQac0_dVb, dQsub0_dVg, dQsub0_dVd, dQsub0_dVb;
|
double dQac0_dVg, dQac0_dVb, dQsub0_dVg, dQsub0_dVd, dQsub0_dVb;
|
||||||
|
double ggidld, ggidlg, ggidlb,ggisld, ggislg, ggislb, ggisls;
|
||||||
|
double Igisl, Ggisld, Ggislg, Ggislb, Ggisls;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct bsim4SizeDependParam *pParam;
|
struct bsim4SizeDependParam *pParam;
|
||||||
int ByPass, ChargeComputationNeeded, error, Check, Check1, Check2;
|
int ByPass, ChargeComputationNeeded, error, Check, Check1, Check2;
|
||||||
|
|
@ -178,9 +184,7 @@ ChargeComputationNeeded =
|
||||||
for (; model != NULL; model = model->BSIM4nextModel)
|
for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
{ for (here = model->BSIM4instances; here != NULL;
|
{ for (here = model->BSIM4instances; here != NULL;
|
||||||
here = here->BSIM4nextInstance)
|
here = here->BSIM4nextInstance)
|
||||||
{
|
{ Check = Check1 = Check2 = 1;
|
||||||
if (here->BSIM4owner != ARCHme) continue;
|
|
||||||
Check = Check1 = Check2 = 1;
|
|
||||||
ByPass = 0;
|
ByPass = 0;
|
||||||
pParam = here->pParam;
|
pParam = here->pParam;
|
||||||
|
|
||||||
|
|
@ -375,11 +379,12 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
+ (here->BSIM4gm + here->BSIM4gbgs + here->BSIM4ggidlg) * delvgs
|
+ (here->BSIM4gm + here->BSIM4gbgs + here->BSIM4ggidlg) * delvgs
|
||||||
+ (here->BSIM4gds + here->BSIM4gbds + here->BSIM4ggidld) * delvds;
|
+ (here->BSIM4gds + here->BSIM4gbds + here->BSIM4ggidld) * delvds;
|
||||||
Ibtot = here->BSIM4cbs + here->BSIM4cbd
|
Ibtot = here->BSIM4cbs + here->BSIM4cbd
|
||||||
- here->BSIM4Igidl - here->BSIM4csub;
|
- here->BSIM4Igidl - here->BSIM4Igisl - here->BSIM4csub;
|
||||||
cbhat = Ibtot + here->BSIM4gbd * delvbd_jct
|
cbhat = Ibtot + here->BSIM4gbd * delvbd_jct
|
||||||
+ here->BSIM4gbs * delvbs_jct - (here->BSIM4gbbs + here->BSIM4ggidlb)
|
+ here->BSIM4gbs * delvbs_jct - (here->BSIM4gbbs + here->BSIM4ggidlb)
|
||||||
* delvbs - (here->BSIM4gbgs + here->BSIM4ggidlg) * delvgs
|
* delvbs - (here->BSIM4gbgs + here->BSIM4ggidlg) * delvgs
|
||||||
- (here->BSIM4gbds + here->BSIM4ggidld) * delvds;
|
- (here->BSIM4gbds + here->BSIM4ggidld) * delvds
|
||||||
|
- here->BSIM4ggislg * delvgd - here->BSIM4ggislb* delvbd + here->BSIM4ggisls * delvds ;
|
||||||
|
|
||||||
Igstot = here->BSIM4Igs + here->BSIM4Igcs;
|
Igstot = here->BSIM4Igs + here->BSIM4Igcs;
|
||||||
cgshat = Igstot + (here->BSIM4gIgsg + here->BSIM4gIgcsg) * delvgs
|
cgshat = Igstot + (here->BSIM4gIgsg + here->BSIM4gIgcsg) * delvgs
|
||||||
|
|
@ -394,16 +399,18 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
* delvds + here->BSIM4gIgbb * delvbs;
|
* delvds + here->BSIM4gIgbb * delvbs;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ Idtot = here->BSIM4cd + here->BSIM4cbd;
|
{ Idtot = here->BSIM4cd + here->BSIM4cbd - here->BSIM4Igisl;
|
||||||
cdhat = Idtot + here->BSIM4gbd * delvbd_jct + here->BSIM4gmbs
|
cdhat = Idtot + here->BSIM4gbd * delvbd_jct + here->BSIM4gmbs
|
||||||
* delvbd + here->BSIM4gm * delvgd
|
* delvbd + here->BSIM4gm * delvgd
|
||||||
- here->BSIM4gds * delvds;
|
- here->BSIM4gds * delvds - here->BSIM4ggislg * vgd
|
||||||
|
- here->BSIM4ggislb * vbd + here->BSIM4ggisls * vds;
|
||||||
Ibtot = here->BSIM4cbs + here->BSIM4cbd
|
Ibtot = here->BSIM4cbs + here->BSIM4cbd
|
||||||
- here->BSIM4Igidl - here->BSIM4csub;
|
- here->BSIM4Igidl - here->BSIM4Igisl - here->BSIM4csub;
|
||||||
cbhat = Ibtot + here->BSIM4gbs * delvbs_jct + here->BSIM4gbd
|
cbhat = Ibtot + here->BSIM4gbs * delvbs_jct + here->BSIM4gbd
|
||||||
* delvbd_jct - (here->BSIM4gbbs + here->BSIM4ggidlb) * delvbd
|
* delvbd_jct - (here->BSIM4gbbs + here->BSIM4ggidlb) * delvbd
|
||||||
- (here->BSIM4gbgs + here->BSIM4ggidlg) * delvgd
|
- (here->BSIM4gbgs + here->BSIM4ggidlg) * delvgd
|
||||||
+ (here->BSIM4gbds + here->BSIM4ggidld) * delvds;
|
+ (here->BSIM4gbds + here->BSIM4ggidld) * delvds
|
||||||
|
- here->BSIM4ggislg * delvgs - here->BSIM4ggislb * delvbs + here->BSIM4ggisls * delvds;
|
||||||
|
|
||||||
Igstot = here->BSIM4Igs + here->BSIM4Igcd;
|
Igstot = here->BSIM4Igs + here->BSIM4Igcd;
|
||||||
cgshat = Igstot + here->BSIM4gIgsg * delvgs + here->BSIM4gIgcdg * delvgd
|
cgshat = Igstot + here->BSIM4gIgsg * delvgs + here->BSIM4gIgcdg * delvgd
|
||||||
|
|
@ -428,6 +435,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
+ here->BSIM4gdtotd * delvds + here->BSIM4gdtotg * delvgs
|
+ here->BSIM4gdtotd * delvds + here->BSIM4gdtotg * delvgs
|
||||||
+ here->BSIM4gdtotb * delvbs;
|
+ here->BSIM4gdtotb * delvbs;
|
||||||
|
|
||||||
|
|
||||||
#ifndef NOBYPASS
|
#ifndef NOBYPASS
|
||||||
/* Following should be one IF statement, but some C compilers
|
/* Following should be one IF statement, but some C compilers
|
||||||
* can't handle that all at once, so we split it into several
|
* can't handle that all at once, so we split it into several
|
||||||
|
|
@ -521,6 +529,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
goto line850;
|
goto line850;
|
||||||
}
|
}
|
||||||
#endif /*NOBYPASS*/
|
#endif /*NOBYPASS*/
|
||||||
|
|
||||||
von = here->BSIM4von;
|
von = here->BSIM4von;
|
||||||
if (*(ckt->CKTstate0 + here->BSIM4vds) >= 0.0)
|
if (*(ckt->CKTstate0 + here->BSIM4vds) >= 0.0)
|
||||||
{ vgs = DEVfetlim(vgs, *(ckt->CKTstate0 + here->BSIM4vgs), von);
|
{ vgs = DEVfetlim(vgs, *(ckt->CKTstate0 + here->BSIM4vgs), von);
|
||||||
|
|
@ -918,7 +927,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
T3 = T2 * T2;
|
T3 = T2 * T2;
|
||||||
T4 = T3 + 2.0 * T1 * MIN_EXP;
|
T4 = T3 + 2.0 * T1 * MIN_EXP;
|
||||||
T5 = T1 / T4;
|
T5 = T1 / T4;
|
||||||
dT1_dVb = -T0 * T1 * dlt1_dVb / lt1;
|
dT1_dVb = -T0 * T1 * dltw_dVb / ltw; /* bugfix -JX */
|
||||||
dT5_dVb = dT1_dVb * (T4 - 2.0 * T1 * (T2 + MIN_EXP)) / T4 / T4;
|
dT5_dVb = dT1_dVb * (T4 - 2.0 * T1 * (T2 + MIN_EXP)) / T4 / T4;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1015,24 +1024,24 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
|
|
||||||
/* Poly Gate Si Depletion Effect */
|
/* Poly Gate Si Depletion Effect */
|
||||||
T0 = pParam->BSIM4vfb + pParam->BSIM4phi;
|
T0 = pParam->BSIM4vfb + pParam->BSIM4phi;
|
||||||
if ((pParam->BSIM4ngate > 1.0e18)
|
|
||||||
&& (pParam->BSIM4ngate < 1.0e25) && (Vgs > T0))
|
BSIM4polyDepletion(T0, pParam->BSIM4ngate, model->BSIM4coxe, vgs, &vgs_eff, &dvgs_eff_dvg);
|
||||||
{ T1 = 1.0e6 * Charge_q * EPSSI * pParam->BSIM4ngate
|
|
||||||
/ (model->BSIM4coxe * model->BSIM4coxe);
|
BSIM4polyDepletion(T0, pParam->BSIM4ngate, model->BSIM4coxe, vgd, &vgd_eff, &dvgd_eff_dvg);
|
||||||
T8 = Vgs - T0;
|
|
||||||
T4 = sqrt(1.0 + 2.0 * T8 / T1);
|
if(here->BSIM4mode>0) {
|
||||||
T2 = 2.0 * T8 / (T4 + 1.0);
|
Vgs_eff = vgs_eff;
|
||||||
T3 = 0.5 * T2 * T2 / T1; /* T3 = Vpoly */
|
dVgs_eff_dVg = dvgs_eff_dvg;
|
||||||
T7 = 1.12 - T3 - 0.05;
|
} else {
|
||||||
T6 = sqrt(T7 * T7 + 0.224);
|
Vgs_eff = vgd_eff;
|
||||||
T5 = 1.12 - 0.5 * (T7 + T6);
|
dVgs_eff_dVg = dvgd_eff_dvg;
|
||||||
Vgs_eff = Vgs - T5;
|
}
|
||||||
dVgs_eff_dVg = 1.0 - (0.5 - 0.5 / T4) * (1.0 + T7 / T6);
|
here->BSIM4vgs_eff = vgs_eff;
|
||||||
}
|
here->BSIM4vgd_eff = vgd_eff;
|
||||||
else
|
here->BSIM4dvgs_eff_dvg = dvgs_eff_dvg;
|
||||||
{ Vgs_eff = Vgs;
|
here->BSIM4dvgd_eff_dvg = dvgd_eff_dvg;
|
||||||
dVgs_eff_dVg = 1.0;
|
|
||||||
}
|
|
||||||
Vgst = Vgs_eff - Vth;
|
Vgst = Vgs_eff - Vth;
|
||||||
|
|
||||||
/* Calculate Vgsteff */
|
/* Calculate Vgsteff */
|
||||||
|
|
@ -1852,14 +1861,17 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate GIDL current */
|
/* Calculate GIDL current */
|
||||||
|
vgs_eff = here->BSIM4vgs_eff;
|
||||||
|
dvgs_eff_dvg = here->BSIM4dvgs_eff_dvg;
|
||||||
T0 = 3.0 * model->BSIM4toxe;
|
T0 = 3.0 * model->BSIM4toxe;
|
||||||
T1 = (Vds - Vgs_eff - pParam->BSIM4egidl) / T0;
|
|
||||||
if ((pParam->BSIM4agidl <= 0.0) || (pParam->BSIM4bgidl <= 0.0) || (T1 < 0.0)
|
T1 = (vds - vgs_eff - pParam->BSIM4egidl ) / T0;
|
||||||
|| (pParam->BSIM4cgidl <= 0.0) || (Vdb < 0.0))
|
if ((pParam->BSIM4agidl <= 0.0) || (pParam->BSIM4bgidl <= 0.0)
|
||||||
|
|| (T1 <= 0.0) || (pParam->BSIM4cgidl <= 0.0) || (vbd > 0.0))
|
||||||
Igidl = Ggidld = Ggidlg = Ggidlb = 0.0;
|
Igidl = Ggidld = Ggidlg = Ggidlb = 0.0;
|
||||||
else
|
else {
|
||||||
{ dT1_dVd = 1.0 / T0;
|
dT1_dVd = 1.0 / T0;
|
||||||
dT1_dVg = -dVgs_eff_dVg * dT1_dVd;
|
dT1_dVg = -dvgs_eff_dvg * dT1_dVd;
|
||||||
T2 = pParam->BSIM4bgidl / T1;
|
T2 = pParam->BSIM4bgidl / T1;
|
||||||
if (T2 < 100.0)
|
if (T2 < 100.0)
|
||||||
{ Igidl = pParam->BSIM4agidl * pParam->BSIM4weffCJ * T1 * exp(-T2);
|
{ Igidl = pParam->BSIM4agidl * pParam->BSIM4weffCJ * T1 * exp(-T2);
|
||||||
|
|
@ -1867,28 +1879,69 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
Ggidld = T3 * dT1_dVd;
|
Ggidld = T3 * dT1_dVd;
|
||||||
Ggidlg = T3 * dT1_dVg;
|
Ggidlg = T3 * dT1_dVg;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ Igidl = pParam->BSIM4agidl * pParam->BSIM4weffCJ * 3.720075976e-44;
|
{ Igidl = pParam->BSIM4agidl * pParam->BSIM4weffCJ * 3.720075976e-44;
|
||||||
Ggidld = Igidl * dT1_dVd;
|
Ggidld = Igidl * dT1_dVd;
|
||||||
Ggidlg = Igidl * dT1_dVg;
|
Ggidlg = Igidl * dT1_dVg;
|
||||||
Igidl *= T1;
|
Igidl *= T1;
|
||||||
}
|
}
|
||||||
|
|
||||||
T4 = Vdb * Vdb;
|
T4 = vbd * vbd;
|
||||||
T5 = Vdb * T4;
|
T5 = -vbd * T4;
|
||||||
T6 = pParam->BSIM4cgidl + T5;
|
T6 = pParam->BSIM4cgidl + T5;
|
||||||
T7 = T5 / T6;
|
T7 = T5 / T6;
|
||||||
T8 = 3.0 * pParam->BSIM4cgidl * T4 / T6 / T6;
|
T8 = 3.0 * pParam->BSIM4cgidl * T4 / T6 / T6;
|
||||||
Ggidld = Ggidld * T7 + Igidl * T8;
|
Ggidld = Ggidld * T7 + Igidl * T8;
|
||||||
Ggidlg = Ggidlg * T7;
|
Ggidlg = Ggidlg * T7;
|
||||||
Ggidlb = -Igidl * T8;
|
Ggidlb = -Igidl * T8;
|
||||||
Igidl *= T7;
|
Igidl *= T7;
|
||||||
}
|
}
|
||||||
here->BSIM4Igidl = Igidl;
|
here->BSIM4Igidl = Igidl;
|
||||||
here->BSIM4ggidld = Ggidld;
|
here->BSIM4ggidld = Ggidld;
|
||||||
here->BSIM4ggidlg = Ggidlg;
|
here->BSIM4ggidlg = Ggidlg;
|
||||||
here->BSIM4ggidlb = Ggidlb;
|
here->BSIM4ggidlb = Ggidlb;
|
||||||
|
|
||||||
|
/* Calculate GISL current: bugfix recommended by TI -JX */
|
||||||
|
vgd_eff = here->BSIM4vgd_eff;
|
||||||
|
dvgd_eff_dvg = here->BSIM4dvgd_eff_dvg;
|
||||||
|
|
||||||
|
T1 = (-vds - vgd_eff - pParam->BSIM4egidl ) / T0;
|
||||||
|
|
||||||
|
if ((pParam->BSIM4agidl <= 0.0) || (pParam->BSIM4bgidl <= 0.0)
|
||||||
|
|| (T1 <= 0.0) || (pParam->BSIM4cgidl <= 0.0) || (vbs > 0.0))
|
||||||
|
Igisl = Ggisls = Ggislg = Ggislb = 0.0;
|
||||||
|
else {
|
||||||
|
dT1_dVd = 1.0 / T0;
|
||||||
|
dT1_dVg = -dvgd_eff_dvg * dT1_dVd;
|
||||||
|
T2 = pParam->BSIM4bgidl / T1;
|
||||||
|
if (T2 < 100.0)
|
||||||
|
{ Igisl = pParam->BSIM4agidl * pParam->BSIM4weffCJ * T1 * exp(-T2);
|
||||||
|
T3 = Igisl * (1.0 + T2) / T1;
|
||||||
|
Ggisls = T3 * dT1_dVd;
|
||||||
|
Ggislg = T3 * dT1_dVg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ Igisl = pParam->BSIM4agidl * pParam->BSIM4weffCJ * 3.720075976e-44;
|
||||||
|
Ggisls = Igisl * dT1_dVd;
|
||||||
|
Ggislg = Igisl * dT1_dVg;
|
||||||
|
Igisl *= T1;
|
||||||
|
}
|
||||||
|
|
||||||
|
T4 = vbs * vbs;
|
||||||
|
T5 = -vbs * T4;
|
||||||
|
T6 = pParam->BSIM4cgidl + T5;
|
||||||
|
T7 = T5 / T6;
|
||||||
|
T8 = 3.0 * pParam->BSIM4cgidl * T4 / T6 / T6;
|
||||||
|
Ggisls = Ggisls * T7 + Igisl * T8;
|
||||||
|
Ggislg = Ggislg * T7;
|
||||||
|
Ggislb = -Igisl * T8;
|
||||||
|
Igisl *= T7;
|
||||||
|
}
|
||||||
|
here->BSIM4Igisl = Igisl;
|
||||||
|
here->BSIM4ggisls = Ggisls;
|
||||||
|
here->BSIM4ggislg = Ggislg;
|
||||||
|
here->BSIM4ggislb = Ggislb;
|
||||||
|
|
||||||
|
|
||||||
/* Calculate gate tunneling current */
|
/* Calculate gate tunneling current */
|
||||||
if ((model->BSIM4igcMod != 0) || (model->BSIM4igbMod != 0))
|
if ((model->BSIM4igcMod != 0) || (model->BSIM4igbMod != 0))
|
||||||
|
|
@ -1993,75 +2046,74 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
dIgc_dVd = T11 * (T2 * dT6_dVd + T6 * dT2_dVd);
|
dIgc_dVd = T11 * (T2 * dT6_dVd + T6 * dT2_dVd);
|
||||||
dIgc_dVb = T11 * (T2 * dT6_dVb + T6 * dT2_dVb);
|
dIgc_dVb = T11 * (T2 * dT6_dVb + T6 * dT2_dVb);
|
||||||
|
|
||||||
if (model->BSIM4pigcdGiven)
|
if (model->BSIM4pigcdGiven)
|
||||||
{ Pigcd = pParam->BSIM4pigcd;
|
{ Pigcd = pParam->BSIM4pigcd;
|
||||||
dPigcd_dVg = dPigcd_dVd = dPigcd_dVb = 0.0;
|
dPigcd_dVg = dPigcd_dVd = dPigcd_dVb = 0.0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ T11 = pParam->BSIM4Bechvb * model->BSIM4toxe;
|
{ T11 = pParam->BSIM4Bechvb * model->BSIM4toxe;
|
||||||
T12 = Vgsteff + 1.0e-20;
|
T12 = Vgsteff + 1.0e-20;
|
||||||
T13 = T11 / T12 / T12;
|
T13 = T11 / T12 / T12;
|
||||||
T14 = -T13 / T12;
|
T14 = -T13 / T12;
|
||||||
Pigcd = T13 * (1.0 - 0.5 * Vdseff / T12);
|
Pigcd = T13 * (1.0 - 0.5 * Vdseff / T12);
|
||||||
dPigcd_dVg = T14 * (2.0 + 0.5 * (dVdseff_dVg
|
dPigcd_dVg = T14 * (2.0 + 0.5 * (dVdseff_dVg
|
||||||
* Vgsteff - 3.0 * Vdseff) / T12);
|
* Vgsteff - 3.0 * Vdseff) / T12);
|
||||||
dPigcd_dVd = 0.5 * T14 * dVdseff_dVd
|
dPigcd_dVd = 0.5 * T14 * dVdseff_dVd
|
||||||
+ dPigcd_dVg * dVgsteff_dVd;
|
+ dPigcd_dVg * dVgsteff_dVd;
|
||||||
dPigcd_dVb = 0.5 * T14 * dVdseff_dVb
|
dPigcd_dVb = 0.5 * T14 * dVdseff_dVb
|
||||||
+ dPigcd_dVg * dVgsteff_dVb;
|
+ dPigcd_dVg * dVgsteff_dVb;
|
||||||
dPigcd_dVg *= dVgsteff_dVg;
|
dPigcd_dVg *= dVgsteff_dVg;
|
||||||
}
|
}
|
||||||
|
|
||||||
T7 = -Pigcd * Vds;
|
T7 = -Pigcd * Vds;
|
||||||
dT7_dVg = -Vds * dPigcd_dVg;
|
dT7_dVg = -Vds * dPigcd_dVg;
|
||||||
dT7_dVd = -Pigcd - Vds * dPigcd_dVd;
|
dT7_dVd = -Pigcd - Vds * dPigcd_dVd;
|
||||||
dT7_dVb = -Vds * dPigcd_dVb;
|
dT7_dVb = -Vds * dPigcd_dVb;
|
||||||
T8 = T7 * T7 + 2.0e-4;
|
T8 = T7 * T7 + 2.0e-4;
|
||||||
dT8_dVg = 2.0 * T7;
|
dT8_dVg = 2.0 * T7;
|
||||||
dT8_dVd = dT8_dVg * dT7_dVd;
|
dT8_dVd = dT8_dVg * dT7_dVd;
|
||||||
dT8_dVb = dT8_dVg * dT7_dVb;
|
dT8_dVb = dT8_dVg * dT7_dVb;
|
||||||
dT8_dVg *= dT7_dVg;
|
dT8_dVg *= dT7_dVg;
|
||||||
|
|
||||||
if (T7 > EXP_THRESHOLD)
|
if (T7 > EXP_THRESHOLD)
|
||||||
{ T9 = MAX_EXP;
|
{ T9 = MAX_EXP;
|
||||||
dT9_dVg = dT9_dVd = dT9_dVb = 0.0;
|
dT9_dVg = dT9_dVd = dT9_dVb = 0.0;
|
||||||
}
|
}
|
||||||
else if (T7 < -EXP_THRESHOLD)
|
else if (T7 < -EXP_THRESHOLD)
|
||||||
{ T9 = MIN_EXP;
|
{ T9 = MIN_EXP;
|
||||||
dT9_dVg = dT9_dVd = dT9_dVb = 0.0;
|
dT9_dVg = dT9_dVd = dT9_dVb = 0.0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ T9 = exp(T7);
|
{ T9 = exp(T7);
|
||||||
dT9_dVg = T9 * dT7_dVg;
|
dT9_dVg = T9 * dT7_dVg;
|
||||||
dT9_dVd = T9 * dT7_dVd;
|
dT9_dVd = T9 * dT7_dVd;
|
||||||
dT9_dVb = T9 * dT7_dVb;
|
dT9_dVb = T9 * dT7_dVb;
|
||||||
}
|
}
|
||||||
|
|
||||||
T0 = T8 * T8;
|
T0 = T8 * T8;
|
||||||
T1 = T9 - 1.0 + 1.0e-4;
|
T1 = T9 - 1.0 + 1.0e-4;
|
||||||
T10 = (T1 - T7) / T8;
|
T10 = (T1 - T7) / T8;
|
||||||
dT10_dVg = (dT9_dVg - dT7_dVg - T10 * dT8_dVg) / T8;
|
dT10_dVg = (dT9_dVg - dT7_dVg - T10 * dT8_dVg) / T8;
|
||||||
dT10_dVd = (dT9_dVd - dT7_dVd - T10 * dT8_dVd) / T8;
|
dT10_dVd = (dT9_dVd - dT7_dVd - T10 * dT8_dVd) / T8;
|
||||||
dT10_dVb = (dT9_dVb - dT7_dVb - T10 * dT8_dVb) / T8;
|
dT10_dVb = (dT9_dVb - dT7_dVb - T10 * dT8_dVb) / T8;
|
||||||
|
|
||||||
Igcs = Igc * T10;
|
Igcs = Igc * T10;
|
||||||
dIgcs_dVg = dIgc_dVg * T10 + Igc * dT10_dVg;
|
dIgcs_dVg = dIgc_dVg * T10 + Igc * dT10_dVg;
|
||||||
dIgcs_dVd = dIgc_dVd * T10 + Igc * dT10_dVd;
|
dIgcs_dVd = dIgc_dVd * T10 + Igc * dT10_dVd;
|
||||||
dIgcs_dVb = dIgc_dVb * T10 + Igc * dT10_dVb;
|
dIgcs_dVb = dIgc_dVb * T10 + Igc * dT10_dVb;
|
||||||
|
|
||||||
T1 = T9 - 1.0 - 1.0e-4;
|
|
||||||
T10 = (T7 * T9 - T1) / T8;
|
|
||||||
dT10_dVg = (dT7_dVg * T9 + (T7 - 1.0) * dT9_dVg
|
|
||||||
- T10 * dT8_dVg) / T8;
|
|
||||||
dT10_dVd = (dT7_dVd * T9 + (T7 - 1.0) * dT9_dVd
|
|
||||||
- T10 * dT8_dVd) / T8;
|
|
||||||
dT10_dVb = (dT7_dVb * T9 + (T7 - 1.0) * dT9_dVb
|
|
||||||
- T10 * dT8_dVb) / T8;
|
|
||||||
Igcd = Igc * T10;
|
|
||||||
dIgcd_dVg = dIgc_dVg * T10 + Igc * dT10_dVg;
|
|
||||||
dIgcd_dVd = dIgc_dVd * T10 + Igc * dT10_dVd;
|
|
||||||
dIgcd_dVb = dIgc_dVb * T10 + Igc * dT10_dVb;
|
|
||||||
|
|
||||||
|
T1 = T9 - 1.0 - 1.0e-4;
|
||||||
|
T10 = (T7 * T9 - T1) / T8;
|
||||||
|
dT10_dVg = (dT7_dVg * T9 + (T7 - 1.0) * dT9_dVg
|
||||||
|
- T10 * dT8_dVg) / T8;
|
||||||
|
dT10_dVd = (dT7_dVd * T9 + (T7 - 1.0) * dT9_dVd
|
||||||
|
- T10 * dT8_dVd) / T8;
|
||||||
|
dT10_dVb = (dT7_dVb * T9 + (T7 - 1.0) * dT9_dVb
|
||||||
|
- T10 * dT8_dVb) / T8;
|
||||||
|
Igcd = Igc * T10;
|
||||||
|
dIgcd_dVg = dIgc_dVg * T10 + Igc * dT10_dVg;
|
||||||
|
dIgcd_dVd = dIgc_dVd * T10 + Igc * dT10_dVd;
|
||||||
|
dIgcd_dVb = dIgc_dVb * T10 + Igc * dT10_dVb;
|
||||||
|
|
||||||
here->BSIM4Igcs = Igcs;
|
here->BSIM4Igcs = Igcs;
|
||||||
here->BSIM4gIgcsg = dIgcs_dVg;
|
here->BSIM4gIgcsg = dIgcs_dVg;
|
||||||
|
|
@ -2072,7 +2124,6 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
here->BSIM4gIgcdd = dIgcd_dVd;
|
here->BSIM4gIgcdd = dIgcd_dVd;
|
||||||
here->BSIM4gIgcdb = dIgcd_dVb * dVbseff_dVb;
|
here->BSIM4gIgcdb = dIgcd_dVb * dVbseff_dVb;
|
||||||
|
|
||||||
|
|
||||||
T0 = vgs - pParam->BSIM4vfbsd;
|
T0 = vgs - pParam->BSIM4vfbsd;
|
||||||
vgs_eff = sqrt(T0 * T0 + 1.0e-4);
|
vgs_eff = sqrt(T0 * T0 + 1.0e-4);
|
||||||
dvgs_eff_dvg = T0 / vgs_eff;
|
dvgs_eff_dvg = T0 / vgs_eff;
|
||||||
|
|
@ -2281,6 +2332,11 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
here->BSIM4ggidlg *= here->BSIM4nf;
|
here->BSIM4ggidlg *= here->BSIM4nf;
|
||||||
here->BSIM4ggidlb *= here->BSIM4nf;
|
here->BSIM4ggidlb *= here->BSIM4nf;
|
||||||
|
|
||||||
|
here->BSIM4Igisl *= here->BSIM4nf;
|
||||||
|
here->BSIM4ggisls *= here->BSIM4nf;
|
||||||
|
here->BSIM4ggislg *= here->BSIM4nf;
|
||||||
|
here->BSIM4ggislb *= here->BSIM4nf;
|
||||||
|
|
||||||
here->BSIM4Igcs *= here->BSIM4nf;
|
here->BSIM4Igcs *= here->BSIM4nf;
|
||||||
here->BSIM4gIgcsg *= here->BSIM4nf;
|
here->BSIM4gIgcsg *= here->BSIM4nf;
|
||||||
here->BSIM4gIgcsd *= here->BSIM4nf;
|
here->BSIM4gIgcsd *= here->BSIM4nf;
|
||||||
|
|
@ -2305,6 +2361,8 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
|
|
||||||
here->BSIM4ggidls = -(here->BSIM4ggidld + here->BSIM4ggidlg
|
here->BSIM4ggidls = -(here->BSIM4ggidld + here->BSIM4ggidlg
|
||||||
+ here->BSIM4ggidlb);
|
+ here->BSIM4ggidlb);
|
||||||
|
here->BSIM4ggisld = -(here->BSIM4ggisls + here->BSIM4ggislg
|
||||||
|
+ here->BSIM4ggislb);
|
||||||
here->BSIM4gIgbs = -(here->BSIM4gIgbg + here->BSIM4gIgbd
|
here->BSIM4gIgbs = -(here->BSIM4gIgbg + here->BSIM4gIgbd
|
||||||
+ here->BSIM4gIgbb);
|
+ here->BSIM4gIgbb);
|
||||||
here->BSIM4gIgcss = -(here->BSIM4gIgcsg + here->BSIM4gIgcsd
|
here->BSIM4gIgcss = -(here->BSIM4gIgcsg + here->BSIM4gIgcsd
|
||||||
|
|
@ -2314,30 +2372,30 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
here->BSIM4cd = cdrain;
|
here->BSIM4cd = cdrain;
|
||||||
|
|
||||||
|
|
||||||
if (model->BSIM4tnoiMod == 0)
|
if (model->BSIM4tnoiMod == 0)
|
||||||
{ Abulk = Abulk0 * pParam->BSIM4abulkCVfactor;
|
{ Abulk = Abulk0 * pParam->BSIM4abulkCVfactor;
|
||||||
Vdsat = Vgsteff / Abulk;
|
Vdsat = Vgsteff / Abulk;
|
||||||
T0 = Vdsat - Vds - DELTA_4;
|
T0 = Vdsat - Vds - DELTA_4;
|
||||||
T1 = sqrt(T0 * T0 + 4.0 * DELTA_4 * Vdsat);
|
T1 = sqrt(T0 * T0 + 4.0 * DELTA_4 * Vdsat);
|
||||||
if (T0 >= 0.0)
|
if (T0 >= 0.0)
|
||||||
Vdseff = Vdsat - 0.5 * (T0 + T1);
|
Vdseff = Vdsat - 0.5 * (T0 + T1);
|
||||||
else
|
else
|
||||||
{ T3 = (DELTA_4 + DELTA_4) / (T1 - T0);
|
{ T3 = (DELTA_4 + DELTA_4) / (T1 - T0);
|
||||||
T4 = 1.0 - T3;
|
T4 = 1.0 - T3;
|
||||||
T5 = Vdsat * T3 / (T1 - T0);
|
T5 = Vdsat * T3 / (T1 - T0);
|
||||||
Vdseff = Vdsat * T4;
|
Vdseff = Vdsat * T4;
|
||||||
}
|
}
|
||||||
if (Vds == 0.0)
|
if (Vds == 0.0)
|
||||||
Vdseff = 0.0;
|
Vdseff = 0.0;
|
||||||
|
|
||||||
T0 = Abulk * Vdseff;
|
T0 = Abulk * Vdseff;
|
||||||
T1 = 12.0 * (Vgsteff - 0.5 * T0 + 1.0e-20);
|
T1 = 12.0 * (Vgsteff - 0.5 * T0 + 1.0e-20);
|
||||||
T2 = Vdseff / T1;
|
T2 = Vdseff / T1;
|
||||||
T3 = T0 * T2;
|
T3 = T0 * T2;
|
||||||
here->BSIM4qinv = Coxeff * pParam->BSIM4weffCV * here->BSIM4nf
|
here->BSIM4qinv = Coxeff * pParam->BSIM4weffCV * here->BSIM4nf
|
||||||
* pParam->BSIM4leffCV
|
* pParam->BSIM4leffCV
|
||||||
* (Vgsteff - 0.5 * T0 + Abulk * T3);
|
* (Vgsteff - 0.5 * T0 + Abulk * T3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BSIM4 C-V begins
|
* BSIM4 C-V begins
|
||||||
|
|
@ -2348,6 +2406,8 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
here->BSIM4cggb = here->BSIM4cgsb = here->BSIM4cgdb = 0.0;
|
here->BSIM4cggb = here->BSIM4cgsb = here->BSIM4cgdb = 0.0;
|
||||||
here->BSIM4cdgb = here->BSIM4cdsb = here->BSIM4cddb = 0.0;
|
here->BSIM4cdgb = here->BSIM4cdsb = here->BSIM4cddb = 0.0;
|
||||||
here->BSIM4cbgb = here->BSIM4cbsb = here->BSIM4cbdb = 0.0;
|
here->BSIM4cbgb = here->BSIM4cbsb = here->BSIM4cbdb = 0.0;
|
||||||
|
here->BSIM4csgb = here->BSIM4cssb = here->BSIM4csdb = 0.0;
|
||||||
|
here->BSIM4cgbb = here->BSIM4csbb = here->BSIM4cdbb = here->BSIM4cbbb = 0.0;
|
||||||
here->BSIM4cqdb = here->BSIM4cqsb = here->BSIM4cqgb
|
here->BSIM4cqdb = here->BSIM4cqsb = here->BSIM4cqgb
|
||||||
= here->BSIM4cqbb = 0.0;
|
= here->BSIM4cqbb = 0.0;
|
||||||
here->BSIM4gtau = 0.0;
|
here->BSIM4gtau = 0.0;
|
||||||
|
|
@ -2585,7 +2645,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
here->BSIM4cbgb = -(here->BSIM4cggb
|
here->BSIM4cbgb = -(here->BSIM4cggb
|
||||||
+ here->BSIM4cdgb + T12);
|
+ here->BSIM4cdgb + T12);
|
||||||
here->BSIM4cbdb = -(here->BSIM4cgdb
|
here->BSIM4cbdb = -(here->BSIM4cgdb
|
||||||
+ here->BSIM4cddb + T11);
|
+ here->BSIM4cddb + T10); /* bug fix */
|
||||||
here->BSIM4cbsb = -(here->BSIM4cgsb
|
here->BSIM4cbsb = -(here->BSIM4cgsb
|
||||||
+ here->BSIM4cdsb + tmp);
|
+ here->BSIM4cdsb + tmp);
|
||||||
}
|
}
|
||||||
|
|
@ -3146,9 +3206,17 @@ for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
} /* End of CTM */
|
} /* End of CTM */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
here->BSIM4csgb = - here->BSIM4cggb - here->BSIM4cdgb - here->BSIM4cbgb;
|
||||||
|
here->BSIM4csdb = - here->BSIM4cgdb - here->BSIM4cddb - here->BSIM4cbdb;
|
||||||
|
here->BSIM4cssb = - here->BSIM4cgsb - here->BSIM4cdsb - here->BSIM4cbsb;
|
||||||
|
here->BSIM4cgbb = - here->BSIM4cgdb - here->BSIM4cggb - here->BSIM4cgsb;
|
||||||
|
here->BSIM4cdbb = - here->BSIM4cddb - here->BSIM4cdgb - here->BSIM4cdsb;
|
||||||
|
here->BSIM4cbbb = - here->BSIM4cbgb - here->BSIM4cbdb - here->BSIM4cbsb;
|
||||||
|
here->BSIM4csbb = - here->BSIM4cgbb - here->BSIM4cdbb - here->BSIM4cbbb;
|
||||||
here->BSIM4qgate = qgate;
|
here->BSIM4qgate = qgate;
|
||||||
here->BSIM4qbulk = qbulk;
|
here->BSIM4qbulk = qbulk;
|
||||||
here->BSIM4qdrn = qdrn;
|
here->BSIM4qdrn = qdrn;
|
||||||
|
here->BSIM4qsrc = -(qgate + qbulk + qdrn);
|
||||||
|
|
||||||
/* NQS begins */
|
/* NQS begins */
|
||||||
if ((here->BSIM4trnqsMod) || (here->BSIM4acnqsMod))
|
if ((here->BSIM4trnqsMod) || (here->BSIM4acnqsMod))
|
||||||
|
|
@ -3183,13 +3251,13 @@ finished:
|
||||||
|
|
||||||
/* Calculate junction C-V */
|
/* Calculate junction C-V */
|
||||||
if (ChargeComputationNeeded)
|
if (ChargeComputationNeeded)
|
||||||
{ czbd = model->BSIM4DunitAreaJctCap * here->BSIM4Adeff;
|
{ czbd = model->BSIM4DunitAreaTempJctCap * here->BSIM4Adeff; /* bug fix */
|
||||||
czbs = model->BSIM4SunitAreaJctCap * here->BSIM4Aseff;
|
czbs = model->BSIM4SunitAreaTempJctCap * here->BSIM4Aseff;
|
||||||
czbdsw = model->BSIM4DunitLengthSidewallJctCap * here->BSIM4Pdeff;
|
czbdsw = model->BSIM4DunitLengthSidewallTempJctCap * here->BSIM4Pdeff;
|
||||||
czbdswg = model->BSIM4DunitLengthGateSidewallJctCap
|
czbdswg = model->BSIM4DunitLengthGateSidewallTempJctCap
|
||||||
* pParam->BSIM4weffCJ * here->BSIM4nf;
|
* pParam->BSIM4weffCJ * here->BSIM4nf;
|
||||||
czbssw = model->BSIM4SunitLengthSidewallJctCap * here->BSIM4Pseff;
|
czbssw = model->BSIM4SunitLengthSidewallTempJctCap * here->BSIM4Pseff;
|
||||||
czbsswg = model->BSIM4SunitLengthGateSidewallJctCap
|
czbsswg = model->BSIM4SunitLengthGateSidewallTempJctCap
|
||||||
* pParam->BSIM4weffCJ * here->BSIM4nf;
|
* pParam->BSIM4weffCJ * here->BSIM4nf;
|
||||||
|
|
||||||
MJS = model->BSIM4SbulkJctBotGradingCoeff;
|
MJS = model->BSIM4SbulkJctBotGradingCoeff;
|
||||||
|
|
@ -3308,6 +3376,46 @@ finished:
|
||||||
if ((here->BSIM4off == 0) || (!(ckt->CKTmode & MODEINITFIX)))
|
if ((here->BSIM4off == 0) || (!(ckt->CKTmode & MODEINITFIX)))
|
||||||
{ if (Check == 1)
|
{ if (Check == 1)
|
||||||
{ ckt->CKTnoncon++;
|
{ ckt->CKTnoncon++;
|
||||||
|
#ifndef NEWCONV
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ if (here->BSIM4mode >= 0)
|
||||||
|
{ Idtot = here->BSIM4cd + here->BSIM4csub
|
||||||
|
+ here->BSIM4Igidl - here->BSIM4cbd;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ Idtot = here->BSIM4cd + here->BSIM4cbd;
|
||||||
|
}
|
||||||
|
tol0 = ckt->CKTreltol * MAX(fabs(cdhat), fabs(Idtot))
|
||||||
|
+ ckt->CKTabstol;
|
||||||
|
tol1 = ckt->CKTreltol * MAX(fabs(cseshat), fabs(Isestot))
|
||||||
|
+ ckt->CKTabstol;
|
||||||
|
tol2 = ckt->CKTreltol * MAX(fabs(cdedhat), fabs(Idedtot))
|
||||||
|
+ ckt->CKTabstol;
|
||||||
|
tol3 = ckt->CKTreltol * MAX(fabs(cgshat), fabs(Igstot))
|
||||||
|
+ ckt->CKTabstol;
|
||||||
|
tol4 = ckt->CKTreltol * MAX(fabs(cgdhat), fabs(Igdtot))
|
||||||
|
+ ckt->CKTabstol;
|
||||||
|
tol5 = ckt->CKTreltol * MAX(fabs(cgbhat), fabs(Igbtot))
|
||||||
|
+ ckt->CKTabstol;
|
||||||
|
if ((fabs(cdhat - Idtot) >= tol0) || (fabs(cseshat - Isestot) >= tol1)
|
||||||
|
|| (fabs(cdedhat - Idedtot) >= tol2))
|
||||||
|
{ ckt->CKTnoncon++;
|
||||||
|
}
|
||||||
|
else if ((fabs(cgshat - Igstot) >= tol3) || (fabs(cgdhat - Igdtot) >= tol4)
|
||||||
|
|| (fabs(cgbhat - Igbtot) >= tol5))
|
||||||
|
{ ckt->CKTnoncon++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ Ibtot = here->BSIM4cbs + here->BSIM4cbd
|
||||||
|
- here->BSIM4Igidl - here->BSIM4Igisl - here->BSIM4csub;
|
||||||
|
tol6 = ckt->CKTreltol * MAX(fabs(cbhat), fabs(Ibtot))
|
||||||
|
+ ckt->CKTabstol;
|
||||||
|
if (fabs(cbhat - Ibtot) > tol6)
|
||||||
|
{ ckt->CKTnoncon++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* NEWCONV */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*(ckt->CKTstate0 + here->BSIM4vds) = vds;
|
*(ckt->CKTstate0 + here->BSIM4vds) = vds;
|
||||||
|
|
@ -3327,24 +3435,12 @@ finished:
|
||||||
if (!ChargeComputationNeeded)
|
if (!ChargeComputationNeeded)
|
||||||
goto line850;
|
goto line850;
|
||||||
|
|
||||||
if (model->BSIM4capMod == 0)
|
if (model->BSIM4capMod == 0) /* code merge -JX */
|
||||||
{ if (vgd < 0.0)
|
{
|
||||||
{ cgdo = pParam->BSIM4cgdo;
|
cgdo = pParam->BSIM4cgdo;
|
||||||
qgdo = pParam->BSIM4cgdo * vgd;
|
qgdo = pParam->BSIM4cgdo * vgd;
|
||||||
}
|
cgso = pParam->BSIM4cgso;
|
||||||
else
|
|
||||||
{ cgdo = pParam->BSIM4cgdo;
|
|
||||||
qgdo = pParam->BSIM4cgdo * vgd;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (vgs < 0.0)
|
|
||||||
{ cgso = pParam->BSIM4cgso;
|
|
||||||
qgso = pParam->BSIM4cgso * vgs;
|
qgso = pParam->BSIM4cgso * vgs;
|
||||||
}
|
|
||||||
else
|
|
||||||
{ cgso = pParam->BSIM4cgso;
|
|
||||||
qgso = pParam->BSIM4cgso * vgs;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else /* For both capMod == 1 and 2 */
|
else /* For both capMod == 1 and 2 */
|
||||||
{ T0 = vgd + DELTA_1;
|
{ T0 = vgd + DELTA_1;
|
||||||
|
|
@ -3781,6 +3877,8 @@ line755:
|
||||||
*(ckt->CKTstate0 + here->BSIM4qg) = qgate;
|
*(ckt->CKTstate0 + here->BSIM4qg) = qgate;
|
||||||
*(ckt->CKTstate0 + here->BSIM4qd) = qdrn
|
*(ckt->CKTstate0 + here->BSIM4qd) = qdrn
|
||||||
- *(ckt->CKTstate0 + here->BSIM4qbd);
|
- *(ckt->CKTstate0 + here->BSIM4qbd);
|
||||||
|
*(ckt->CKTstate0 + here->BSIM4qs) = qsrc
|
||||||
|
- *(ckt->CKTstate0 + here->BSIM4qbs);
|
||||||
if (here->BSIM4rgateMod == 3)
|
if (here->BSIM4rgateMod == 3)
|
||||||
*(ckt->CKTstate0 + here->BSIM4qgmid) = qgmid;
|
*(ckt->CKTstate0 + here->BSIM4qgmid) = qgmid;
|
||||||
|
|
||||||
|
|
@ -3953,16 +4051,16 @@ line900:
|
||||||
- (here->BSIM4gbds + here->BSIM4ggidld) * vds
|
- (here->BSIM4gbds + here->BSIM4ggidld) * vds
|
||||||
- (here->BSIM4gbgs + here->BSIM4ggidlg) * vgs
|
- (here->BSIM4gbgs + here->BSIM4ggidlg) * vgs
|
||||||
- (here->BSIM4gbbs + here->BSIM4ggidlb) * vbs);
|
- (here->BSIM4gbbs + here->BSIM4ggidlb) * vbs);
|
||||||
ceqbs = 0.0;
|
ceqbs = model->BSIM4type * (here->BSIM4Igisl + here->BSIM4ggisls * vds
|
||||||
|
- here->BSIM4ggislg * vgd - here->BSIM4ggislb * vbd);
|
||||||
|
|
||||||
gbbdp = -(here->BSIM4gbds + here->BSIM4ggidld);
|
gbbdp = -(here->BSIM4gbds);
|
||||||
gbbsp = here->BSIM4gbds + here->BSIM4gbgs + here->BSIM4gbbs
|
gbbsp = here->BSIM4gbds + here->BSIM4gbgs + here->BSIM4gbbs;
|
||||||
- here->BSIM4ggidls;
|
|
||||||
|
|
||||||
gbdpg = here->BSIM4gbgs + here->BSIM4ggidlg;
|
gbdpg = here->BSIM4gbgs;
|
||||||
gbdpdp = here->BSIM4gbds + here->BSIM4ggidld;
|
gbdpdp = here->BSIM4gbds;
|
||||||
gbdpb = here->BSIM4gbbs + here->BSIM4ggidlb;
|
gbdpb = here->BSIM4gbbs;
|
||||||
gbdpsp = -(gbdpg + gbdpdp + gbdpb) + here->BSIM4ggidls;
|
gbdpsp = -(gbdpg + gbdpdp + gbdpb);
|
||||||
|
|
||||||
gbspg = 0.0;
|
gbspg = 0.0;
|
||||||
gbspdp = 0.0;
|
gbspdp = 0.0;
|
||||||
|
|
@ -4040,25 +4138,25 @@ line900:
|
||||||
ceqdrn = -model->BSIM4type * (cdrain + here->BSIM4gds * vds
|
ceqdrn = -model->BSIM4type * (cdrain + here->BSIM4gds * vds
|
||||||
+ Gm * vgd + Gmbs * vbd);
|
+ Gm * vgd + Gmbs * vbd);
|
||||||
|
|
||||||
ceqbs = model->BSIM4type * (here->BSIM4csub + here->BSIM4Igidl
|
ceqbs = model->BSIM4type * (here->BSIM4csub + here->BSIM4Igisl
|
||||||
+ (here->BSIM4gbds + here->BSIM4ggidld) * vds
|
+ (here->BSIM4gbds + here->BSIM4ggisls) * vds
|
||||||
- (here->BSIM4gbgs + here->BSIM4ggidlg) * vgd
|
- (here->BSIM4gbgs + here->BSIM4ggislg) * vgd
|
||||||
- (here->BSIM4gbbs + here->BSIM4ggidlb) * vbd);
|
- (here->BSIM4gbbs + here->BSIM4ggislb) * vbd);
|
||||||
ceqbd = 0.0;
|
ceqbd = model->BSIM4type * (here->BSIM4Igidl - here->BSIM4ggidld * vds
|
||||||
|
- here->BSIM4ggidlg * vgs - here->BSIM4ggidlb * vbs);
|
||||||
|
|
||||||
gbbsp = -(here->BSIM4gbds + here->BSIM4ggidld);
|
gbbsp = -(here->BSIM4gbds);
|
||||||
gbbdp = here->BSIM4gbds + here->BSIM4gbgs + here->BSIM4gbbs
|
gbbdp = here->BSIM4gbds + here->BSIM4gbgs + here->BSIM4gbbs;
|
||||||
- here->BSIM4ggidls;
|
|
||||||
|
|
||||||
gbdpg = 0.0;
|
gbdpg = 0.0;
|
||||||
gbdpsp = 0.0;
|
gbdpsp = 0.0;
|
||||||
gbdpb = 0.0;
|
gbdpb = 0.0;
|
||||||
gbdpdp = 0.0;
|
gbdpdp = 0.0;
|
||||||
|
|
||||||
gbspg = here->BSIM4gbgs + here->BSIM4ggidlg;
|
gbspg = here->BSIM4gbgs;
|
||||||
gbspsp = here->BSIM4gbds + here->BSIM4ggidld;
|
gbspsp = here->BSIM4gbds;
|
||||||
gbspb = here->BSIM4gbbs + here->BSIM4ggidlb;
|
gbspb = here->BSIM4gbbs;
|
||||||
gbspdp = -(gbspg + gbspsp + gbspb) + here->BSIM4ggidls;
|
gbspdp = -(gbspg + gbspsp + gbspb);
|
||||||
|
|
||||||
if (model->BSIM4igcMod)
|
if (model->BSIM4igcMod)
|
||||||
{ gIstotg = here->BSIM4gIgsg + here->BSIM4gIgcdg;
|
{ gIstotg = here->BSIM4gIgsg + here->BSIM4gIgcdg;
|
||||||
|
|
@ -4319,10 +4417,37 @@ line900:
|
||||||
(*(here->BSIM4SsPtr) += gspr + gstot);
|
(*(here->BSIM4SsPtr) += gspr + gstot);
|
||||||
|
|
||||||
(*(here->BSIM4BPdpPtr) += gcbdb - gjbd + gbbdp - gIbtotd);
|
(*(here->BSIM4BPdpPtr) += gcbdb - gjbd + gbbdp - gIbtotd);
|
||||||
(*(here->BSIM4BPgpPtr) += gcbgb - here->BSIM4gbgs - here->BSIM4ggidlg - gIbtotg);
|
(*(here->BSIM4BPgpPtr) += gcbgb - here->BSIM4gbgs - gIbtotg);
|
||||||
(*(here->BSIM4BPspPtr) += gcbsb - gjbs + gbbsp - gIbtots);
|
(*(here->BSIM4BPspPtr) += gcbsb - gjbs + gbbsp - gIbtots);
|
||||||
(*(here->BSIM4BPbpPtr) += gjbd + gjbs + gcbbb - here->BSIM4gbbs
|
(*(here->BSIM4BPbpPtr) += gjbd + gjbs + gcbbb - here->BSIM4gbbs
|
||||||
- here->BSIM4ggidlb - gIbtotb);
|
- gIbtotb);
|
||||||
|
|
||||||
|
ggidld = here->BSIM4ggidld;
|
||||||
|
ggidlg = here->BSIM4ggidlg;
|
||||||
|
ggidlb = here->BSIM4ggidlb;
|
||||||
|
ggislg = here->BSIM4ggislg;
|
||||||
|
ggisls = here->BSIM4ggisls;
|
||||||
|
ggislb = here->BSIM4ggislb;
|
||||||
|
|
||||||
|
/* stamp gidl */
|
||||||
|
(*(here->BSIM4DPdpPtr) += ggidld);
|
||||||
|
(*(here->BSIM4DPgpPtr) += ggidlg);
|
||||||
|
(*(here->BSIM4DPspPtr) -= (ggidlg + ggidld + ggidlb));
|
||||||
|
(*(here->BSIM4DPbpPtr) += ggidlb);
|
||||||
|
(*(here->BSIM4BPdpPtr) -= ggidld);
|
||||||
|
(*(here->BSIM4BPgpPtr) -= ggidlg);
|
||||||
|
(*(here->BSIM4BPspPtr) += (ggidlg + ggidld + ggidlb));
|
||||||
|
(*(here->BSIM4BPbpPtr) -= ggidlb);
|
||||||
|
/* stamp gisl */
|
||||||
|
(*(here->BSIM4SPdpPtr) -= (ggisls + ggislg + ggislb));
|
||||||
|
(*(here->BSIM4SPgpPtr) += ggislg);
|
||||||
|
(*(here->BSIM4SPspPtr) += ggisls);
|
||||||
|
(*(here->BSIM4SPbpPtr) += ggislb);
|
||||||
|
(*(here->BSIM4BPdpPtr) += (ggislg + ggisls + ggislb));
|
||||||
|
(*(here->BSIM4BPgpPtr) -= ggislg);
|
||||||
|
(*(here->BSIM4BPspPtr) -= ggisls);
|
||||||
|
(*(here->BSIM4BPbpPtr) -= ggislb);
|
||||||
|
|
||||||
|
|
||||||
if (here->BSIM4rbodyMod)
|
if (here->BSIM4rbodyMod)
|
||||||
{ (*(here->BSIM4DPdbPtr) += gcdbdb - here->BSIM4gbd);
|
{ (*(here->BSIM4DPdbPtr) += gcdbdb - here->BSIM4gbd);
|
||||||
|
|
@ -4373,3 +4498,35 @@ line1000: ;
|
||||||
|
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* function to compute poly depletion effect */
|
||||||
|
int BSIM4polyDepletion(
|
||||||
|
double phi,
|
||||||
|
double ngate,
|
||||||
|
double coxe,
|
||||||
|
double Vgs,
|
||||||
|
double *Vgs_eff,
|
||||||
|
double *dVgs_eff_dVg)
|
||||||
|
{
|
||||||
|
double T1, T2, T3, T4, T5, T6, T7, T8;
|
||||||
|
|
||||||
|
/* Poly Gate Si Depletion Effect */
|
||||||
|
if ((ngate > 1.0e18) &&
|
||||||
|
(ngate < 1.0e25) && (Vgs > phi)) {
|
||||||
|
T1 = 1.0e6 * CHARGE * EPSSI * ngate / (coxe * coxe);
|
||||||
|
T8 = Vgs - phi;
|
||||||
|
T4 = sqrt(1.0 + 2.0 * T8 / T1);
|
||||||
|
T2 = 2.0 * T8 / (T4 + 1.0);
|
||||||
|
T3 = 0.5 * T2 * T2 / T1; /* T3 = Vpoly */
|
||||||
|
T7 = 1.12 - T3 - 0.05;
|
||||||
|
T6 = sqrt(T7 * T7 + 0.224);
|
||||||
|
T5 = 1.12 - 0.5 * (T7 + T6);
|
||||||
|
*Vgs_eff = Vgs - T5;
|
||||||
|
*dVgs_eff_dVg = 1.0 - (0.5 - 0.5 / T4) * (1.0 + T7 / T6);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
*Vgs_eff = Vgs;
|
||||||
|
*dVgs_eff_dVg = 1.0;
|
||||||
|
}
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4mask.c of BSIM4.1.0.
|
* File: b4mask.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Xiaodong Jin, Kanyu M. Cao, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "ifsim.h"
|
#include "ifsim.h"
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
#include "devdefs.h"
|
#include "devdefs.h"
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
BSIM4mAsk(ckt,inst,which,value)
|
BSIM4mAsk(ckt,inst,which,value)
|
||||||
|
|
@ -519,6 +519,12 @@ IFvalue *value;
|
||||||
case BSIM4_MOD_DLC:
|
case BSIM4_MOD_DLC:
|
||||||
value->rValue = model->BSIM4dlc;
|
value->rValue = model->BSIM4dlc;
|
||||||
return(OK);
|
return(OK);
|
||||||
|
case BSIM4_MOD_XW:
|
||||||
|
value->rValue = model->BSIM4xw;
|
||||||
|
return(OK);
|
||||||
|
case BSIM4_MOD_XL:
|
||||||
|
value->rValue = model->BSIM4xl;
|
||||||
|
return(OK);
|
||||||
case BSIM4_MOD_DLCIG:
|
case BSIM4_MOD_DLCIG:
|
||||||
value->rValue = model->BSIM4dlcig;
|
value->rValue = model->BSIM4dlcig;
|
||||||
return(OK);
|
return(OK);
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4mdel.c of BSIM4.1.0.
|
* File: b4mdel.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
BSIM4mDelete(inModel,modname,kill)
|
BSIM4mDelete(inModel,modname,kill)
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4mpar.c of BSIM4.1.0.
|
* File: b4mpar.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
*
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
* Modified by Xuemei Xi 04/06/2001
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -14,6 +15,7 @@
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
#include "ifsim.h"
|
#include "ifsim.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
|
#include "suffix.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -685,6 +687,14 @@ GENmodel *inMod;
|
||||||
mod->BSIM4dlc = value->rValue;
|
mod->BSIM4dlc = value->rValue;
|
||||||
mod->BSIM4dlcGiven = TRUE;
|
mod->BSIM4dlcGiven = TRUE;
|
||||||
break;
|
break;
|
||||||
|
case BSIM4_MOD_XW :
|
||||||
|
mod->BSIM4xw = value->rValue;
|
||||||
|
mod->BSIM4xwGiven = TRUE;
|
||||||
|
break;
|
||||||
|
case BSIM4_MOD_XL :
|
||||||
|
mod->BSIM4xl = value->rValue;
|
||||||
|
mod->BSIM4xlGiven = TRUE;
|
||||||
|
break;
|
||||||
case BSIM4_MOD_DLCIG :
|
case BSIM4_MOD_DLCIG :
|
||||||
mod->BSIM4dlcig = value->rValue;
|
mod->BSIM4dlcig = value->rValue;
|
||||||
mod->BSIM4dlcigGiven = TRUE;
|
mod->BSIM4dlcigGiven = TRUE;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4noi.c of BSIM4.1.0.
|
* File: b4noi.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Xiaodong Jin, Kanyu M. Cao, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
* Modified by Xuemei Xi, 10/05/2001.
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -16,6 +17,7 @@
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "iferrmsg.h"
|
#include "iferrmsg.h"
|
||||||
#include "noisedef.h"
|
#include "noisedef.h"
|
||||||
|
#include "suffix.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -41,9 +43,12 @@ double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Ssi;
|
||||||
pParam = here->pParam;
|
pParam = here->pParam;
|
||||||
cd = fabs(here->BSIM4cd);
|
cd = fabs(here->BSIM4cd);
|
||||||
esat = 2.0 * pParam->BSIM4vsattemp / here->BSIM4ueff;
|
esat = 2.0 * pParam->BSIM4vsattemp / here->BSIM4ueff;
|
||||||
T0 = ((((Vds - here->BSIM4Vdseff) / pParam->BSIM4litl)
|
if(model->BSIM4em<=0.0) DelClm = 0.0; /* flicker noise modified -JX */
|
||||||
+ model->BSIM4em) / esat);
|
else {
|
||||||
DelClm = pParam->BSIM4litl * log (MAX(T0, N_MINLOG));
|
T0 = ((((Vds - here->BSIM4Vdseff) / pParam->BSIM4litl)
|
||||||
|
+ model->BSIM4em) / esat);
|
||||||
|
DelClm = pParam->BSIM4litl * log (MAX(T0, N_MINLOG));
|
||||||
|
}
|
||||||
EffFreq = pow(freq, model->BSIM4ef);
|
EffFreq = pow(freq, model->BSIM4ef);
|
||||||
T1 = CHARGE * CHARGE * CONSTboltz * cd * temp * here->BSIM4ueff;
|
T1 = CHARGE * CHARGE * CONSTboltz * cd * temp * here->BSIM4ueff;
|
||||||
T2 = 1.0e10 * EffFreq * here->BSIM4Abulk * model->BSIM4coxe
|
T2 = 1.0e10 * EffFreq * here->BSIM4Abulk * model->BSIM4coxe
|
||||||
|
|
@ -73,11 +78,11 @@ BSIM4noise (mode, operation, inModel, ckt, data, OnDens)
|
||||||
int mode, operation;
|
int mode, operation;
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
Ndata *data;
|
register Ndata *data;
|
||||||
double *OnDens;
|
double *OnDens;
|
||||||
{
|
{
|
||||||
BSIM4model *model = (BSIM4model *)inModel;
|
register BSIM4model *model = (BSIM4model *)inModel;
|
||||||
BSIM4instance *here;
|
register BSIM4instance *here;
|
||||||
struct bsim4SizeDependParam *pParam;
|
struct bsim4SizeDependParam *pParam;
|
||||||
char name[N_MXVLNTH];
|
char name[N_MXVLNTH];
|
||||||
double tempOnoise;
|
double tempOnoise;
|
||||||
|
|
@ -86,7 +91,7 @@ double noizDens[BSIM4NSRCS];
|
||||||
double lnNdens[BSIM4NSRCS];
|
double lnNdens[BSIM4NSRCS];
|
||||||
|
|
||||||
double N0, Nl;
|
double N0, Nl;
|
||||||
double T0, T1, T2, T5, T10, T11;
|
double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13;
|
||||||
double Vds, n, ExpArg, Ssi, Swi;
|
double Vds, n, ExpArg, Ssi, Swi;
|
||||||
double tmp, gdpr, gspr, npart_theta, npart_beta, igsquare;
|
double tmp, gdpr, gspr, npart_theta, npart_beta, igsquare;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4par.c of BSIM4.1.0.
|
* File: b4par.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -14,7 +13,7 @@
|
||||||
#include "ifsim.h"
|
#include "ifsim.h"
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
BSIM4param(param,value,inst,select)
|
BSIM4param(param,value,inst,select)
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4pzld.c of BSIM4.1.0.
|
* File: b4pzld.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
* Modified by Xuemei Xi, 10/05/2001.
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -15,16 +16,16 @@
|
||||||
#include "complex.h"
|
#include "complex.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
BSIM4pzLoad(inModel,ckt,s)
|
BSIM4pzLoad(inModel,ckt,s)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
register CKTcircuit *ckt;
|
||||||
SPcomplex *s;
|
register SPcomplex *s;
|
||||||
{
|
{
|
||||||
BSIM4model *model = (BSIM4model*)inModel;
|
register BSIM4model *model = (BSIM4model*)inModel;
|
||||||
BSIM4instance *here;
|
register BSIM4instance *here;
|
||||||
|
|
||||||
double gjbd, gjbs, geltd, gcrg, gcrgg, gcrgd, gcrgs, gcrgb;
|
double gjbd, gjbs, geltd, gcrg, gcrgg, gcrgd, gcrgs, gcrgb;
|
||||||
double xcggb, xcgdb, xcgsb, xcgbb, xcbgb, xcbdb, xcbsb, xcbbb;
|
double xcggb, xcgdb, xcgsb, xcgbb, xcbgb, xcbdb, xcbsb, xcbbb;
|
||||||
|
|
@ -47,12 +48,13 @@ double dsxpart_dVd, dsxpart_dVg, dsxpart_dVb, dsxpart_dVs;
|
||||||
double T0, T1, CoxWL, qcheq, Cdg, Cdd, Cds, Cdb, Csg, Csd, Css, Csb;
|
double T0, T1, CoxWL, qcheq, Cdg, Cdd, Cds, Cdb, Csg, Csd, Css, Csb;
|
||||||
double ScalingFactor = 1.0e-9;
|
double ScalingFactor = 1.0e-9;
|
||||||
struct bsim4SizeDependParam *pParam;
|
struct bsim4SizeDependParam *pParam;
|
||||||
|
double ggidld, ggidlg, ggidlb,ggisld, ggislg, ggislb, ggisls;
|
||||||
|
|
||||||
|
|
||||||
for (; model != NULL; model = model->BSIM4nextModel)
|
for (; model != NULL; model = model->BSIM4nextModel)
|
||||||
{ for (here = model->BSIM4instances; here!= NULL;
|
{ for (here = model->BSIM4instances; here!= NULL;
|
||||||
here = here->BSIM4nextInstance)
|
here = here->BSIM4nextInstance)
|
||||||
{ if (here->BSIM4owner != ARCHme) continue;
|
{ pParam = here->pParam;
|
||||||
pParam = here->pParam;
|
|
||||||
capbd = here->BSIM4capbd;
|
capbd = here->BSIM4capbd;
|
||||||
capbs = here->BSIM4capbs;
|
capbs = here->BSIM4capbs;
|
||||||
cgso = here->BSIM4cgso;
|
cgso = here->BSIM4cgso;
|
||||||
|
|
@ -65,13 +67,12 @@ struct bsim4SizeDependParam *pParam;
|
||||||
FwdSum = Gm + Gmbs;
|
FwdSum = Gm + Gmbs;
|
||||||
RevSum = 0.0;
|
RevSum = 0.0;
|
||||||
|
|
||||||
gbbdp = -(here->BSIM4gbds + here->BSIM4ggidld);
|
gbbdp = -(here->BSIM4gbds);
|
||||||
gbbsp = here->BSIM4gbds + here->BSIM4gbgs + here->BSIM4gbbs
|
gbbsp = here->BSIM4gbds + here->BSIM4gbgs + here->BSIM4gbbs;
|
||||||
- here->BSIM4ggidls;
|
gbdpg = here->BSIM4gbgs;
|
||||||
gbdpg = here->BSIM4gbgs + here->BSIM4ggidlg;
|
gbdpdp = here->BSIM4gbds;
|
||||||
gbdpdp = here->BSIM4gbds + here->BSIM4ggidld;
|
gbdpb = here->BSIM4gbbs;
|
||||||
gbdpb = here->BSIM4gbbs + here->BSIM4ggidlb;
|
gbdpsp = -(gbdpg + gbdpdp + gbdpb);
|
||||||
gbdpsp = -(gbdpg + gbdpdp + gbdpb) + here->BSIM4ggidls;
|
|
||||||
|
|
||||||
gbspdp = 0.0;
|
gbspdp = 0.0;
|
||||||
gbspg = 0.0;
|
gbspg = 0.0;
|
||||||
|
|
@ -264,19 +265,18 @@ struct bsim4SizeDependParam *pParam;
|
||||||
FwdSum = 0.0;
|
FwdSum = 0.0;
|
||||||
RevSum = -(Gm + Gmbs);
|
RevSum = -(Gm + Gmbs);
|
||||||
|
|
||||||
gbbsp = -(here->BSIM4gbds + here->BSIM4ggidld);
|
gbbsp = -(here->BSIM4gbds);
|
||||||
gbbdp = here->BSIM4gbds + here->BSIM4gbgs + here->BSIM4gbbs
|
gbbdp = here->BSIM4gbds + here->BSIM4gbgs + here->BSIM4gbbs;
|
||||||
- here->BSIM4ggidls;
|
|
||||||
|
|
||||||
gbdpg = 0.0;
|
gbdpg = 0.0;
|
||||||
gbdpsp = 0.0;
|
gbdpsp = 0.0;
|
||||||
gbdpb = 0.0;
|
gbdpb = 0.0;
|
||||||
gbdpdp = 0.0;
|
gbdpdp = 0.0;
|
||||||
|
|
||||||
gbspg = here->BSIM4gbgs + here->BSIM4ggidlg;
|
gbspg = here->BSIM4gbgs;
|
||||||
gbspsp = here->BSIM4gbds + here->BSIM4ggidld;
|
gbspsp = here->BSIM4gbds;
|
||||||
gbspb = here->BSIM4gbbs + here->BSIM4ggidlb;
|
gbspb = here->BSIM4gbbs;
|
||||||
gbspdp = -(gbspg + gbspsp + gbspb) + here->BSIM4ggidls;
|
gbspdp = -(gbspg + gbspsp + gbspb);
|
||||||
|
|
||||||
if (model->BSIM4igcMod)
|
if (model->BSIM4igcMod)
|
||||||
{ gIstotg = here->BSIM4gIgsg + here->BSIM4gIgcdg;
|
{ gIstotg = here->BSIM4gIgsg + here->BSIM4gIgcdg;
|
||||||
|
|
@ -652,14 +652,39 @@ struct bsim4SizeDependParam *pParam;
|
||||||
*(here->BSIM4BPdpPtr) -= gjbd - gbbdp + gIbtotd;
|
*(here->BSIM4BPdpPtr) -= gjbd - gbbdp + gIbtotd;
|
||||||
*(here->BSIM4BPgpPtr ) += xcbgb * s->real;
|
*(here->BSIM4BPgpPtr ) += xcbgb * s->real;
|
||||||
*(here->BSIM4BPgpPtr +1) += xcbgb * s->imag;
|
*(here->BSIM4BPgpPtr +1) += xcbgb * s->imag;
|
||||||
*(here->BSIM4BPgpPtr) -= here->BSIM4gbgs + here->BSIM4ggidlg + gIbtotg;
|
*(here->BSIM4BPgpPtr) -= here->BSIM4gbgs + gIbtotg;
|
||||||
*(here->BSIM4BPspPtr ) += xcbsb * s->real;
|
*(here->BSIM4BPspPtr ) += xcbsb * s->real;
|
||||||
*(here->BSIM4BPspPtr +1) += xcbsb * s->imag;
|
*(here->BSIM4BPspPtr +1) += xcbsb * s->imag;
|
||||||
*(here->BSIM4BPspPtr) -= gjbs - gbbsp + gIbtots;
|
*(here->BSIM4BPspPtr) -= gjbs - gbbsp + gIbtots;
|
||||||
*(here->BSIM4BPbpPtr ) += xcbbb * s->real;
|
*(here->BSIM4BPbpPtr ) += xcbbb * s->real;
|
||||||
*(here->BSIM4BPbpPtr +1) += xcbbb * s->imag;
|
*(here->BSIM4BPbpPtr +1) += xcbbb * s->imag;
|
||||||
*(here->BSIM4BPbpPtr) += gjbd + gjbs - here->BSIM4gbbs
|
*(here->BSIM4BPbpPtr) += gjbd + gjbs - here->BSIM4gbbs
|
||||||
- gIbtotb - here->BSIM4ggidlb;
|
- gIbtotb;
|
||||||
|
ggidld = here->BSIM4ggidld;
|
||||||
|
ggidlg = here->BSIM4ggidlg;
|
||||||
|
ggidlb = here->BSIM4ggidlb;
|
||||||
|
ggislg = here->BSIM4ggislg;
|
||||||
|
ggisls = here->BSIM4ggisls;
|
||||||
|
ggislb = here->BSIM4ggislb;
|
||||||
|
|
||||||
|
/* stamp gidl */
|
||||||
|
(*(here->BSIM4DPdpPtr) += ggidld);
|
||||||
|
(*(here->BSIM4DPgpPtr) += ggidlg);
|
||||||
|
(*(here->BSIM4DPspPtr) -= (ggidlg + ggidld) + ggidlb);
|
||||||
|
(*(here->BSIM4DPbpPtr) += ggidlb);
|
||||||
|
(*(here->BSIM4BPdpPtr) -= ggidld);
|
||||||
|
(*(here->BSIM4BPgpPtr) -= ggidlg);
|
||||||
|
(*(here->BSIM4BPspPtr) += (ggidlg + ggidld) + ggidlb);
|
||||||
|
(*(here->BSIM4BPbpPtr) -= ggidlb);
|
||||||
|
/* stamp gisl */
|
||||||
|
(*(here->BSIM4SPdpPtr) -= (ggisls + ggislg) + ggislb);
|
||||||
|
(*(here->BSIM4SPgpPtr) += ggislg);
|
||||||
|
(*(here->BSIM4SPspPtr) += ggisls);
|
||||||
|
(*(here->BSIM4SPbpPtr) += ggislb);
|
||||||
|
(*(here->BSIM4BPdpPtr) += (ggislg + ggisls) + ggislb);
|
||||||
|
(*(here->BSIM4BPgpPtr) -= ggislg);
|
||||||
|
(*(here->BSIM4BPspPtr) -= ggisls);
|
||||||
|
(*(here->BSIM4BPbpPtr) -= ggislb);
|
||||||
|
|
||||||
if (here->BSIM4rbodyMod)
|
if (here->BSIM4rbodyMod)
|
||||||
{ (*(here->BSIM4DPdbPtr ) += xcdbdb * s->real);
|
{ (*(here->BSIM4DPdbPtr ) += xcdbdb * s->real);
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,26 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4set.c of BSIM4.1.0.
|
* File: b4set.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Xiaodong Jin, Kanyu M. Cao, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
* Modified by Xuemei Xi, 04/06/2001.
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
* Modified by Xuemei Xi, 10/05/2001.
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include "jobdefs.h"
|
||||||
|
#include "ftedefs.h"
|
||||||
#include "smpdefs.h"
|
#include "smpdefs.h"
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
#define MAX_EXP 5.834617425e14
|
#define MAX_EXP 5.834617425e14
|
||||||
#define MIN_EXP 1.713908431e-15
|
#define MIN_EXP 1.713908431e-15
|
||||||
|
|
@ -29,17 +32,27 @@
|
||||||
|
|
||||||
int
|
int
|
||||||
BSIM4setup(matrix,inModel,ckt,states)
|
BSIM4setup(matrix,inModel,ckt,states)
|
||||||
SMPmatrix *matrix;
|
register SMPmatrix *matrix;
|
||||||
GENmodel *inModel;
|
register GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
register CKTcircuit *ckt;
|
||||||
int *states;
|
int *states;
|
||||||
{
|
{
|
||||||
BSIM4model *model = (BSIM4model*)inModel;
|
register BSIM4model *model = (BSIM4model*)inModel;
|
||||||
BSIM4instance *here;
|
register BSIM4instance *here;
|
||||||
int error;
|
int error;
|
||||||
CKTnode *tmp;
|
CKTnode *tmp;
|
||||||
|
|
||||||
double tmp1, tmp2;
|
double tmp1, tmp2;
|
||||||
|
int noiseAnalGiven = 0, createNode; /* Criteria for new node creation */
|
||||||
|
double Rtot, DMCGeff, DMCIeff, DMDGeff;
|
||||||
|
JOB *job;
|
||||||
|
|
||||||
|
/* Search for a noise analysis request */
|
||||||
|
for (job = ((TSKtask *)(ft_curckt->ci_curTask))->jobs;job;job = job->JOBnextJob) {
|
||||||
|
if(strcmp(job->JOBname,"Noise Analysis")==0) {
|
||||||
|
noiseAnalGiven = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* loop through all the BSIM4 device models */
|
/* loop through all the BSIM4 device models */
|
||||||
for( ; model != NULL; model = model->BSIM4nextModel )
|
for( ; model != NULL; model = model->BSIM4nextModel )
|
||||||
|
|
@ -147,7 +160,7 @@ double tmp1, tmp2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!model->BSIM4versionGiven)
|
if (!model->BSIM4versionGiven)
|
||||||
model->BSIM4version = "4.1.0";
|
model->BSIM4version = "4.2.1";
|
||||||
if (!model->BSIM4toxrefGiven)
|
if (!model->BSIM4toxrefGiven)
|
||||||
model->BSIM4toxref = 30.0e-10;
|
model->BSIM4toxref = 30.0e-10;
|
||||||
if (!model->BSIM4toxeGiven)
|
if (!model->BSIM4toxeGiven)
|
||||||
|
|
@ -1216,6 +1229,10 @@ double tmp1, tmp2;
|
||||||
model->BSIM4dwc = model->BSIM4Wint;
|
model->BSIM4dwc = model->BSIM4Wint;
|
||||||
if (!model->BSIM4dlcGiven)
|
if (!model->BSIM4dlcGiven)
|
||||||
model->BSIM4dlc = model->BSIM4Lint;
|
model->BSIM4dlc = model->BSIM4Lint;
|
||||||
|
if (!model->BSIM4xlGiven)
|
||||||
|
model->BSIM4xl = 0.0;
|
||||||
|
if (!model->BSIM4xwGiven)
|
||||||
|
model->BSIM4xw = 0.0;
|
||||||
if (!model->BSIM4dlcigGiven)
|
if (!model->BSIM4dlcigGiven)
|
||||||
model->BSIM4dlcig = model->BSIM4Lint;
|
model->BSIM4dlcig = model->BSIM4Lint;
|
||||||
if (!model->BSIM4dwjGiven)
|
if (!model->BSIM4dwjGiven)
|
||||||
|
|
@ -1308,6 +1325,9 @@ double tmp1, tmp2;
|
||||||
model->BSIM4af = 1.0;
|
model->BSIM4af = 1.0;
|
||||||
if (!model->BSIM4kfGiven)
|
if (!model->BSIM4kfGiven)
|
||||||
model->BSIM4kf = 0.0;
|
model->BSIM4kf = 0.0;
|
||||||
|
DMCGeff = model->BSIM4dmcg - model->BSIM4dmcgt;
|
||||||
|
DMCIeff = model->BSIM4dmci;
|
||||||
|
DMDGeff = model->BSIM4dmdg - model->BSIM4dmcgt;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* End processing models and begin to loop
|
* End processing models and begin to loop
|
||||||
|
|
@ -1316,13 +1336,10 @@ double tmp1, tmp2;
|
||||||
|
|
||||||
for (here = model->BSIM4instances; here != NULL ;
|
for (here = model->BSIM4instances; here != NULL ;
|
||||||
here=here->BSIM4nextInstance)
|
here=here->BSIM4nextInstance)
|
||||||
{
|
{ /* allocate a chunk of the state vector */
|
||||||
if (here->BSIM4owner == ARCHme) {
|
|
||||||
/* allocate a chunk of the state vector */
|
|
||||||
here->BSIM4states = *states;
|
here->BSIM4states = *states;
|
||||||
*states += BSIM4numStates;
|
*states += BSIM4numStates;
|
||||||
}
|
/* perform the parameter defaulting */
|
||||||
/* perform the parameter defaulting */
|
|
||||||
if (!here->BSIM4lGiven)
|
if (!here->BSIM4lGiven)
|
||||||
here->BSIM4l = 5.0e-6;
|
here->BSIM4l = 5.0e-6;
|
||||||
if (!here->BSIM4wGiven)
|
if (!here->BSIM4wGiven)
|
||||||
|
|
@ -1403,8 +1420,29 @@ double tmp1, tmp2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* process drain series resistance */
|
/* process drain series resistance */
|
||||||
if (((here->BSIM4rgeoMod != 0) || (model->BSIM4rdsMod != 0)
|
createNode = 0;
|
||||||
|| (model->BSIM4tnoiMod != 0)) && (here->BSIM4dNodePrime == 0))
|
if ( (model->BSIM4rdsMod != 0)
|
||||||
|
|| (model->BSIM4tnoiMod != 0 && noiseAnalGiven))
|
||||||
|
{
|
||||||
|
createNode = 1;
|
||||||
|
} else if (model->BSIM4sheetResistance > 0)
|
||||||
|
{
|
||||||
|
if (here->BSIM4drainSquaresGiven
|
||||||
|
&& here->BSIM4drainSquares > 0)
|
||||||
|
{
|
||||||
|
createNode = 1;
|
||||||
|
} else if (!here->BSIM4drainSquaresGiven
|
||||||
|
&& (here->BSIM4rgeoMod != 0))
|
||||||
|
{
|
||||||
|
BSIM4RdseffGeo(here->BSIM4nf, here->BSIM4geoMod,
|
||||||
|
here->BSIM4rgeoMod, here->BSIM4min,
|
||||||
|
here->BSIM4w, model->BSIM4sheetResistance,
|
||||||
|
DMCGeff, DMCIeff, DMDGeff, 0, &Rtot);
|
||||||
|
if(Rtot > 0)
|
||||||
|
createNode = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( createNode != 0 && (here->BSIM4dNodePrime == 0))
|
||||||
{ error = CKTmkVolt(ckt,&tmp,here->BSIM4name,"drain");
|
{ error = CKTmkVolt(ckt,&tmp,here->BSIM4name,"drain");
|
||||||
if(error) return(error);
|
if(error) return(error);
|
||||||
here->BSIM4dNodePrime = tmp->number;
|
here->BSIM4dNodePrime = tmp->number;
|
||||||
|
|
@ -1412,9 +1450,31 @@ double tmp1, tmp2;
|
||||||
else
|
else
|
||||||
{ here->BSIM4dNodePrime = here->BSIM4dNode;
|
{ here->BSIM4dNodePrime = here->BSIM4dNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* process source series resistance */
|
/* process source series resistance */
|
||||||
if (((here->BSIM4rgeoMod != 0) || (model->BSIM4rdsMod != 0)
|
createNode = 0;
|
||||||
|| (model->BSIM4tnoiMod != 0)) && (here->BSIM4sNodePrime == 0))
|
if ( (model->BSIM4rdsMod != 0)
|
||||||
|
|| (model->BSIM4tnoiMod != 0 && noiseAnalGiven))
|
||||||
|
{
|
||||||
|
createNode = 1;
|
||||||
|
} else if (model->BSIM4sheetResistance > 0)
|
||||||
|
{
|
||||||
|
if (here->BSIM4sourceSquaresGiven
|
||||||
|
&& here->BSIM4sourceSquares > 0)
|
||||||
|
{
|
||||||
|
createNode = 1;
|
||||||
|
} else if (!here->BSIM4sourceSquaresGiven
|
||||||
|
&& (here->BSIM4rgeoMod != 0))
|
||||||
|
{
|
||||||
|
BSIM4RdseffGeo(here->BSIM4nf, here->BSIM4geoMod,
|
||||||
|
here->BSIM4rgeoMod, here->BSIM4min,
|
||||||
|
here->BSIM4w, model->BSIM4sheetResistance,
|
||||||
|
DMCGeff, DMCIeff, DMDGeff, 1, &Rtot);
|
||||||
|
if(Rtot > 0)
|
||||||
|
createNode = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( createNode != 0 && here->BSIM4sNodePrime == 0)
|
||||||
{ error = CKTmkVolt(ckt,&tmp,here->BSIM4name,"source");
|
{ error = CKTmkVolt(ckt,&tmp,here->BSIM4name,"source");
|
||||||
if(error) return(error);
|
if(error) return(error);
|
||||||
here->BSIM4sNodePrime = tmp->number;
|
here->BSIM4sNodePrime = tmp->number;
|
||||||
|
|
@ -1422,7 +1482,6 @@ double tmp1, tmp2;
|
||||||
else
|
else
|
||||||
here->BSIM4sNodePrime = here->BSIM4sNode;
|
here->BSIM4sNodePrime = here->BSIM4sNode;
|
||||||
|
|
||||||
|
|
||||||
if ((here->BSIM4rgateMod > 0) && (here->BSIM4gNodePrime == 0))
|
if ((here->BSIM4rgateMod > 0) && (here->BSIM4gNodePrime == 0))
|
||||||
{ error = CKTmkVolt(ckt,&tmp,here->BSIM4name,"gate");
|
{ error = CKTmkVolt(ckt,&tmp,here->BSIM4name,"gate");
|
||||||
if(error) return(error);
|
if(error) return(error);
|
||||||
|
|
@ -1589,6 +1648,7 @@ BSIM4unsetup(inModel,ckt)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
{
|
{
|
||||||
|
#ifndef HAS_BATCHSIM
|
||||||
BSIM4model *model;
|
BSIM4model *model;
|
||||||
BSIM4instance *here;
|
BSIM4instance *here;
|
||||||
|
|
||||||
|
|
@ -1612,5 +1672,6 @@ BSIM4unsetup(inModel,ckt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4temp.c of BSIM4.1.0.
|
* File: b4temp.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Xiaodong Jin, Kanyu M. Cao, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
* Modified by Xuemei Xi, 04/06/2001.
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
* Modified by Xuemei Xi, 10/05/2001.
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -17,6 +18,7 @@
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
#define Kb 1.3806226e-23
|
#define Kb 1.3806226e-23
|
||||||
#define KboQ 8.617087e-5
|
#define KboQ 8.617087e-5
|
||||||
|
|
@ -49,11 +51,11 @@ BSIM4temp(inModel,ckt)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
CKTcircuit *ckt;
|
||||||
{
|
{
|
||||||
BSIM4model *model = (BSIM4model*) inModel;
|
register BSIM4model *model = (BSIM4model*) inModel;
|
||||||
BSIM4instance *here;
|
register BSIM4instance *here;
|
||||||
struct bsim4SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam;
|
struct bsim4SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam;
|
||||||
double tmp, tmp1, tmp2, tmp3, Eg, Eg0, ni;
|
double tmp, tmp1, tmp2, tmp3, Eg, Eg0, ni;
|
||||||
double T0, T1, T2, T3, T4, T5, T8, T9, Ldrn, Wdrn;
|
double T0, T1, T2, T3, T4, T5, T8, T9, Lnew, Wnew;
|
||||||
double delTemp, Temp, TRatio, Inv_L, Inv_W, Inv_LW, Dw, Dl, Vtm0, Tnom;
|
double delTemp, Temp, TRatio, Inv_L, Inv_W, Inv_LW, Dw, Dl, Vtm0, Tnom;
|
||||||
double dumPs, dumPd, dumAs, dumAd, PowWeffWr;
|
double dumPs, dumPd, dumAs, dumAd, PowWeffWr;
|
||||||
double DMCGeff, DMCIeff, DMDGeff;
|
double DMCGeff, DMCIeff, DMDGeff;
|
||||||
|
|
@ -186,46 +188,46 @@ int Size_Not_Found;
|
||||||
delTemp = ckt->CKTtemp - model->BSIM4tnom;
|
delTemp = ckt->CKTtemp - model->BSIM4tnom;
|
||||||
T0 = model->BSIM4tcj * delTemp;
|
T0 = model->BSIM4tcj * delTemp;
|
||||||
if (T0 >= -1.0)
|
if (T0 >= -1.0)
|
||||||
{ model->BSIM4SunitAreaJctCap *= 1.0 + T0;
|
{ model->BSIM4SunitAreaTempJctCap = model->BSIM4SunitAreaJctCap *(1.0 + T0); /*bug_fix -JX */
|
||||||
model->BSIM4DunitAreaJctCap *= 1.0 + T0;
|
model->BSIM4DunitAreaTempJctCap = model->BSIM4DunitAreaJctCap *(1.0 + T0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ if (model->BSIM4SunitAreaJctCap > 0.0)
|
{ if (model->BSIM4SunitAreaJctCap > 0.0)
|
||||||
{ model->BSIM4SunitAreaJctCap = 0.0;
|
{ model->BSIM4SunitAreaTempJctCap = 0.0;
|
||||||
fprintf(stderr, "Temperature effect has caused cjs to be negative. Cjs is clamped to zero.\n");
|
fprintf(stderr, "Temperature effect has caused cjs to be negative. Cjs is clamped to zero.\n");
|
||||||
}
|
}
|
||||||
if (model->BSIM4DunitAreaJctCap > 0.0)
|
if (model->BSIM4DunitAreaJctCap > 0.0)
|
||||||
{ model->BSIM4DunitAreaJctCap = 0.0;
|
{ model->BSIM4DunitAreaTempJctCap = 0.0;
|
||||||
fprintf(stderr, "Temperature effect has caused cjd to be negative. Cjd is clamped to zero.\n");
|
fprintf(stderr, "Temperature effect has caused cjd to be negative. Cjd is clamped to zero.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
T0 = model->BSIM4tcjsw * delTemp;
|
T0 = model->BSIM4tcjsw * delTemp;
|
||||||
if (T0 >= -1.0)
|
if (T0 >= -1.0)
|
||||||
{ model->BSIM4SunitLengthSidewallJctCap *= 1.0 + T0;
|
{ model->BSIM4SunitLengthSidewallTempJctCap = model->BSIM4SunitLengthSidewallJctCap *(1.0 + T0);
|
||||||
model->BSIM4DunitLengthSidewallJctCap *= 1.0 + T0;
|
model->BSIM4DunitLengthSidewallTempJctCap = model->BSIM4DunitLengthSidewallJctCap *(1.0 + T0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ if (model->BSIM4SunitLengthSidewallJctCap > 0.0)
|
{ if (model->BSIM4SunitLengthSidewallJctCap > 0.0)
|
||||||
{ model->BSIM4SunitLengthSidewallJctCap = 0.0;
|
{ model->BSIM4SunitLengthSidewallTempJctCap = 0.0;
|
||||||
fprintf(stderr, "Temperature effect has caused cjsws to be negative. Cjsws is clamped to zero.\n");
|
fprintf(stderr, "Temperature effect has caused cjsws to be negative. Cjsws is clamped to zero.\n");
|
||||||
}
|
}
|
||||||
if (model->BSIM4DunitLengthSidewallJctCap > 0.0)
|
if (model->BSIM4DunitLengthSidewallJctCap > 0.0)
|
||||||
{ model->BSIM4DunitLengthSidewallJctCap = 0.0;
|
{ model->BSIM4DunitLengthSidewallTempJctCap = 0.0;
|
||||||
fprintf(stderr, "Temperature effect has caused cjswd to be negative. Cjswd is clamped to zero.\n");
|
fprintf(stderr, "Temperature effect has caused cjswd to be negative. Cjswd is clamped to zero.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
T0 = model->BSIM4tcjswg * delTemp;
|
T0 = model->BSIM4tcjswg * delTemp;
|
||||||
if (T0 >= -1.0)
|
if (T0 >= -1.0)
|
||||||
{ model->BSIM4SunitLengthGateSidewallJctCap *= 1.0 + T0;
|
{ model->BSIM4SunitLengthGateSidewallTempJctCap = model->BSIM4SunitLengthGateSidewallJctCap *(1.0 + T0);
|
||||||
model->BSIM4DunitLengthGateSidewallJctCap *= 1.0 + T0;
|
model->BSIM4DunitLengthGateSidewallTempJctCap = model->BSIM4DunitLengthGateSidewallJctCap *(1.0 + T0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ if (model->BSIM4SunitLengthGateSidewallJctCap > 0.0)
|
{ if (model->BSIM4SunitLengthGateSidewallJctCap > 0.0)
|
||||||
{ model->BSIM4SunitLengthGateSidewallJctCap = 0.0;
|
{ model->BSIM4SunitLengthGateSidewallTempJctCap = 0.0;
|
||||||
fprintf(stderr, "Temperature effect has caused cjswgs to be negative. Cjswgs is clamped to zero.\n");
|
fprintf(stderr, "Temperature effect has caused cjswgs to be negative. Cjswgs is clamped to zero.\n");
|
||||||
}
|
}
|
||||||
if (model->BSIM4DunitLengthGateSidewallJctCap > 0.0)
|
if (model->BSIM4DunitLengthGateSidewallJctCap > 0.0)
|
||||||
{ model->BSIM4DunitLengthGateSidewallJctCap = 0.0;
|
{ model->BSIM4DunitLengthGateSidewallTempJctCap = 0.0;
|
||||||
fprintf(stderr, "Temperature effect has caused cjswgd to be negative. Cjswgd is clamped to zero.\n");
|
fprintf(stderr, "Temperature effect has caused cjswgd to be negative. Cjswgd is clamped to zero.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -319,8 +321,7 @@ int Size_Not_Found;
|
||||||
/* loop through all the instances of the model */
|
/* loop through all the instances of the model */
|
||||||
for (here = model->BSIM4instances; here != NULL;
|
for (here = model->BSIM4instances; here != NULL;
|
||||||
here = here->BSIM4nextInstance)
|
here = here->BSIM4nextInstance)
|
||||||
{ if (here->BSIM4owner != ARCHme) continue;
|
{ pSizeDependParamKnot = model->pSizeDependParamKnot;
|
||||||
pSizeDependParamKnot = model->pSizeDependParamKnot;
|
|
||||||
Size_Not_Found = 1;
|
Size_Not_Found = 1;
|
||||||
while ((pSizeDependParamKnot != NULL) && Size_Not_Found)
|
while ((pSizeDependParamKnot != NULL) && Size_Not_Found)
|
||||||
{ if ((here->BSIM4l == pSizeDependParamKnot->Length)
|
{ if ((here->BSIM4l == pSizeDependParamKnot->Length)
|
||||||
|
|
@ -328,6 +329,7 @@ int Size_Not_Found;
|
||||||
&& (here->BSIM4nf == pSizeDependParamKnot->NFinger))
|
&& (here->BSIM4nf == pSizeDependParamKnot->NFinger))
|
||||||
{ Size_Not_Found = 0;
|
{ Size_Not_Found = 0;
|
||||||
here->pParam = pSizeDependParamKnot;
|
here->pParam = pSizeDependParamKnot;
|
||||||
|
pParam = here->pParam; /*bug-fix */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ pLastKnot = pSizeDependParamKnot;
|
{ pLastKnot = pSizeDependParamKnot;
|
||||||
|
|
@ -336,7 +338,7 @@ int Size_Not_Found;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Size_Not_Found)
|
if (Size_Not_Found)
|
||||||
{ pParam = (struct bsim4SizeDependParam *)tmalloc(
|
{ pParam = (struct bsim4SizeDependParam *)malloc(
|
||||||
sizeof(struct bsim4SizeDependParam));
|
sizeof(struct bsim4SizeDependParam));
|
||||||
if (pLastKnot == NULL)
|
if (pLastKnot == NULL)
|
||||||
model->pSizeDependParamKnot = pParam;
|
model->pSizeDependParamKnot = pParam;
|
||||||
|
|
@ -348,11 +350,11 @@ int Size_Not_Found;
|
||||||
pParam->Length = here->BSIM4l;
|
pParam->Length = here->BSIM4l;
|
||||||
pParam->Width = here->BSIM4w;
|
pParam->Width = here->BSIM4w;
|
||||||
pParam->NFinger = here->BSIM4nf;
|
pParam->NFinger = here->BSIM4nf;
|
||||||
Ldrn = here->BSIM4l;
|
Lnew = here->BSIM4l + model->BSIM4xl ;
|
||||||
Wdrn = here->BSIM4w / here->BSIM4nf;
|
Wnew = here->BSIM4w / here->BSIM4nf + model->BSIM4xw;
|
||||||
|
|
||||||
T0 = pow(Ldrn, model->BSIM4Lln);
|
T0 = pow(Lnew, model->BSIM4Lln);
|
||||||
T1 = pow(Wdrn, model->BSIM4Lwn);
|
T1 = pow(Wnew, model->BSIM4Lwn);
|
||||||
tmp1 = model->BSIM4Ll / T0 + model->BSIM4Lw / T1
|
tmp1 = model->BSIM4Ll / T0 + model->BSIM4Lw / T1
|
||||||
+ model->BSIM4Lwl / (T0 * T1);
|
+ model->BSIM4Lwl / (T0 * T1);
|
||||||
pParam->BSIM4dl = model->BSIM4Lint + tmp1;
|
pParam->BSIM4dl = model->BSIM4Lint + tmp1;
|
||||||
|
|
@ -361,8 +363,8 @@ int Size_Not_Found;
|
||||||
pParam->BSIM4dlc = model->BSIM4dlc + tmp2;
|
pParam->BSIM4dlc = model->BSIM4dlc + tmp2;
|
||||||
pParam->BSIM4dlcig = model->BSIM4dlcig + tmp2;
|
pParam->BSIM4dlcig = model->BSIM4dlcig + tmp2;
|
||||||
|
|
||||||
T2 = pow(Ldrn, model->BSIM4Wln);
|
T2 = pow(Lnew, model->BSIM4Wln);
|
||||||
T3 = pow(Wdrn, model->BSIM4Wwn);
|
T3 = pow(Wnew, model->BSIM4Wwn);
|
||||||
tmp1 = model->BSIM4Wl / T2 + model->BSIM4Ww / T3
|
tmp1 = model->BSIM4Wl / T2 + model->BSIM4Ww / T3
|
||||||
+ model->BSIM4Wwl / (T2 * T3);
|
+ model->BSIM4Wwl / (T2 * T3);
|
||||||
pParam->BSIM4dw = model->BSIM4Wint + tmp1;
|
pParam->BSIM4dw = model->BSIM4Wint + tmp1;
|
||||||
|
|
@ -371,7 +373,7 @@ int Size_Not_Found;
|
||||||
pParam->BSIM4dwc = model->BSIM4dwc + tmp2;
|
pParam->BSIM4dwc = model->BSIM4dwc + tmp2;
|
||||||
pParam->BSIM4dwj = model->BSIM4dwj + tmp2;
|
pParam->BSIM4dwj = model->BSIM4dwj + tmp2;
|
||||||
|
|
||||||
pParam->BSIM4leff = here->BSIM4l - 2.0 * pParam->BSIM4dl;
|
pParam->BSIM4leff = Lnew - 2.0 * pParam->BSIM4dl;
|
||||||
if (pParam->BSIM4leff <= 0.0)
|
if (pParam->BSIM4leff <= 0.0)
|
||||||
{ IFuid namarray[2];
|
{ IFuid namarray[2];
|
||||||
namarray[0] = model->BSIM4modName;
|
namarray[0] = model->BSIM4modName;
|
||||||
|
|
@ -382,8 +384,7 @@ int Size_Not_Found;
|
||||||
return(E_BADPARM);
|
return(E_BADPARM);
|
||||||
}
|
}
|
||||||
|
|
||||||
pParam->BSIM4weff = here->BSIM4w / here->BSIM4nf
|
pParam->BSIM4weff = Wnew - 2.0 * pParam->BSIM4dw;
|
||||||
- 2.0 * pParam->BSIM4dw;
|
|
||||||
if (pParam->BSIM4weff <= 0.0)
|
if (pParam->BSIM4weff <= 0.0)
|
||||||
{ IFuid namarray[2];
|
{ IFuid namarray[2];
|
||||||
namarray[0] = model->BSIM4modName;
|
namarray[0] = model->BSIM4modName;
|
||||||
|
|
@ -394,7 +395,7 @@ int Size_Not_Found;
|
||||||
return(E_BADPARM);
|
return(E_BADPARM);
|
||||||
}
|
}
|
||||||
|
|
||||||
pParam->BSIM4leffCV = here->BSIM4l - 2.0 * pParam->BSIM4dlc;
|
pParam->BSIM4leffCV = Lnew - 2.0 * pParam->BSIM4dlc;
|
||||||
if (pParam->BSIM4leffCV <= 0.0)
|
if (pParam->BSIM4leffCV <= 0.0)
|
||||||
{ IFuid namarray[2];
|
{ IFuid namarray[2];
|
||||||
namarray[0] = model->BSIM4modName;
|
namarray[0] = model->BSIM4modName;
|
||||||
|
|
@ -405,8 +406,7 @@ int Size_Not_Found;
|
||||||
return(E_BADPARM);
|
return(E_BADPARM);
|
||||||
}
|
}
|
||||||
|
|
||||||
pParam->BSIM4weffCV = here->BSIM4w / here->BSIM4nf
|
pParam->BSIM4weffCV = Wnew - 2.0 * pParam->BSIM4dwc;
|
||||||
- 2.0 * pParam->BSIM4dwc;
|
|
||||||
if (pParam->BSIM4weffCV <= 0.0)
|
if (pParam->BSIM4weffCV <= 0.0)
|
||||||
{ IFuid namarray[2];
|
{ IFuid namarray[2];
|
||||||
namarray[0] = model->BSIM4modName;
|
namarray[0] = model->BSIM4modName;
|
||||||
|
|
@ -417,8 +417,7 @@ int Size_Not_Found;
|
||||||
return(E_BADPARM);
|
return(E_BADPARM);
|
||||||
}
|
}
|
||||||
|
|
||||||
pParam->BSIM4weffCJ = here->BSIM4w / here->BSIM4nf
|
pParam->BSIM4weffCJ = Wnew - 2.0 * pParam->BSIM4dwj;
|
||||||
- 2.0 * pParam->BSIM4dwj;
|
|
||||||
if (pParam->BSIM4weffCJ <= 0.0)
|
if (pParam->BSIM4weffCJ <= 0.0)
|
||||||
{ IFuid namarray[2];
|
{ IFuid namarray[2];
|
||||||
namarray[0] = model->BSIM4modName;
|
namarray[0] = model->BSIM4modName;
|
||||||
|
|
@ -1250,7 +1249,7 @@ int Size_Not_Found;
|
||||||
here->BSIM4grgeltd = model->BSIM4rshg * (model->BSIM4xgw
|
here->BSIM4grgeltd = model->BSIM4rshg * (model->BSIM4xgw
|
||||||
+ pParam->BSIM4weffCJ / 3.0 / model->BSIM4ngcon) /
|
+ pParam->BSIM4weffCJ / 3.0 / model->BSIM4ngcon) /
|
||||||
(model->BSIM4ngcon * here->BSIM4nf *
|
(model->BSIM4ngcon * here->BSIM4nf *
|
||||||
(here->BSIM4l - model->BSIM4xgl));
|
(Lnew - model->BSIM4xgl));
|
||||||
if (here->BSIM4grgeltd > 0.0)
|
if (here->BSIM4grgeltd > 0.0)
|
||||||
here->BSIM4grgeltd = 1.0 / here->BSIM4grgeltd;
|
here->BSIM4grgeltd = 1.0 / here->BSIM4grgeltd;
|
||||||
else
|
else
|
||||||
|
|
@ -1302,47 +1301,69 @@ int Size_Not_Found;
|
||||||
&dumPs, &dumPd, &dumAs, &(here->BSIM4Adeff));
|
&dumPs, &dumPd, &dumAs, &(here->BSIM4Adeff));
|
||||||
|
|
||||||
/* Processing S/D resistance and conductance below */
|
/* Processing S/D resistance and conductance below */
|
||||||
if (here->BSIM4rgeoMod == 0)
|
if(here->BSIM4sNodePrime != here->BSIM4sNode)
|
||||||
here->BSIM4sourceConductance = 0.0;
|
{
|
||||||
else if (here->BSIM4sourceSquaresGiven)
|
here->BSIM4sourceConductance = 0.0;
|
||||||
here->BSIM4sourceConductance = model->BSIM4sheetResistance
|
if(here->BSIM4sourceSquaresGiven)
|
||||||
|
{
|
||||||
|
here->BSIM4sourceConductance = model->BSIM4sheetResistance
|
||||||
* here->BSIM4sourceSquares;
|
* here->BSIM4sourceSquares;
|
||||||
else
|
} else if (here->BSIM4rgeoMod > 0)
|
||||||
BSIM4RdseffGeo(here->BSIM4nf, here->BSIM4geoMod, here->BSIM4rgeoMod, here->BSIM4min,
|
{
|
||||||
pParam->BSIM4weffCJ, model->BSIM4sheetResistance,
|
BSIM4RdseffGeo(here->BSIM4nf, here->BSIM4geoMod,
|
||||||
DMCGeff, DMCIeff, DMDGeff, 1, &(here->BSIM4sourceConductance));
|
here->BSIM4rgeoMod, here->BSIM4min,
|
||||||
|
pParam->BSIM4weffCJ, model->BSIM4sheetResistance,
|
||||||
|
DMCGeff, DMCIeff, DMDGeff, 1, &(here->BSIM4sourceConductance));
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
here->BSIM4sourceConductance = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
if (here->BSIM4rgeoMod == 0)
|
if (here->BSIM4sourceConductance > 0.0)
|
||||||
here->BSIM4drainConductance = 0.0;
|
here->BSIM4sourceConductance = 1.0
|
||||||
else if (here->BSIM4drainSquaresGiven)
|
/ here->BSIM4sourceConductance;
|
||||||
here->BSIM4drainConductance = model->BSIM4sheetResistance
|
else
|
||||||
* here->BSIM4drainSquares;
|
{
|
||||||
else
|
here->BSIM4sourceConductance = 1.0e3; /* mho */
|
||||||
BSIM4RdseffGeo(here->BSIM4nf, here->BSIM4geoMod, here->BSIM4rgeoMod, here->BSIM4min,
|
printf ("Warning: Source conductance reset to 1.0e3 mho.\n");
|
||||||
pParam->BSIM4weffCJ, model->BSIM4sheetResistance,
|
}
|
||||||
DMCGeff, DMCIeff, DMDGeff, 0, &(here->BSIM4drainConductance));
|
} else
|
||||||
|
{
|
||||||
if (here->BSIM4drainConductance > 0.0)
|
|
||||||
here->BSIM4drainConductance = 1.0 / here->BSIM4drainConductance;
|
|
||||||
else
|
|
||||||
here->BSIM4drainConductance = 0.0;
|
|
||||||
|
|
||||||
if (here->BSIM4sourceConductance > 0.0)
|
|
||||||
here->BSIM4sourceConductance = 1.0 / here->BSIM4sourceConductance;
|
|
||||||
else
|
|
||||||
here->BSIM4sourceConductance = 0.0;
|
here->BSIM4sourceConductance = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(here->BSIM4dNodePrime != here->BSIM4dNode)
|
||||||
|
{
|
||||||
|
here->BSIM4drainConductance = 0.0;
|
||||||
|
if(here->BSIM4drainSquaresGiven)
|
||||||
|
{
|
||||||
|
here->BSIM4drainConductance = model->BSIM4sheetResistance
|
||||||
|
* here->BSIM4drainSquares;
|
||||||
|
} else if (here->BSIM4rgeoMod > 0)
|
||||||
|
{
|
||||||
|
BSIM4RdseffGeo(here->BSIM4nf, here->BSIM4geoMod,
|
||||||
|
here->BSIM4rgeoMod, here->BSIM4min,
|
||||||
|
pParam->BSIM4weffCJ, model->BSIM4sheetResistance,
|
||||||
|
DMCGeff, DMCIeff, DMDGeff, 0, &(here->BSIM4drainConductance));
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
here->BSIM4drainConductance = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
if (((here->BSIM4rgeoMod != 0) || (model->BSIM4rdsMod != 0)
|
if (here->BSIM4drainConductance > 0.0)
|
||||||
|| (model->BSIM4tnoiMod != 0)) && (here->BSIM4sourceConductance == 0.0))
|
here->BSIM4drainConductance = 1.0
|
||||||
{ here->BSIM4sourceConductance = 1.0e3; /* mho */
|
/ here->BSIM4drainConductance;
|
||||||
printf("Warning: Source conductance reset to 1.0e3 mho.\n");
|
else
|
||||||
}
|
{
|
||||||
if (((here->BSIM4rgeoMod != 0) || (model->BSIM4rdsMod != 0)
|
here->BSIM4drainConductance = 1.0e3; /* mho */
|
||||||
|| (model->BSIM4tnoiMod != 0)) && (here->BSIM4drainConductance == 0.0))
|
printf ("Warning: Drain conductance reset to 1.0e3 mho.\n");
|
||||||
{ here->BSIM4drainConductance = 1.0e3; /* mho */
|
}
|
||||||
printf("Warning: Drain conductance reset to 1.0e3 mho.\n");
|
} else
|
||||||
} /* End of Rsd processing */
|
{
|
||||||
|
here->BSIM4drainConductance = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* End of Rsd processing */
|
||||||
|
|
||||||
|
|
||||||
Nvtms = model->BSIM4vtm * model->BSIM4SjctEmissionCoeff;
|
Nvtms = model->BSIM4vtm * model->BSIM4SjctEmissionCoeff;
|
||||||
|
|
@ -1467,7 +1488,7 @@ int Size_Not_Found;
|
||||||
{ IFuid namarray[2];
|
{ IFuid namarray[2];
|
||||||
namarray[0] = model->BSIM4modName;
|
namarray[0] = model->BSIM4modName;
|
||||||
namarray[1] = here->BSIM4name;
|
namarray[1] = here->BSIM4name;
|
||||||
(*(SPfrontEnd->IFerror)) (ERR_FATAL, "Fatal error(s) detected during BSIM4.1.0 parameter checking for %s in model %s", namarray);
|
(*(SPfrontEnd->IFerror)) (ERR_FATAL, "Fatal error(s) detected during BSIM4.2.1 parameter checking for %s in model %s", namarray);
|
||||||
return(E_BADPARM);
|
return(E_BADPARM);
|
||||||
}
|
}
|
||||||
} /* End instance */
|
} /* End instance */
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
/**** BSIM4.1.0, Released by Weidong Liu 10/11/2000 ****/
|
/**** BSIM4.2.1, Released by Xuemei Xi 10/05/2001 ****/
|
||||||
|
|
||||||
/**********
|
/**********
|
||||||
* Copyright 2000 Regents of the University of California. All rights reserved.
|
* Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
* File: b4trunc.c of BSIM4.1.0.
|
* File: b4trunc.c of BSIM4.2.1.
|
||||||
* Authors: Weidong Liu, Kanyu M. Cao, Xiaodong Jin, Chenming Hu.
|
* Author: 2000 Weidong Liu
|
||||||
|
* Authors: Xuemei Xi, Kanyu M. Cao, Hui Wan, Mansun Chan, Chenming Hu.
|
||||||
* Project Director: Prof. Chenming Hu.
|
* Project Director: Prof. Chenming Hu.
|
||||||
*
|
|
||||||
* Modified by Weidong Liu, 10/11/2000.
|
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#include "ngspice.h"
|
#include "ngspice.h"
|
||||||
|
|
@ -15,16 +14,17 @@
|
||||||
#include "cktdefs.h"
|
#include "cktdefs.h"
|
||||||
#include "bsim4def.h"
|
#include "bsim4def.h"
|
||||||
#include "sperror.h"
|
#include "sperror.h"
|
||||||
|
#include "suffix.h"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
BSIM4trunc(inModel,ckt,timeStep)
|
BSIM4trunc(inModel,ckt,timeStep)
|
||||||
GENmodel *inModel;
|
GENmodel *inModel;
|
||||||
CKTcircuit *ckt;
|
register CKTcircuit *ckt;
|
||||||
double *timeStep;
|
double *timeStep;
|
||||||
{
|
{
|
||||||
BSIM4model *model = (BSIM4model*)inModel;
|
register BSIM4model *model = (BSIM4model*)inModel;
|
||||||
BSIM4instance *here;
|
register BSIM4instance *here;
|
||||||
|
|
||||||
#ifdef STEPDEBUG
|
#ifdef STEPDEBUG
|
||||||
double debugtemp;
|
double debugtemp;
|
||||||
|
|
@ -34,7 +34,6 @@ BSIM4instance *here;
|
||||||
{ for (here = model->BSIM4instances; here != NULL;
|
{ for (here = model->BSIM4instances; here != NULL;
|
||||||
here = here->BSIM4nextInstance)
|
here = here->BSIM4nextInstance)
|
||||||
{
|
{
|
||||||
if (here->BSIM4owner != ARCHme) continue;
|
|
||||||
#ifdef STEPDEBUG
|
#ifdef STEPDEBUG
|
||||||
debugtemp = *timeStep;
|
debugtemp = *timeStep;
|
||||||
#endif /* STEPDEBUG */
|
#endif /* STEPDEBUG */
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 2000 Regents of the University of California. All rights reserved.
|
Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
Author: 2000 Weidong Liu.
|
Author: 2000 Weidong Liu.
|
||||||
|
Modified by Xuemei Xi October 2001
|
||||||
File: bsim4def.h
|
File: bsim4def.h
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
|
|
@ -18,7 +19,6 @@ typedef struct sBSIM4instance
|
||||||
struct sBSIM4model *BSIM4modPtr;
|
struct sBSIM4model *BSIM4modPtr;
|
||||||
struct sBSIM4instance *BSIM4nextInstance;
|
struct sBSIM4instance *BSIM4nextInstance;
|
||||||
IFuid BSIM4name;
|
IFuid BSIM4name;
|
||||||
int BSIM4owner; /* Number of owner process */
|
|
||||||
int BSIM4states; /* index into state table for this device */
|
int BSIM4states; /* index into state table for this device */
|
||||||
int BSIM4dNode;
|
int BSIM4dNode;
|
||||||
int BSIM4gNodeExt;
|
int BSIM4gNodeExt;
|
||||||
|
|
@ -100,6 +100,10 @@ typedef struct sBSIM4instance
|
||||||
|
|
||||||
/* OP point */
|
/* OP point */
|
||||||
double BSIM4Vgsteff;
|
double BSIM4Vgsteff;
|
||||||
|
double BSIM4vgs_eff;
|
||||||
|
double BSIM4vgd_eff;
|
||||||
|
double BSIM4dvgs_eff_dvg;
|
||||||
|
double BSIM4dvgd_eff_dvg;
|
||||||
double BSIM4Vdseff;
|
double BSIM4Vdseff;
|
||||||
double BSIM4nstar;
|
double BSIM4nstar;
|
||||||
double BSIM4Abulk;
|
double BSIM4Abulk;
|
||||||
|
|
@ -111,6 +115,7 @@ typedef struct sBSIM4instance
|
||||||
double BSIM4cbd;
|
double BSIM4cbd;
|
||||||
double BSIM4csub;
|
double BSIM4csub;
|
||||||
double BSIM4Igidl;
|
double BSIM4Igidl;
|
||||||
|
double BSIM4Igisl;
|
||||||
double BSIM4gm;
|
double BSIM4gm;
|
||||||
double BSIM4gds;
|
double BSIM4gds;
|
||||||
double BSIM4gmbs;
|
double BSIM4gmbs;
|
||||||
|
|
@ -124,6 +129,10 @@ typedef struct sBSIM4instance
|
||||||
double BSIM4ggidlg;
|
double BSIM4ggidlg;
|
||||||
double BSIM4ggidls;
|
double BSIM4ggidls;
|
||||||
double BSIM4ggidlb;
|
double BSIM4ggidlb;
|
||||||
|
double BSIM4ggisld;
|
||||||
|
double BSIM4ggislg;
|
||||||
|
double BSIM4ggisls;
|
||||||
|
double BSIM4ggislb;
|
||||||
|
|
||||||
double BSIM4Igcs;
|
double BSIM4Igcs;
|
||||||
double BSIM4gIgcsg;
|
double BSIM4gIgcsg;
|
||||||
|
|
@ -178,6 +187,13 @@ typedef struct sBSIM4instance
|
||||||
double BSIM4cdgb;
|
double BSIM4cdgb;
|
||||||
double BSIM4cddb;
|
double BSIM4cddb;
|
||||||
double BSIM4cdsb;
|
double BSIM4cdsb;
|
||||||
|
double BSIM4csgb;
|
||||||
|
double BSIM4csdb;
|
||||||
|
double BSIM4cssb;
|
||||||
|
double BSIM4cgbb;
|
||||||
|
double BSIM4cdbb;
|
||||||
|
double BSIM4csbb;
|
||||||
|
double BSIM4cbbb;
|
||||||
double BSIM4capbd;
|
double BSIM4capbd;
|
||||||
double BSIM4capbs;
|
double BSIM4capbs;
|
||||||
|
|
||||||
|
|
@ -189,6 +205,7 @@ typedef struct sBSIM4instance
|
||||||
double BSIM4qgate;
|
double BSIM4qgate;
|
||||||
double BSIM4qbulk;
|
double BSIM4qbulk;
|
||||||
double BSIM4qdrn;
|
double BSIM4qdrn;
|
||||||
|
double BSIM4qsrc;
|
||||||
|
|
||||||
double BSIM4qchqs;
|
double BSIM4qchqs;
|
||||||
double BSIM4taunet;
|
double BSIM4taunet;
|
||||||
|
|
@ -308,6 +325,7 @@ typedef struct sBSIM4instance
|
||||||
double *BSIM4GPqPtr;
|
double *BSIM4GPqPtr;
|
||||||
double *BSIM4SPqPtr;
|
double *BSIM4SPqPtr;
|
||||||
|
|
||||||
|
|
||||||
#define BSIM4vbd BSIM4states+ 0
|
#define BSIM4vbd BSIM4states+ 0
|
||||||
#define BSIM4vbs BSIM4states+ 1
|
#define BSIM4vbs BSIM4states+ 1
|
||||||
#define BSIM4vgs BSIM4states+ 2
|
#define BSIM4vgs BSIM4states+ 2
|
||||||
|
|
@ -339,8 +357,9 @@ typedef struct sBSIM4instance
|
||||||
#define BSIM4qcdump BSIM4states+ 25
|
#define BSIM4qcdump BSIM4states+ 25
|
||||||
#define BSIM4cqcdump BSIM4states+ 26
|
#define BSIM4cqcdump BSIM4states+ 26
|
||||||
#define BSIM4qdef BSIM4states+ 27
|
#define BSIM4qdef BSIM4states+ 27
|
||||||
|
#define BSIM4qs BSIM4states+ 28
|
||||||
|
|
||||||
#define BSIM4numStates 28
|
#define BSIM4numStates 29
|
||||||
|
|
||||||
|
|
||||||
/* indices to the array of BSIM4 NOISE SOURCES */
|
/* indices to the array of BSIM4 NOISE SOURCES */
|
||||||
|
|
@ -741,6 +760,8 @@ typedef struct sBSIM4model
|
||||||
double BSIM4cle;
|
double BSIM4cle;
|
||||||
double BSIM4dwc;
|
double BSIM4dwc;
|
||||||
double BSIM4dlc;
|
double BSIM4dlc;
|
||||||
|
double BSIM4xw;
|
||||||
|
double BSIM4xl;
|
||||||
double BSIM4dlcig;
|
double BSIM4dlcig;
|
||||||
double BSIM4dwj;
|
double BSIM4dwj;
|
||||||
double BSIM4noff;
|
double BSIM4noff;
|
||||||
|
|
@ -1220,6 +1241,12 @@ typedef struct sBSIM4model
|
||||||
double BSIM4DjctTempSatCurDensity;
|
double BSIM4DjctTempSatCurDensity;
|
||||||
double BSIM4DjctSidewallTempSatCurDensity;
|
double BSIM4DjctSidewallTempSatCurDensity;
|
||||||
double BSIM4DjctGateSidewallTempSatCurDensity;
|
double BSIM4DjctGateSidewallTempSatCurDensity;
|
||||||
|
double BSIM4SunitAreaTempJctCap;
|
||||||
|
double BSIM4DunitAreaTempJctCap;
|
||||||
|
double BSIM4SunitLengthSidewallTempJctCap;
|
||||||
|
double BSIM4DunitLengthSidewallTempJctCap;
|
||||||
|
double BSIM4SunitLengthGateSidewallTempJctCap;
|
||||||
|
double BSIM4DunitLengthGateSidewallTempJctCap;
|
||||||
|
|
||||||
double BSIM4oxideTrapDensityA;
|
double BSIM4oxideTrapDensityA;
|
||||||
double BSIM4oxideTrapDensityB;
|
double BSIM4oxideTrapDensityB;
|
||||||
|
|
@ -1398,6 +1425,8 @@ typedef struct sBSIM4model
|
||||||
unsigned BSIM4cleGiven :1;
|
unsigned BSIM4cleGiven :1;
|
||||||
unsigned BSIM4dwcGiven :1;
|
unsigned BSIM4dwcGiven :1;
|
||||||
unsigned BSIM4dlcGiven :1;
|
unsigned BSIM4dlcGiven :1;
|
||||||
|
unsigned BSIM4xwGiven :1;
|
||||||
|
unsigned BSIM4xlGiven :1;
|
||||||
unsigned BSIM4dlcigGiven :1;
|
unsigned BSIM4dlcigGiven :1;
|
||||||
unsigned BSIM4dwjGiven :1;
|
unsigned BSIM4dwjGiven :1;
|
||||||
unsigned BSIM4noffGiven :1;
|
unsigned BSIM4noffGiven :1;
|
||||||
|
|
@ -2511,37 +2540,39 @@ typedef struct sBSIM4model
|
||||||
#define BSIM4_MOD_WMAX 864
|
#define BSIM4_MOD_WMAX 864
|
||||||
#define BSIM4_MOD_DWC 865
|
#define BSIM4_MOD_DWC 865
|
||||||
#define BSIM4_MOD_DLC 866
|
#define BSIM4_MOD_DLC 866
|
||||||
#define BSIM4_MOD_EM 867
|
#define BSIM4_MOD_XL 867
|
||||||
#define BSIM4_MOD_EF 868
|
#define BSIM4_MOD_XW 868
|
||||||
#define BSIM4_MOD_AF 869
|
#define BSIM4_MOD_EM 869
|
||||||
#define BSIM4_MOD_KF 870
|
#define BSIM4_MOD_EF 870
|
||||||
#define BSIM4_MOD_NJS 871
|
#define BSIM4_MOD_AF 871
|
||||||
#define BSIM4_MOD_XTIS 872
|
#define BSIM4_MOD_KF 872
|
||||||
#define BSIM4_MOD_PBSWGS 873
|
#define BSIM4_MOD_NJS 873
|
||||||
#define BSIM4_MOD_MJSWGS 874
|
#define BSIM4_MOD_XTIS 874
|
||||||
#define BSIM4_MOD_CJSWGS 875
|
#define BSIM4_MOD_PBSWGS 875
|
||||||
#define BSIM4_MOD_JSWS 876
|
#define BSIM4_MOD_MJSWGS 876
|
||||||
#define BSIM4_MOD_LLC 877
|
#define BSIM4_MOD_CJSWGS 877
|
||||||
#define BSIM4_MOD_LWC 878
|
#define BSIM4_MOD_JSWS 878
|
||||||
#define BSIM4_MOD_LWLC 879
|
#define BSIM4_MOD_LLC 879
|
||||||
#define BSIM4_MOD_WLC 880
|
#define BSIM4_MOD_LWC 880
|
||||||
#define BSIM4_MOD_WWC 881
|
#define BSIM4_MOD_LWLC 881
|
||||||
#define BSIM4_MOD_WWLC 882
|
#define BSIM4_MOD_WLC 882
|
||||||
#define BSIM4_MOD_DWJ 883
|
#define BSIM4_MOD_WWC 883
|
||||||
#define BSIM4_MOD_JSD 884
|
#define BSIM4_MOD_WWLC 884
|
||||||
#define BSIM4_MOD_PBD 885
|
#define BSIM4_MOD_DWJ 885
|
||||||
#define BSIM4_MOD_MJD 886
|
#define BSIM4_MOD_JSD 886
|
||||||
#define BSIM4_MOD_PBSWD 887
|
#define BSIM4_MOD_PBD 887
|
||||||
#define BSIM4_MOD_MJSWD 888
|
#define BSIM4_MOD_MJD 888
|
||||||
#define BSIM4_MOD_CJD 889
|
#define BSIM4_MOD_PBSWD 889
|
||||||
#define BSIM4_MOD_CJSWD 890
|
#define BSIM4_MOD_MJSWD 890
|
||||||
#define BSIM4_MOD_NJD 891
|
#define BSIM4_MOD_CJD 891
|
||||||
#define BSIM4_MOD_XTID 892
|
#define BSIM4_MOD_CJSWD 892
|
||||||
#define BSIM4_MOD_PBSWGD 893
|
#define BSIM4_MOD_NJD 893
|
||||||
#define BSIM4_MOD_MJSWGD 894
|
#define BSIM4_MOD_XTID 894
|
||||||
#define BSIM4_MOD_CJSWGD 895
|
#define BSIM4_MOD_PBSWGD 895
|
||||||
#define BSIM4_MOD_JSWD 896
|
#define BSIM4_MOD_MJSWGD 896
|
||||||
#define BSIM4_MOD_DLCIG 897
|
#define BSIM4_MOD_CJSWGD 897
|
||||||
|
#define BSIM4_MOD_JSWD 898
|
||||||
|
#define BSIM4_MOD_DLCIG 899
|
||||||
|
|
||||||
/* device questions */
|
/* device questions */
|
||||||
#define BSIM4_DNODE 945
|
#define BSIM4_DNODE 945
|
||||||
|
|
@ -2574,17 +2605,17 @@ typedef struct sBSIM4model
|
||||||
#define BSIM4_CQG 972
|
#define BSIM4_CQG 972
|
||||||
#define BSIM4_QD 973
|
#define BSIM4_QD 973
|
||||||
#define BSIM4_CQD 974
|
#define BSIM4_CQD 974
|
||||||
#define BSIM4_CGG 975
|
#define BSIM4_CGGB 975
|
||||||
#define BSIM4_CGD 976
|
#define BSIM4_CGDB 976
|
||||||
#define BSIM4_CGS 977
|
#define BSIM4_CGSB 977
|
||||||
#define BSIM4_CBG 978
|
#define BSIM4_CBGB 978
|
||||||
#define BSIM4_CAPBD 979
|
#define BSIM4_CAPBD 979
|
||||||
#define BSIM4_CQBD 980
|
#define BSIM4_CQBD 980
|
||||||
#define BSIM4_CAPBS 981
|
#define BSIM4_CAPBS 981
|
||||||
#define BSIM4_CQBS 982
|
#define BSIM4_CQBS 982
|
||||||
#define BSIM4_CDG 983
|
#define BSIM4_CDGB 983
|
||||||
#define BSIM4_CDD 984
|
#define BSIM4_CDDB 984
|
||||||
#define BSIM4_CDS 985
|
#define BSIM4_CDSB 985
|
||||||
#define BSIM4_VON 986
|
#define BSIM4_VON 986
|
||||||
#define BSIM4_VDSAT 987
|
#define BSIM4_VDSAT 987
|
||||||
#define BSIM4_QBS 988
|
#define BSIM4_QBS 988
|
||||||
|
|
@ -2593,7 +2624,26 @@ typedef struct sBSIM4model
|
||||||
#define BSIM4_DRAINCONDUCT 991
|
#define BSIM4_DRAINCONDUCT 991
|
||||||
#define BSIM4_CBDB 992
|
#define BSIM4_CBDB 992
|
||||||
#define BSIM4_CBSB 993
|
#define BSIM4_CBSB 993
|
||||||
|
#define BSIM4_CSUB 994
|
||||||
|
#define BSIM4_QINV 995
|
||||||
|
#define BSIM4_IGIDL 996
|
||||||
|
#define BSIM4_CSGB 997
|
||||||
|
#define BSIM4_CSDB 998
|
||||||
|
#define BSIM4_CSSB 999
|
||||||
|
#define BSIM4_CGBB 1000
|
||||||
|
#define BSIM4_CDBB 1001
|
||||||
|
#define BSIM4_CSBB 1002
|
||||||
|
#define BSIM4_CBBB 1003
|
||||||
|
#define BSIM4_QS 1004
|
||||||
|
#define BSIM4_IGISL 1005
|
||||||
|
#define BSIM4_IGS 1006
|
||||||
|
#define BSIM4_IGD 1007
|
||||||
|
#define BSIM4_IGB 1008
|
||||||
|
#define BSIM4_IGCS 1009
|
||||||
|
#define BSIM4_IGCD 1010
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
#include "bsim4ext.h"
|
#include "bsim4ext.h"
|
||||||
|
|
||||||
#ifdef __STDC__
|
#ifdef __STDC__
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 2000 Regents of the University of California. All rights reserved.
|
Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
Author: 2000 Weidong Liu.
|
Author: 2000 Weidong Liu
|
||||||
|
Author: 2001 Xuemei Xi
|
||||||
File: bsim4ext.h
|
File: bsim4ext.h
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,89 @@
|
||||||
/**********
|
/**********
|
||||||
Copyright 2000 Regents of the University of California. All rights reserved.
|
Copyright 2001 Regents of the University of California. All rights reserved.
|
||||||
Author: 2000 Weidong Liu.
|
Author: 2000 Weidong Liu.
|
||||||
|
Author: 2001 Xuemei Xi
|
||||||
File: bsim4itf.h
|
File: bsim4itf.h
|
||||||
**********/
|
**********/
|
||||||
|
#ifdef DEV_bsim4
|
||||||
|
|
||||||
#ifndef DEV_BSIM4
|
#ifndef DEV_BSIM4
|
||||||
#define DEV_BSIM4
|
#define DEV_BSIM4
|
||||||
|
|
||||||
SPICEdev *get_bsim4_info(void);
|
#include "bsim4ext.h"
|
||||||
|
|
||||||
|
extern IFparm BSIM4pTable[ ];
|
||||||
|
extern IFparm BSIM4mPTable[ ];
|
||||||
|
extern char *BSIM4names[ ];
|
||||||
|
extern int BSIM4pTSize;
|
||||||
|
extern int BSIM4mPTSize;
|
||||||
|
extern int BSIM4nSize;
|
||||||
|
extern int BSIM4iSize;
|
||||||
|
extern int BSIM4mSize;
|
||||||
|
|
||||||
|
SPICEdev B4info = {
|
||||||
|
{ "BSIM4",
|
||||||
|
"Berkeley Short Channel IGFET Model-4",
|
||||||
|
|
||||||
|
&BSIM4nSize,
|
||||||
|
&BSIM4nSize,
|
||||||
|
BSIM4names,
|
||||||
|
|
||||||
|
&BSIM4pTSize,
|
||||||
|
BSIM4pTable,
|
||||||
|
|
||||||
|
&BSIM4mPTSize,
|
||||||
|
BSIM4mPTable,
|
||||||
|
DEV_DEFAULT
|
||||||
|
},
|
||||||
|
BSIM4param,
|
||||||
|
BSIM4mParam,
|
||||||
|
BSIM4load,
|
||||||
|
BSIM4setup,
|
||||||
|
BSIM4unsetup,
|
||||||
|
BSIM4setup,
|
||||||
|
BSIM4temp,
|
||||||
|
BSIM4trunc,
|
||||||
|
NULL,
|
||||||
|
BSIM4acLoad,
|
||||||
|
NULL,
|
||||||
|
BSIM4destroy,
|
||||||
|
#ifdef DELETES
|
||||||
|
BSIM4mDelete,
|
||||||
|
BSIM4delete,
|
||||||
|
#else /* DELETES */
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
#endif /* DELETES */
|
||||||
|
BSIM4getic,
|
||||||
|
BSIM4ask,
|
||||||
|
BSIM4mAsk,
|
||||||
|
#ifdef AN_pz
|
||||||
|
BSIM4pzLoad,
|
||||||
|
#else /* AN_pz */
|
||||||
|
NULL,
|
||||||
|
#endif /* AN_pz */
|
||||||
|
#ifdef NEWCONV
|
||||||
|
BSIM4convTest,
|
||||||
|
#else /* NEWCONV */
|
||||||
|
NULL,
|
||||||
|
#endif /* NEWCONV */
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
|
||||||
|
#ifdef AN_noise
|
||||||
|
BSIM4noise,
|
||||||
|
#else /* AN_noise */
|
||||||
|
NULL,
|
||||||
|
#endif /* AN_noise */
|
||||||
|
|
||||||
|
&BSIM4iSize,
|
||||||
|
&BSIM4mSize
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue