3.16  M: MOSFET

3.16.1  Syntax

Device

Mxxxxxxx nd ng ns nb mname {args}
Mxxxxxxx nd ng ns nb mname {width/length} {args}
.mosfet label nd ng ns nb mname {args}
.mosfet label nd ng ns nb mname {width/length} {args}

Model (required)

.model mname NMOS {args} .model mname PMOS {args}

3.16.2  Purpose

MOSFET.

3.16.3  Comments

Nd, ng, ns, and nb are the drain, gate, source, and bulk (substrate) nodes, respectively. Mname is the model name.

Length and width are the drawn channel length and width, in microns. Note that the notation W/L has units of microns, but the same parameters, in the argument list (W and L) have units of meters. All other dimensions are in meters.

The option (.options command) rstray determines whether or not series resistances are included. rstray (on) is the default. Experience has shown that the effect of series resistance is often not significant, it can significantly degrade the simulation time, and it often increases roundoff errors. rstray is the default for Spice compatibility, and because it usually is significant for the BJT model. Norstray (off) is the equivalent of setting the model parameters rd, rs, and rsh all to zero.

Entering a parameter value of 0 is not the same as not specifying it. This behavior is not compatible with SPICE. In SPICE, a value of 0 is often interpreted as not specified, with the result being to calculate it some other way. If you want it to be calculated, don’t specify it.

Another subtle difference from SPICE is that Gnucap may omit some unnecessary parts of the model, which may affect some reported values. It should not affect any voltages or currents. For example, if the gate and drain are tied, Cgs will be omitted from the model, so the printed value for Cgdovl and Cgd will be 0, which will disagree with SPICE. It doesn’t matter because a shorted capacitor can store no charge.

Levels 1, 2, 3, 4, 5, 6, 7, 8, 49 are implemented.

3.16.4  Element Parameters

Basic Spice compatible parameters

M = x
Device multiplier. (Default = 1.) Equivalent number of devices in parallel.
L = x
Drawn channel length. (Default = DEFL parameter from options. DEFL default = 100µ)
W = x
Drawn channel width. (Default = DEFW parameter from options. DEFW default = 100µ)
AD = x
Area of drain diffusion. (Default = DEFAD parameter from options. DEFAD default = 0)
AS = x
Area of source diffusion. (Default = DEFAS parameter from options. DEFAS default = 0)
PD = x
Perimeter of drain junction. (Default = 0.)
PS = x
Perimeter of source junction. (Default = 0.)
NRD = x
Number of squares of drain diffusion. (Default = 1.)
NRS = x
Number of squares of source diffusion. (Default = 1.)

3.16.5  Model Parameters

Basic selection – required for all models

LEVEL = x
Model index. (Default = 1) Selects which of several models to use. The choices supported are 1-8, corresponding to Spice 3f5.

Extended control (not in Spice) – all models

CMODEL = x
Capacitance model selector (Default = 1 for level 4,5,7. Default = 2 for level 1,2,3. Default = 3 for level 6.) The only valid values are 1, 2 and 3. 2 selects Meyer capacitance calculations compatible with Spice 2. 3 selects Meyer’s model compatible with Spice 3. 1 selects not to use Meyer’s model.

Binning (not in Spice) – all models

Gnucap supports “binning”. You can specify any number of models as a family. These models must have the selection parameters WMAX, WMIN, LMAX, and LMIN.

To use “binning”, define a set of models with the same name, except for a numeric extension, beginning at 1. The models must be numbered consecutively. For example, you might have a set of models: NM3U.1, NM3U.2, NM3U.3, NM3U.4, NM3U.5, NM3U.6. For the device, you would specify the model NM3U. The first model meeting the requirements that root Conditionals

4.1  Conditionals

Gnucap behavioral modeling conditionals are an extension of the “AC” and “DC” Spice source parameters.

The extensions ...

  1. There are more choices, including an “else”.
  2. They apply to all elements (primitive components).
  3. Each section can contain functions and options.

The following are available:

AC
AC analysis only.
DC
DC (steady state) value.
OP
OP analysis.
TRAN
Transient analysis.
FOUR
Fourier analysis only.
ELSE
Anything not listed.
ALL
Anything not listed.

A value or function with no conditional keyword is equivalent to ALL. For SPICE compatibility, use only DC, AC, or nothing.

They are interpreted like a “switch” statement. In case of a conflict, the last one applies. A set of precedence rules applies when some keys are missing. It is SPICE compatible to the extent the features overlap.

The following table describes the precedence rules:

OP analysis
OP, DC, ALL, TRAN, 0
DC analysis
DC, ALL, OP, TRAN, 0
Transient analysis
TRAN, ALL, DC, OP, 0
Fourier analysis
FOUR, TRAN, ALL, DC, OP, 0
AC analysis, fixed sources
AC, 0
AC analysis, other elements
AC, ALL, 0

4.1.1  Examples

V12 (1 0) AC 1 DC 3
This voltage source has a value of 1 for AC analysis, 3 for DC. OP, Transient, and Fourier inherit the DC value.
R44 (2 3) OP 1 ELSE 1g
This resistor has a value of 1 ohm for the “OP” analysis, 1 gig-ohm for anything else. This might be useful as the feedback resistor on an op-amp. Set it to 1 ohm to set the operating point, then 1 gig to measure its open loop characteristics, hiding the fact that the op-amp would probably saturate if it was really left open loop.
./usr/share/doc/gnucap/html/gnucap-man058.html0000644000000000000000000000220111340024671017754 0ustar rootroot WIDTH command

2.47  WIDTH command

2.47.1  Syntax

width {IN=value} {OUT=value}

2.47.2  Purpose

Set input and output width.

2.47.3  Comments

The ‘width’ command is the same as the ‘options’ command. It is provided for SPICE compatibility. SPICE uses width to set two parameters: in and out, which we set with the options command.

./usr/share/doc/gnucap/html/gnucap-man036.html0000644000000000000000000000513111340024671017755 0ustar rootroot MARK command

2.25  MARK command

2.25.1  Syntax

mark

2.25.2  Purpose

Remember circuit voltages and currents.

2.25.3  Comments

After the mark command, the transient and fourier analysis will continue from the values that were kept by the mark command, instead of progressing every time.

This allows reruns from the same starting point, which may be at any time, not necessarily 0.

2.25.4  Examples

transient 0 1 .01
A transient analysis starting at zero, running until 1 second, with step size .01 seconds. After this run, the clock is at 1 second.
mark
Remember the time, voltages, currents, etc.
transient
Another transient analysis. It continues from 1 second, to 2 seconds. (It spans 1 second, as before.) This command was not affected by the mark command.
transient
This will do exactly the same as the last one. From 1 second to 2 seconds. If it were not for mark, it would have started from 2 seconds.
transient 1.5 .001
Try again with smaller steps. Again, it starts at 1 second.
unmark
Release the effect of mark.
transient
Exactly the same as the last time, as if we didn’t unmark. (1 to 1.5 seconds.)
transient
This one continues from where the last one left off: at 1.5 seconds. From now on, time will move forward.

./usr/share/doc/gnucap/html/gnucap-man075.html0000644000000000000000000007436511340024671017777 0ustar rootroot M: MOSFET

3.16  M: MOSFET

3.16.1  Syntax

Device

Mxxxxxxx nd ng ns nb mname {args}
Mxxxxxxx nd ng ns nb mname {width/length} {args}
.mosfet label nd ng ns nb mname {args}
.mosfet label nd ng ns nb mname {width/length} {args}

Model (required)

.model mname NMOS {args} .model mname PMOS {args}

3.16.2  Purpose

MOSFET.

3.16.3  Comments

Nd, ng, ns, and nb are the drain, gate, source, and bulk (substrate) nodes, respectively. Mname is the model name.

Length and width are the drawn channel length and width, in microns. Note that the notation W/L has units of microns, but the same parameters, in the argument list (W and L) have units of meters. All other dimensions are in meters.

The option (.options command) rstray determines whether or not series resistances are included. rstray (on) is the default. Experience has shown that the effect of series resistance is often not significant, it can significantly degrade the simulation time, and it often increases roundoff errors. rstray is the default for Spice compatibility, and because it usually is significant for the BJT model. Norstray (off) is the equivalent of setting the model parameters rd, rs, and rsh all to zero.

Entering a parameter value of 0 is not the same as not specifying it. This behavior is not compatible with SPICE. In SPICE, a value of 0 is often interpreted as not specified, with the result being to calculate it some other way. If you want it to be calculated, don’t specify it.

Another subtle difference from SPICE is that Gnucap may omit some unnecessary parts of the model, which may affect some reported values. It should not affect any voltages or currents. For example, if the gate and drain are tied, Cgs will be omitted from the model, so the printed value for Cgdovl and Cgd will be 0, which will disagree with SPICE. It doesn’t matter because a shorted capacitor can store no charge.

Levels 1, 2, 3, 4, 5, 6, 7, 8, 49 are implemented.

3.16.4  Element Parameters

Basic Spice compatible parameters

M = x
Device multiplier. (Default = 1.) Equivalent number of devices in parallel.
L = x
Drawn channel length. (Default = DEFL parameter from options. DEFL default = 100µ)
W = x
Drawn channel width. (Default = DEFW parameter from options. DEFW default = 100µ)
AD = x
Area of drain diffusion. (Default = DEFAD parameter from options. DEFAD default = 0)
AS = x
Area of source diffusion. (Default = DEFAS parameter from options. DEFAS default = 0)
PD = x
Perimeter of drain junction. (Default = 0.)
PS = x
Perimeter of source junction. (Default = 0.)
NRD = x
Number of squares of drain diffusion. (Default = 1.)
NRS = x
Number of squares of source diffusion. (Default = 1.)

3.16.5  Model Parameters

Basic selection – required for all models

LEVEL = x
Model index. (Default = 1) Selects which of several models to use. The choices supported are 1-8, corresponding to Spice 3f5.

Extended control (not in Spice) – all models

CMODEL = x
Capacitance model selector (Default = 1 for level 4,5,7. Default = 2 for level 1,2,3. Default = 3 for level 6.) The only valid values are 1, 2 and 3. 2 selects Meyer capacitance calculations compatible with Spice 2. 3 selects Meyer’s model compatible with Spice 3. 1 selects not to use Meyer’s model.

Binning (not in Spice) – all models

Gnucap supports “binning”. You can specify any number of models as a family. These models must have the selection parameters WMAX, WMIN, LMAX, and LMIN.

To use “binning”, define a set of models with the same name, except for a numeric extension, beginning at 1. The models must be numbered consecutively. For example, you might have a set of models: NM3U.1, NM3U.2, NM3U.3, NM3U.4, NM3U.5, NM3U.6. For the device, you would specify the model NM3U. The first model meeting the requirements that root Conditionals

4.1  Conditionals

Gnucap behavioral modeling conditionals are an extension of the “AC” and “DC” Spice source parameters.

The extensions ...

  1. There are more choices, including an “else”.
  2. They apply to all elements (primitive components).
  3. Each section can contain functions and options.

The following are available:

AC
AC analysis only.
DC
DC (steady state) value.
OP
OP analysis.
TRAN
Transient analysis.
FOUR
Fourier analysis only.
ELSE
Anything not listed.
ALL
Anything not listed.

A value or function with no conditional keyword is equivalent to ALL. For SPICE compatibility, use only DC, AC, or nothing.

They are interpreted like a “switch” statement. In case of a conflict, the last one applies. A set of precedence rules applies when some keys are missing. It is SPICE compatible to the extent the features overlap.

The following table describes the precedence rules:

OP analysis
OP, DC, ALL, TRAN, 0
DC analysis
DC, ALL, OP, TRAN, 0
Transient analysis
TRAN, ALL, DC, OP, 0
Fourier analysis
FOUR, TRAN, ALL, DC, OP, 0
AC analysis, fixed sources
AC, 0
AC analysis, other elements
AC, ALL, 0

4.1.1  Examples

V12 (1 0) AC 1 DC 3
This voltage source has a value of 1 for AC analysis, 3 for DC. OP, Transient, and Fourier inherit the DC value.
R44 (2 3) OP 1 ELSE 1g
This resistor has a value of 1 ohm for the “OP” analysis, 1 gig-ohm for anything else. This might be useful as the feedback resistor on an op-amp. Set it to 1 ohm to set the operating point, then 1 gig to measure its open loop characteristics, hiding the fact that the op-amp would probably saturate if it was really left open loop.
./usr/share/doc/gnucap/html/gnucap-man058.html0000644000000000000000000000220111340024671017754 0ustar rootroot WIDTH command

2.47  WIDTH command

2.47.1  Syntax

width {IN=value} {OUT=value}

2.47.2  Purpose

Set input and output width.

2.47.3  Comments

The ‘width’ command is the same as the ‘options’ command. It is provided for SPICE compatibility. SPICE uses width to set two parameters: in and out, which we set with the options command.

./usr/share/doc/gnucap/html/gnucap-man036.html0000644000000000000000000000513111340024671017755 0ustar rootroot MARK command

2.25  MARK command

2.25.1  Syntax

mark

2.25.2  Purpose

Remember circuit voltages and currents.

2.25.3  Comments

After the mark command, the transient and fourier analysis will continue from the values that were kept by the mark command, instead of progressing every time.

This allows reruns from the same starting point, which may be at any time, not necessarily 0.

2.25.4  Examples

transient 0 1 .01
A transient analysis starting at zero, running until 1 second, with step size .01 seconds. After this run, the clock is at 1 second.
mark
Remember the time, voltages, currents, etc.
transient
Another transient analysis. It continues from 1 second, to 2 seconds. (It spans 1 second, as before.) This command was not affected by the mark command.
transient