This package Mos1 contains functions and record with data of the mosfet model level 1.
Extends from Modelica.Icons.Package (Icon for standard packages).
Name | Description |
---|---|
Mos1ModelLineParams | Record for Mosfet model line parameters (for level 1) |
Mos1Calc | Further mosfet variables (for level 1) |
mos1ModelLineParamsInitEquations | Initial precalculation |
drainCur | Drain current calculation |
mos1RenameParameters | Parameter renaming to internal names |
mos1RenameParametersDev | Device parameter renaming to internal names |
This record Mos1ModelLineParams contains the model line parameters that are used for the mosfet transistors level 1 in SPICE3.
Extends from Mos.MosModelLineParams (Record for Mosfet model line parameters (for level 1, 2, 3 and 6)).
Type | Name | Default | Description |
---|---|---|---|
Initialization | |||
Real | m_jctSatCurDensity.start | 0.0 | JS, Bulk jct. sat. current density, input - use tSatCurDens |
Resistance | m_sheetResistance.start | 0.0 | RSH, Sheet resistance [Ohm] |
Real | m_bulkJctPotential.start | 0.8 | PB, Bulk junction potential, input - use tBulkPot |
Real | m_bulkJctBotGradingCoeff.start | 0.5 | MJ, Bottom grading coefficient |
Real | m_bulkJctSideGradingCoeff.start | 0.5 | MJSW, Side grading coefficient |
Real | m_oxideThickness.start | 1.0e-7 | TOX, Oxide thickness unit: micron |
Real | m_gateSourceOverlapCapFactor.start | 0.0 | CGS0, Gate-source overlap cap |
Real | m_gateDrainOverlapCapFactor.start | 0.0 | CGD0, Gate-drain overlap cap |
Real | m_gateBulkOverlapCapFactor.start | 0.0 | CGB0, Gate-bulk overlap cap |
Real | m_fNcoef.start | 0.0 | KF, Flicker noise coefficient |
Real | m_fNexp.start | 1.0 | AF, Flicker noise exponent |
Real | m_oxideCapFactor.start | 0.0 | |
Voltage | m_vt0.start | 0.0 | VTO, Threshold voltage [V] |
Capacitance | m_capBD.start | 0.0 | CBD, B-D junction capacitance [F] |
Capacitance | m_capBS.start | 0.0 | CBS, B-S junction capacitance [F] |
CapacitancePerArea | m_bulkCapFactor.start | 0.0 | CJ, Bottom junction cap per area [F/m2] |
Permittivity | m_sideWallCapFactor.start | 0.0 | CJSW, Side grading coefficient [F/m] |
Real | m_fwdCapDepCoeff.start | 0.5 | FC, Forward bias jct. fit parm. |
Voltage | m_phi.start | 0.6 | PHI, Surface potential [V] |
Voltage | m_gamma.start | 0.0 | GAMMA, Bulk threshold parameter [V] |
InversePotential | m_lambda.start | 0.0 | Channel-length modulation [1/V] |
Real | m_substrateDoping.start | 0.0 | NSUB, Substrate doping |
Real | m_gateType.start | 1.0 | TPG, Gate type |
PerArea_cm | m_surfaceStateDensity.start | 0.0 | NSS, Gate type [1/cm2] |
Area_cmPerVoltageSecond | m_surfaceMobility.start | 600.0 | UO, Surface mobility [cm2/(V.s)] |
Length | m_latDiff.start | 0.0 | LD, Lateral diffusion [m] |
Current | m_jctSatCur.start | 1.0e-14 | IS, Bulk junction sat. current [A] |
Resistance | m_drainResistance.start | 0 | RD, Drain ohmic resistance [Ohm] |
Resistance | m_sourceResistance.start | 0 | RS, Source ohmic resistance [Ohm] |
Transconductance | m_transconductance.start | 2.0e-5 | input - use tTransconductance [A/V2] |
record Mos1ModelLineParams "Record for Mosfet model line parameters (for level 1)" extends Mos.MosModelLineParams( m_lambda( start = 0.0), m_transconductance( start = 2.0e-5));end Mos1ModelLineParams;
This record Mos1Calc contains further mosfet variables (for level 1) that are needed for the calculations.
Extends from Mos.MosCalc (Further mosfet variables (for level 1, 2, 3 and 6)).
Type | Name | Default | Description |
---|---|---|---|
Initialization | |||
Integer | m_mode.start | 1 | Mode |
Transconductance | m_tTransconductance.start | 0. | [A/V2] |
Real | m_tSurfMob.start | 0. | |
Voltage | m_tPhi.start | 0.7 | [V] |
Voltage | m_tVto.start | 1. | [V] |
Real | m_tSatCurDens.start | 0. | |
Current | m_tDrainSatCur.start | 0. | [A] |
Current | m_tSourceSatCur.start | 0. | [A] |
Capacitance | m_tCBDb.start | 0. | [F] |
Capacitance | m_tCBDs.start | 0. | [F] |
Capacitance | m_tCBSb.start | 0. | [F] |
Capacitance | m_tCBSs.start | 0. | [F] |
Real | m_tCj.start | 0. | |
Real | m_tCjsw.start | 0. | |
Voltage | m_tBulkPot.start | 0.7 | [V] |
Real | m_tDepCap.start | 0.35 | |
Voltage | m_tVbi.start | 1. | [V] |
Voltage | m_VBScrit.start | 0.7 | [V] |
Voltage | m_VBDcrit.start | 0.7 | [V] |
Real | m_f1b.start | 0. | |
Real | m_f2b.start | 0. | |
Real | m_f3b.start | 0. | |
Real | m_f1s.start | 0. | |
Real | m_f2s.start | 0. | |
Real | m_f3s.start | 0. | |
Real | m_dVt.start | 0. | |
Capacitance | m_capgd.start | 0. | [F] |
Capacitance | m_capgs.start | 0. | [F] |
Capacitance | m_capgb.start | 0. | [F] |
Charge | m_qgs.start | 0. | [C] |
Charge | m_qgd.start | 0. | [C] |
Charge | m_qgb.start | 0. | [C] |
record Mos1Calc "Further mosfet variables (for level 1)" extends Mos.MosCalc;end Mos1Calc;
This function mos1ModelLineParamsInitEquation does the initial precalculation of the mosfet model line parameters for level 1.
Type | Name | Default | Description |
---|---|---|---|
Mos1ModelLineParams | in_p | Input record model line parameters for MOS1 | |
SpiceConstants | in_C | Spice constants | |
Integer | in_m_type | Type of MOS transistor |
Type | Name | Description |
---|---|---|
MosModelLineVariables | out_v | Output record model line variables |
function mos1ModelLineParamsInitEquations "Initial precalculation" input Mos1ModelLineParams in_p "Input record model line parameters for MOS1"; input SpiceConstants in_C "Spice constants"; input Integer in_m_type "Type of MOS transistor"; output Mos.MosModelLineVariables out_v "Output record model line variables"; protected Modelica.SIunits.Voltage vtnom; Modelica.SIunits.Voltage fermis; Real fermig; Real wkfng; Real wkfngs; Real egfet1; Real vfb; algorithm out_v.m_oxideCapFactor := in_p.m_oxideCapFactor; out_v.m_transconductance := in_p.m_transconductance; out_v.m_phi := in_p.m_phi; out_v.m_gamma := in_p.m_gamma; out_v.m_vt0 := in_p.m_vt0; vtnom := in_p.m_tnom*SpiceConstants.CONSTKoverQ; egfet1 := 1.16 - (7.02e-4*in_p.m_tnom*in_p.m_tnom)/(in_p.m_tnom + 1108); if (not (in_p.m_oxideThicknessIsGiven > 0.5) or in_p.m_oxideThickness == 0) then if (in_p.m_oxideThickness == 0) then out_v.m_oxideCapFactor := 0; end if; else out_v.m_oxideCapFactor := 3.9 * 8.854214871e-12 / in_p.m_oxideThickness; if (out_v.m_oxideCapFactor <> 0) then if (not (in_p.m_transconductanceIsGiven > 0.5)) then out_v.m_transconductance := in_p.m_surfaceMobility * out_v.m_oxideCapFactor * 1e-4; // (m**2/cm**2) end if; if (in_p.m_substrateDopingIsGiven > 0.5) then if (in_p.m_substrateDoping * 1e6 > 1.45e16) then // (cm**3/m**3) if (not (in_p.m_phiIsGiven > 0.5)) then out_v.m_phi := 2*vtnom*Modelica.Math.log(in_p.m_substrateDoping*1e6/1.45e16); // (cm**3/m**3) out_v.m_phi := max(0.1, out_v.m_phi); end if; fermis := in_m_type *0.5 * out_v.m_phi; wkfng := 3.2; if (in_p.m_gateType <> 0) then fermig := in_m_type * in_p.m_gateType *0.5 * egfet1; wkfng := 3.25 +0.5 * egfet1 - fermig; end if; wkfngs := wkfng - (3.25 +0.5 * egfet1 + fermis); if (not (in_p.m_gammaIsGiven > 0.5)) then out_v.m_gamma := sqrt(2 * 11.70 * 8.854214871e-12 * SpiceConstants.CHARGE * in_p.m_substrateDoping * 1e6 / out_v.m_oxideCapFactor); // (cm**3/m**3) end if; if (not (in_p.m_vtOIsGiven > 0.5)) then vfb := wkfngs - in_p.m_surfaceStateDensity * 1e4 * SpiceConstants.CHARGE / out_v.m_oxideCapFactor; // (cm**2/m**2) out_v.m_vt0 := vfb + in_m_type * (out_v.m_gamma * sqrt(out_v.m_phi) + out_v.m_phi); end if; end if; end if; end if; end if;end mos1ModelLineParamsInitEquations;
This function drainCur calculates the main currents that flows from drain node to source node (level 1).
Type | Name | Default | Description |
---|---|---|---|
Voltage | vb | [V] | |
Voltage | vg | [V] | |
Voltage | vds | [V] | |
Mos1Calc | in_c | Input record Mos1Calc | |
Mos1ModelLineParams | in_p | Input record model line parameters for MOS1 | |
SpiceConstants | in_C | Spice constants | |
MosModelLineVariables | in_vp | Input record model line variables | |
Integer | in_m_type | Type of Mos transistor |
Type | Name | Description |
---|---|---|
Mos1Calc | out_c | Output record Mos1Calc |
function drainCur "Drain current calculation" input Modelica.SIunits.Voltage vb; input Modelica.SIunits.Voltage vg; input Modelica.SIunits.Voltage vds; input Mos1Calc in_c "Input record Mos1Calc"; input Mos1ModelLineParams in_p "Input record model line parameters for MOS1"; input SpiceConstants in_C "Spice constants"; input Mos.MosModelLineVariables in_vp "Input record model line variables"; input Integer in_m_type "Type of Mos transistor"; output Mos1Calc out_c "Output record Mos1Calc"; protected Real arg; Real betap; Real sarg; Modelica.SIunits.Voltage vgst; algorithm out_c := in_c; if (vb <= 0) then sarg := sqrt( out_c.m_tPhi - vb); else sarg := sqrt( out_c.m_tPhi); sarg := sarg - vb / (sarg + sarg); sarg := max( 0., sarg); end if; out_c.m_von := (out_c.m_tVbi * in_m_type) + in_vp.m_gamma * sarg; vgst := vg - out_c.m_von; out_c.m_vdsat := max( vgst, 0.); arg := if (sarg <= 0) then 0 else in_vp.m_gamma / (sarg + sarg); if (vgst <= 0) then /* cutoff region */ out_c.m_cdrain := 0; out_c.m_gm := 0; out_c.m_gds := 0; out_c.m_gmbs := 0; else betap := out_c.m_Beta*(1 + in_p.m_lambda*vds); if (vgst <= vds) then /* saturation region */ out_c.m_cdrain := betap * vgst * vgst * 0.5; out_c.m_gm := betap * vgst; out_c.m_gds := in_p.m_lambda * out_c.m_Beta * vgst * vgst * 0.5; out_c.m_gmbs := out_c.m_gm * arg; else /* linear region */ out_c.m_cdrain := betap * vds * (vgst - 0.5 * vds); out_c.m_gm := betap * vds; out_c.m_gds := betap * (vgst - vds) + in_p.m_lambda * out_c.m_Beta * vds * (vgst - 0.5 * vds); out_c.m_gmbs := out_c.m_gm * arg; end if; end if;end drainCur;
This function mos1RenameParameters assigns the external (given by the user, e.g., RD) technology parameters to the internal parameters (e.g., m_drainResistance). It also does the analysis of the IsGiven values (level 1).
Type | Name | Default | Description |
---|---|---|---|
ModelcardMOS | ex | Modelcard with technologieparameters | |
SpiceConstants | con | Spice constants |
Type | Name | Description |
---|---|---|
MosModelLineParams | intern | Output record model line parameters |
function mos1RenameParameters "Parameter renaming to internal names" input ModelcardMOS ex "Modelcard with technologieparameters"; input SpiceConstants con "Spice constants"; output Mos.MosModelLineParams intern "Output record model line parameters"; algorithm intern.m_oxideCapFactor := 0; intern.m_vtOIsGiven := if (ex.VTO > -1e40) then 1 else 0; intern.m_vt0 := if (ex.VTO > -1e40) then ex.VTO else 0; intern.m_capBDIsGiven := if (ex.CBD > -1e40) then 1 else 0; intern.m_capBD := if (ex.CBD > -1e40) then ex.CBD else 0; intern.m_capBSIsGiven := if (ex.CBS > -1e40) then 1 else 0; intern.m_capBS := if (ex.CBS > -1e40) then ex.CBS else 0; intern.m_bulkCapFactorIsGiven := if (ex.CJ > -1e40) then 1 else 0; intern.m_bulkCapFactor := if (ex.CJ > -1e40) then ex.CJ else 0; intern.m_sideWallCapFactor := ex.CJSW "F/m zero-bias junction sidewall cap. per meter of junction perimeter (default 0)"; intern.m_fwdCapDepCoeff := ex.FC "Coefficient for forward-bias depletion capacitance formula (default 0.5)"; intern.m_phiIsGiven := if (ex.PHI > -1e40) then 1 else 0; intern.m_phi := if (ex.PHI > -1e40) then ex.PHI else 0.6; intern.m_gammaIsGiven := if (ex.GAMMA > -1e40) then 1 else 0; intern.m_gamma := if (ex.GAMMA > -1e40) then ex.GAMMA else 0; intern.m_lambda := ex.LAMBDA "1/V channel-length modulation (default 0)"; intern.m_substrateDopingIsGiven := if (ex.NSUB > -1e40) then 1 else 0; intern.m_substrateDoping := if (ex.NSUB > -1e40) then ex.NSUB else 0; intern.m_gateType := ex.TPG "Type of gate material: +1 opp. to substrate, -1 same as substrate, 0 Al gate (default 1)"; intern.m_surfaceStateDensity := ex.NSS "IN 1/(cm*cm) surface state density (default 0)"; intern.m_surfaceMobility := ex.UO "In (cm*cm)/(Vs) surface mobility (default 600)"; intern.m_latDiff := ex.LD "In m lateral diffusion (default 0)"; intern.m_jctSatCur := ex.IS "A bulk junction saturation current (defaul 1e-14)"; intern.m_drainResistanceIsGiven := if (ex.RD > -1e40) then 1 else 0; intern.m_drainResistance := if (ex.RD > -1e40) then ex.RD else 0; intern.m_sourceResistanceIsGiven := if (ex.RS > -1e40) then 1 else 0; intern.m_sourceResistance := if (ex.RS > -1e40) then ex.RS else 0; intern.m_transconductanceIsGiven := if (ex.KP > -1e40) then 1 else 0; intern.m_transconductance := if (ex.KP > -1e40) then ex.KP else 2e-5; intern.m_tnom := if (ex.TNOM > -1e40) then ex.TNOM + SpiceConstants.CONSTCtoK else 300.15 "parameter measurement temperature (default 27 deg C)"; intern.m_jctSatCurDensity := ex.JS "A/(m*m) bulk junction saturation current per sq-meter of junction area (default 0)"; intern.m_sheetResistance := ex.RSH "Ohm drain and source diffusion sheet resistance (default 0)"; intern.m_bulkJctPotential := ex.PB "V bulk junction potential (default 0.8)"; intern.m_bulkJctBotGradingCoeff := ex.MJ "bulk junction bottom grading coeff. (default 0.5)"; intern.m_bulkJctSideGradingCoeff := ex.MJSW "bulk junction sidewall grading coeff. (default 0.5)"; intern.m_oxideThicknessIsGiven := if (ex.TOX > -1e40) then 1 else 0; intern.m_oxideThickness := if (ex.TOX > -1e40) then ex.TOX else 0; intern.m_gateSourceOverlapCapFactor := ex.CGSO " F/m gate-source overlap capacitance per meter channel width (default 0)"; intern.m_gateDrainOverlapCapFactor := ex.CGDO "F/m gate-drain overlap capacitance per meter channel width (default 0)"; intern.m_gateBulkOverlapCapFactor := ex.CGBO "F/m gate-bulk overlap capacitance per meter channel width (default 0)"; intern.m_fNcoef := ex.KF "Flicker-noise coefficient (default 0)"; intern.m_fNexp := ex.AF "Flicker-noise exponent (default 1)";end mos1RenameParameters;
This function mos1RenameParametersDev assigns the external (given by the user) device parameters to the internal parameters. It also does the analysis of the IsGiven values (level 1).
Type | Name | Default | Description |
---|---|---|---|
ModelcardMOS | ex | ||
Integer | mtype | ||
Length | W | Channel Width [m] | |
Length | L | Channel Length [m] | |
Area | AD | Area of the drain diffusion [m2] | |
Area | AS | Area of the source diffusion [m2] | |
Length | PD | Perimeter of the drain junction [m] | |
Length | PS | Perimeter of the source junction [m] | |
Real | NRD | Number of squares of the drain diffusions | |
Real | NRS | Number of squares of the source diffusions | |
Integer | OFF | Optional initial condition: 0 - IC not used, 1 - IC used, not implemented yet | |
Real | IC | Initial condition values, not implemented yet | |
Temp_C | TEMP | Temperature [degC] |
Type | Name | Description |
---|---|---|
Mosfet | dev | Output record Mosfet |
function mos1RenameParametersDev "Device parameter renaming to internal names" input ModelcardMOS ex; input Integer mtype; input Modelica.SIunits.Length W "Channel Width"; input Modelica.SIunits.Length L "Channel Length"; input Modelica.SIunits.Area AD "Area of the drain diffusion"; input Modelica.SIunits.Area AS "Area of the source diffusion"; input Modelica.SIunits.Length PD "Perimeter of the drain junction"; input Modelica.SIunits.Length PS "Perimeter of the source junction"; input Real NRD "Number of squares of the drain diffusions"; input Real NRS "Number of squares of the source diffusions"; input Integer OFF "Optional initial condition: 0 - IC not used, 1 - IC used, not implemented yet"; input Real IC "Initial condition values, not implemented yet"; input Modelica.SIunits.Temp_C TEMP "Temperature"; output Mosfet.Mosfet dev "Output record Mosfet"; algorithm /*device parameters*/ dev.m_len := L "L, length of channel region"; dev.m_width := W "W, width of channel region"; dev.m_drainArea := AD "AD, area of drain diffusion"; dev.m_sourceArea := AS "AS, area of source diffusion"; dev.m_drainSquares := NRD "NRD, length of drain in squares"; dev.m_sourceSquares := NRS "NRS, length of source in squares"; dev.m_drainPerimiter := PD "PD, Drain perimeter"; dev.m_sourcePerimiter := PS "PS, Source perimeter"; dev.m_dICVDSIsGiven := if (IC > -1e40) then 1 else 0 "ICVDS IsGivenValue"; dev.m_dICVDS := if (IC > -1e40) then IC else 0 "Initial condition of VDS"; dev.m_dICVGSIsGiven := if (IC > -1e40) then 1 else 0 "ICVGS IsGivenValue"; dev.m_dICVGS := if (IC > -1e40) then IC else 0 "Initial condition of VGS"; dev.m_dICVBSIsGiven := if (IC > -1e40) then 1 else 0 "ICVBS IsGivenValue"; dev.m_dICVBS := if (IC > -1e40) then IC else 0 "Initial condition of VBS"; dev.m_off := OFF "Non-zero to indicate device is off for dc analysis"; dev.m_bPMOS := mtype "P type MOSfet model"; dev.m_nLevel := ex.LEVEL "Level"; assert(ex.LEVEL== 1, "only MOS Level1 implemented"); dev.m_dTemp :=TEMP + SpiceConstants.CONSTCtoK "Device temperature";end mos1RenameParametersDev;