📄 soi3cap.c
字号:
/**********STAG version 2.7Copyright 2000 owned by the United Kingdom Secretary of State for Defenceacting through the Defence Evaluation and Research Agency.Developed by : Jim Benson, Department of Electronics and Computer Science, University of Southampton, United Kingdom.With help from : Nele D'Halleweyn, Ketan Mistry, Bill Redman-White, and Craig Easson.Based on STAG version 2.1Developed by : Mike Lee,With help from : Bernard Tenbroek, Bill Redman-White, Mike Uren, Chris Edwards and John Bunyan.Acknowledgements : Rupert Howes and Pete Mole.**********//********** Modified by Paolo Nenzi 2002ngspice integration**********/#include "ngspice.h"#include "cktdefs.h"#include "suffix.h"#include "soi3defs.h"#include "trandefs.h"#include "const.h"voidSOI3cap(double vgB, double Phiplusvsb, double gammaB, double paramargs[10], double Bfargs[2], double alpha_args[2], double psi_st0args[5], double vGTargs[5], double psi_sLargs[5], double psi_s0args[5], double ldargs[5], double *Qg, double *Qb, double *Qd, double *QgB, double *cgfgf, double *cgfd, double *cgfs, double *cgfdeltaT, double *cgfgb, double *cbgf, double *cbd, double *cbs, double *cbdeltaT, double *cbgb, double *cdgf, double *cdd, double *cds, double *cddeltaT, double *cdgb, double *cgbgf, double *cgbd, double *cgbs, double *cgbdeltaT, double *cgbgb )/****** Part 1 - declare local variables. ******/{double WCox,WCob,L;double gamma,eta_s,vt,delta,sigma,chiFB;double Bf,pDBf_Dpsi_st0;double alpha,Dalpha_Dvgfb,Dalpha_Dvdb,Dalpha_Dvsb,Dalpha_DdeltaT;double Dpsi_st0_Dvgfb,Dpsi_st0_Dvdb,Dpsi_st0_Dvsb,Dpsi_st0_DdeltaT;double vGT,DvGT_Dvgfb,DvGT_Dvdb,DvGT_Dvsb,DvGT_DdeltaT;double psi_sL,Dpsi_sL_Dvgfb,Dpsi_sL_Dvdb,Dpsi_sL_Dvsb,Dpsi_sL_DdeltaT;double psi_s0,Dpsi_s0_Dvgfb,Dpsi_s0_Dvdb,Dpsi_s0_Dvsb,Dpsi_s0_DdeltaT;double ld,Dld_Dvgfb,Dld_Dvdb,Dld_Dvsb,Dld_DdeltaT;double Lprime,Fc;double Qbprime,Qcprime,Qdprime,Qgprime,Qb2prime,Qc2prime,Qd2prime,Qg2prime;double Dlimc,Dlimd;double Vqd,Vqs;double F,F2;double cq,dq;double dercq,derdq;double sigmaC,Eqc,Eqd;double DVqs_Dvgfb,DVqs_Dvdb,DVqs_Dvsb,DVqs_DdeltaT;double DF_Dvgfb,DF_Dvdb,DF_Dvsb,DF_DdeltaT;double ccgf,ccd,ccs,ccdeltaT,ccgb;double vg,vgacc,Egacc,tmpacc,Qacc;double csf;/****** Part 2 - extract variables passed from soi3load(), which ******//****** have been passed to soi3cap() in *arg arrays. ******/WCox = paramargs[0];L = paramargs[1];gamma = paramargs[2];eta_s = paramargs[3];vt = paramargs[4];delta = paramargs[5];WCob = paramargs[6];sigma = paramargs[7];chiFB = paramargs[8];csf = paramargs[9];Bf = Bfargs[0];pDBf_Dpsi_st0 = Bfargs[1];alpha = alpha_args[0];Dalpha_Dvgfb = alpha_args[1];Dalpha_Dvdb = alpha_args[2];Dalpha_Dvsb = alpha_args[3];Dalpha_DdeltaT = alpha_args[4];Dpsi_st0_Dvgfb = psi_st0args[1];Dpsi_st0_Dvdb = psi_st0args[2];Dpsi_st0_Dvsb = psi_st0args[3];Dpsi_st0_DdeltaT = psi_st0args[4];vGT = vGTargs[0];DvGT_Dvgfb = vGTargs[1];DvGT_Dvdb = vGTargs[2];DvGT_Dvsb = vGTargs[3];DvGT_DdeltaT = vGTargs[4];psi_sL = psi_sLargs[0];Dpsi_sL_Dvgfb = psi_sLargs[1];Dpsi_sL_Dvdb = psi_sLargs[2];Dpsi_sL_Dvsb = psi_sLargs[3];Dpsi_sL_DdeltaT = psi_sLargs[4];psi_s0 = psi_s0args[0];Dpsi_s0_Dvgfb = psi_s0args[1];Dpsi_s0_Dvdb = psi_s0args[2];Dpsi_s0_Dvsb = psi_s0args[3];Dpsi_s0_DdeltaT = psi_s0args[4];ld = ldargs[0];Dld_Dvgfb = ldargs[1];Dld_Dvdb = ldargs[2];Dld_Dvsb = ldargs[3];Dld_DdeltaT = ldargs[4];/****** Part 3 - define some important quantities. ******/sigmaC = 1E-8;Vqd = (vGT - alpha*psi_sL); /* This is -qd/Cof */Vqs = (vGT - alpha*psi_s0); /* This is -qs/Cof */if (Vqs<=0){ /* deep subthreshold contingency */ F = 1;} else{ F = Vqd/Vqs; if (F<0) { /* physically impossible situation */ F=0; }}F2 = F*F;Fc = 1 + ld/L;Lprime = L/Fc;/****** Part 4 - calculate normalised (see note below) terminal ******//****** charge expressions for the GCA region. ******//* JimB - important note *//* The charge expressions Qcprime, Qd2prime etc in this file are not charges *//* but voltages! Each expression is equal to the derived expression for the *//* total charge in each region, but divided by a factor WL'Cof. This is *//* compensated for later on. *//* Channel charge Qc1 */cq = (F*F + F + 1)/(F+1);Qcprime = -2*Vqs*cq/3;if ((-Qcprime/sigmaC)<MAX_EXP_ARG) { Eqc = exp(-Qcprime/sigmaC); Qcprime = -sigmaC*log(1 + Eqc); Dlimc = Eqc/(1+Eqc);} else { Dlimc = 1;}/* Drain charge Qd1 */dq = (3*F2*F + 6*F2 + 4*F + 2)/((1+F)*(1+F));Qdprime = -2*Vqs*dq/15;if((-Qdprime/sigmaC)<MAX_EXP_ARG) { Eqd = exp(-Qdprime/sigmaC); Qdprime = -sigmaC*log(1 + Eqd); Dlimd = Eqd/(1+Eqd);} else { Dlimd = 1;}/* Body charge Qb1 */Qbprime = -gamma*(Bf + (delta/alpha)*(vGT + Qcprime));/* Gate charge Qg1 */Qgprime = -Qcprime-Qbprime;/****** Part 5 - calculate capacitances and transcapacitances ******//****** for the GCA region. For the moment, we are not taking ******//****** account of the bias dependence of ld and Lprime. This ******//****** will be done in Part 8, when both GCA and drain charge ******//****** terms will be included in the final capacitance ******//****** expressions. ******/DVqs_Dvgfb = DvGT_Dvgfb - alpha*Dpsi_s0_Dvgfb - psi_s0*Dalpha_Dvgfb;DVqs_Dvdb = DvGT_Dvdb - alpha*Dpsi_s0_Dvdb - psi_s0*Dalpha_Dvdb;DVqs_Dvsb = DvGT_Dvsb - alpha*Dpsi_s0_Dvsb - psi_s0*Dalpha_Dvsb;DVqs_DdeltaT = DvGT_DdeltaT - alpha*Dpsi_s0_DdeltaT - psi_s0*Dalpha_DdeltaT;if (Vqs==0){ DF_Dvgfb = 0; DF_Dvdb = 0; DF_Dvsb = 0; DF_DdeltaT = 0;}else{ DF_Dvgfb = (DvGT_Dvgfb - alpha*Dpsi_sL_Dvgfb - psi_sL*Dalpha_Dvgfb - F*DVqs_Dvgfb)/Vqs; DF_Dvdb = (DvGT_Dvdb - alpha*Dpsi_sL_Dvdb - psi_sL*Dalpha_Dvdb - F*DVqs_Dvdb)/Vqs; DF_Dvsb = (DvGT_Dvsb - alpha*Dpsi_sL_Dvsb - psi_sL*Dalpha_Dvsb - F*DVqs_Dvsb)/Vqs; DF_DdeltaT = (DvGT_DdeltaT - alpha*Dpsi_sL_DdeltaT - psi_sL*Dalpha_DdeltaT - F*DVqs_DdeltaT)/Vqs;}dercq = F*(2+F)/((1+F)*(1+F));ccgf = Dlimc*(-2*(DVqs_Dvgfb*cq + Vqs*dercq*DF_Dvgfb)/3);ccd = Dlimc*(-2*(DVqs_Dvdb*cq + Vqs*dercq*DF_Dvdb)/3);ccs = Dlimc*(-2*(DVqs_Dvsb*cq + Vqs*dercq*DF_Dvsb)/3);ccdeltaT = Dlimc*(-2*(DVqs_DdeltaT*cq + Vqs*dercq*DF_DdeltaT)/3);ccgb = 0;derdq = F*(3*F2 + 9*F + 8)/((1+F)*(1+F)*(1+F));*cdgf = Dlimd*(-2*(DVqs_Dvgfb * dq + Vqs*derdq*DF_Dvgfb)/15);*cdd = Dlimd*(-2*(DVqs_Dvdb * dq + Vqs*derdq*DF_Dvdb)/15);*cds = Dlimd*(-2*(DVqs_Dvsb * dq + Vqs*derdq*DF_Dvsb)/15);*cddeltaT = Dlimd*(-2*(DVqs_DdeltaT * dq + Vqs*derdq*DF_DdeltaT)/15);*cdgb = 0;/* JimB - note that for the following expressions, the Vx dependence of *//* delta is accounted for by the term (vGT+Qcprime)*(Dalpha_Dvx/gamma). */*cbgf = -gamma * (pDBf_Dpsi_st0*Dpsi_st0_Dvgfb + (alpha*(delta*(DvGT_Dvgfb + ccgf) + (vGT+Qcprime)*(Dalpha_Dvgfb/gamma)) - delta*(vGT+Qcprime)*Dalpha_Dvgfb )/(alpha*alpha) );*cbd = -gamma * (pDBf_Dpsi_st0*Dpsi_st0_Dvdb + (alpha*(delta*(DvGT_Dvdb + ccd) +
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -