-- File: [Cherry]<Thyme>Spice>Level2Mosfet.thy
-- Last edited:
-- SChen,   March 9, 1984  11:29 AM

Mosfet: circuit[drain, gate, source, bulk|

  -- <Note> 
  -- The order of the above four nodes, and the units for the following 
  -- parameters are the same as those used for Spice
  
  L← 20u, -- (meter) mask value of channel Length
  W← 20u, -- (meter) mask value of channel width
  Ld← 0.2u, -- (meter) lateral diffusion
  BB← 0, -- (meter) bird's beak effect
  MFW← -0.3u, -- (meter) mask fringing width
  MFL← 0.3u, -- (meter) mask fringing length
  Dln← 15u, -- (meter) diffusion length (source/drain extension)
  Xj← 0.27u, -- (meter) metallurgical junction depth

  Js← 6.7E-5, -- (A/m↑2) bulk junction saturation current per sq-meter of junction area
  Kp← 5E-5, -- (A/V↑2) transconductance parameter
  Vto← 0.6, -- (V) zero bias threshold voltage
  Phi← 0.681, -- (V) surface potential (2PhiF)
  Pb← 0.81, -- (V) bulk junction potential
  Ucrit← 5E4, -- (V/cm) critical field for mobility degradation
  Gamma← 0.6, -- (V↑0.5) bulk threshold parameter
  Lambda← 0.044, -- (1/V) channel length modulation
  Uo← 556, -- (cm↑2/V-s) surface mobility
  Vmax← 5E4, -- (m/s) maximum drift velocity of carriers
  Nfs← 3E11, -- (1/cm↑2) fast surface state density
  Nsub← 3E16, -- (1/cm↑3) substrate doping
  Tox← 320E-10, -- (meter) oxide thickness

  Cgso← 2.85E-10, -- (F/m) gate-source overlap capacitance per meter channel width
  Cgdo← 2.85E-10, -- (F/m) gate-drain overlap capacitance per meter channel width
  Cgbo← 1.51E-10, -- (F/m) gate-bulk overlap capacitance per meter channel length
  Cj← 3.3E-4, -- (F/m↑2) zero bias bulk junction bottom cap. per sq-meter of junction area
  Mj← 0.643, -- () bulk junction bottom grading coef.
  Cjsw← 3.15E-10, -- (F/m) zero bias bulk junction sidewall cap. per meter of junction perimeter
  Mjsw← 0.181, -- () bulk junction sidewall grading coef.
  M← 0.1, -- off gate capacitance multiplier

  Uexp← 0.23, -- () critical field exponent in mobility degradation
  Neff← 1, -- () total channel charge (fixed and mobile) coefficient
  Fc← 0.5, -- () coefficient for forward bias depletion cap. formula
  Delta← 0.6, -- () width effect on threshold voltage
  TDegC← 27, -- temparature (degree C)
  TypeOfChannel← 1, -- channel type (1: n channel, -1: p channel)
  minNodeVoltage← -20, -- (V)
  maxNodeVoltage← 20, -- (V)
  Tpg← 1 -- type of gate material, 
         -- 1: opp. to subs; -1: same as subs; 0: Al gate.
  ]
  asserts[Dln > 0, Xj > 0, Js > 0, Kp > 0, Phi > 0,
    Pb > 0, Ucrit > 0, Gamma > 0, Lambda < 0.2, Uo > 0, Vmax >= 0, 
    Nfs >= 0, Nsub > 1.45E10, Tox > 0, Cgso >= 0, Cgdo >= 0, Cgbo >= 0,
    Cj > 0, Mj >= 0, Cjsw >= 0, Mjsw >= 0, M >= 0, M < 0.4,
    Uexp >= 0, Neff > 0, Fc <= 0.95, Delta >= 0, TDegC >= -50
    ]= {

  Mos0: circuit[| T2DegK, Leff, Weff, Cox, xNsub, Vbi, Eg, Vt, Arg,
    FcPb, F2, F3, TypeChcek, TpgCheck]
    asserts[Leff > 0.5u, Weff > 0.5u, TypeChcek=0, TpgCheck=0]= {

    Mos1: circuit[| As, Ad, Ps, Pd, T2Over300, Xd, PbFactor, Eg2, 
      Vt2, Cgb, F1]
      asserts[As > 0, Ad > 0, Ps > 0, Pd > 0]= {
  
      Mos2: circuit[| TRatioTo23rds, Js2, Arg2, Pbo]= {
  
        Mos3: circuit[| PbFactor2, GmaOld]= {
          
          Mos4: circuit[| Phi2, Pb2, GmaNew, CoeCjOld, CoeCjswOld]= {
            
            Mos5: circuit[| PbRatio, SqRtPhi, CoeCjNew, CoeCjswNew]= {
              
              Mos6: circuit[| FcPb2, Cj2, Cjsw2]= {
                
                Mos7: circuit[| CbsBot, CbdBot, CbsSide, CbdSide]= {
         
                  mosModel: model← SpiceLevel2[drain, gate, source, bulk|
                    Leff, -- (m)
                    Weff, -- (m)
                    Xd, -- (m)
                    Xj, -- (m)
                    Js2*As, -- Issat (A)
                    Js2*Ad, -- Idsat (A)
                    Kp/TRatioTo23rds*Weff/Leff, -- beta (A/V↑2)
                    Phi2, -- Phi (V)
                    SqRtPhi, -- Phi↑0.5 (V↑0.5)
                    Phi2*SqRtPhi, -- Phi↑1.5 (V↑1.5)
                    Pb2, -- Pb (V)
                    /Pb2, -- Pb↑0.5 (V↑0.5)
                    Ucrit*1E2*11.7/3.9*Tox, -- Vbp (V)
                    TypeOfChannel*Vbi+(Phi2-Phi)/2+(Eg-Eg2)/2, -- vbi (V)
                    Gamma, -- Gamma (V↑0.5)
                    Lambda, -- Lambda (1/V)
                    8.61707E-5*T2DegK, -- Vt (eV)
                    Uo*1E-4/TRatioTo23rds, -- Uo (m↑2/V-s)
                    Vmax, -- vmax (m/s)
                    1.60218E-19*Nfs*1E4, -- QNfs (C/m↑2)
                    xNsub, -- Nsub (1/m↑3)
                    Uexp, -- ()
                    Neff, -- ()
                    1+F1, -- Eta ()
                    F1, -- Factor ()

                    Cox, -- (F/m↑2)
                    Cgso*Weff, -- CovGS (F)
                    Cgdo*Weff, -- CovDS (F)
                    Cgb*M, -- CgbM (F)
                    Cgb*2.0/3.0, -- Cgb23rds (F)

                    CbsBot, -- CbsBottom (F)
                    CbdBot, -- CbdBottom (F)
                    CbsSide, -- CbsSW (F)
                    CbdSide, -- CbdSW (F)
                    F3*(CbsBot+CbsSide)/F2, -- CbsFwd1 (F)
                    (CbsBot*Mj+CbsSide*Mjsw)/F2/Pb2, -- CbsFwd2 (1/V)
                    F3*(CbdBot+CbdSide)/F2, -- CbdFwd1 (F)
                    (CbdBot*Mj+CbdSide*Mjsw)/F2/Pb2, -- CbdFwd2 (1/V)
                    Mj, -- ()
                    Mjsw, -- ()
                    FcPb2, -- FcPb (V)
                    TypeOfChannel*Vto, -- Von (V)
                    minNodeVoltage, -- (V)
                    maxNodeVoltage, -- (V)
                    TypeOfChannel -- Sign ()
                    ];
            
                  i:   current[drain, source]  ← mosModel[0];
                  cgb: capacitor[gate, bulk]   ← mosModel[1];
                  cgs: capacitor[gate, source] ← mosModel[2];
                  cgd: capacitor[gate, drain]  ← mosModel[3];
                  cbs: capacitor[bulk, source] ← mosModel[4];
                  cbd: capacitor[bulk, drain]  ← mosModel[5];
                  jbs: current[bulk, source]   ← mosModel[6];
                  jbd: current[bulk, drain]    ← mosModel[7]
                  };
                  
                mos7: Mos7[|
                  CbsBot← Cj2*As, -- (F)
                  CbdBot← Cj2*Ad, -- (F)
                  CbsSide← Cjsw2*Ps, -- (F)
                  CbdSide← Cjsw2*Pd -- (F)
                  ]
                };
                
              mos6: Mos6[|
                FcPb2← FcPb*PbRatio, -- (V)
                Cj2← Cj/CoeCjOld*CoeCjNew, -- (F/m↑2)
                Cjsw2← Cjsw/CoeCjswOld*CoeCjswNew -- (F/m↑2)
                ]
              };
              
            mos5: Mos5[|
              PbRatio← Pb2/Pb, -- ()
              SqRtPhi← /Phi2, -- (V↑0.5)
              CoeCjNew← 1+Mj*(4E-4*(T2DegK-300)-GmaNew), -- ()
              CoeCjswNew← 1+Mjsw*(4E-4*(T2DegK-300)-GmaNew) -- ()
              ]
            };
            
          mos4: Mos4[|
            Phi2← T2Over300*(Phi-PbFactor)+PbFactor2, -- (V)
            Pb2← T2Over300*Pbo+PbFactor2, -- (V)
            GmaNew← T2Over300+PbFactor2/Pbo-1, -- ()
            CoeCjOld← 1-Mj*GmaOld, -- ()
            CoeCjswOld← 1-Mjsw*GmaOld -- ()
            ]
          };
            
        mos3: Mos3[|
          PbFactor2← -2*Vt2*(1.5*\T2Over300 + Arg2), -- (V)
          GmaOld← Pb/Pbo-1 -- ()
          ]
        };
          
      mos2: Mos2[|
        TRatioTo23rds← T2Over300*/T2Over300, -- ()
        Js2← Js*↑(Eg/Vt-Eg2/Vt2), -- (A/m↑2)
        Arg2← 1.1150877/(2*0.0259)-Eg2/(2*8.61707E-5*T2DegK), -- ()
        Pbo← Pb-PbFactor -- (V)
        ] 
      };
        
    mos1: Mos1[|
      As← Weff*Dln, -- (m↑2)
      Ad← Weff*Dln, -- (m↑2)
      Ps← Weff+2*Dln, -- (m)
      Pd← Weff+2*Dln, -- (m)
      T2Over300← T2DegK/300.0, -- T/300 ()
      Xd← /(2*11.7*8.854215E-12/1.60218E-19/xNsub), -- (m)
      PbFactor← -2*Vt*Arg, -- (V)
      Eg2← (1.16 - (7.02E-4*T2DegK*T2DegK)/(T2DegK+1108.0)), -- (eV),
      Vt2← 1.38066E-23*T2DegK/1.60218E-19, -- kT/q (V),
      Cgb← Cgbo*Leff, -- (F)
      F1← Delta*6.2832*11.7/3.9*Tox/Weff/8 -- ()
      ]
    };

  mos0: Mos0[|
    T2DegK← TDegC+273.16, -- (K)
    Leff← L - 2*Ld + 2*MFL, -- (m) 
    Weff← W - 2*BB + 2*MFW, -- (m)
    Cox← 3.9*8.854215E-12/Tox, -- (F/m↑2)
    xNsub← Nsub*1.0E6, -- (1/m↑3)
    Vbi← Vto-TypeOfChannel*Gamma*/Phi, -- (V)
    Eg← 1.12, -- Eg @300K (eV)
    Vt← 0.0259, -- Vt @300K (V)
    Arg← (1.1150877-1.12)/(2*0.0259), -- ()
    FcPb← Fc*Pb, -- (V)
    F2← ↑(1.5*\(1-Fc)), -- ()
    F3← 1-1.5*Fc, -- ()
    TypeChcek← TypeOfChannel*TypeOfChannel-1, -- ()
    TpgCheck← Tpg*(Tpg*Tpg-1) -- ()
    ]
  };
-- 3/9/84, SChen
-- As, Ad, Ps and Pd are calculated from Weff instead of W.
-- changed the following 'asserts' conditions:
--   Insure Js # 0, to avoid dividing by zero.
--   Set aribrary lower bounds for Weff and Leff to be 0.5 microns.