In some applications, describing a device by embedding the required elements in the main circuit file is not desirable. A hierarchical approach may be taken by using subcircuits. Subcircuit models allow you to specify, like the predefined device models, many of the parameters defined in subcircuit interface. The general form is:

.MODEL <model name> <subcircuit name> [<param> = <value>]*
.MODEL <model name> <subcircuit name> [PARAMS: <<name>=<value>>*] [TEXT: <<name>=<value>>*]

model name

The model name which is used to reference a particular model.

subcircuit name

The name of the subcircuit’s definition. The referenced subcircuit can be in the main circuit file, accessed through a .INCLUDE command, or it can be in a library file. The subcircuit is searched in the following order:

  1. In the current circuit.
  2. Within the current job.
  3. Within the files specified by the .LIB command.
  4. Within the jobs in the folder of the current job.
  5. Within the jobs in the folder USER/LIBRARY.
  6. Within the jobs in the folder APP/LIBRARY.

PARAMS:
param=value

Passes values into subcircuits as arguments and into expressions inside the subcircuit. The parameters are specified by the pair: name = value. Model parameters that are not given a value are assigned the default values. The value can be a constant value or a numeric expression. The expressions must be enclosed in braces.

Note Note: If the value is in quotation marks then the parameter is of type text and is used as if it were specified after the keyword TEXT:.

TEXT:

Passes text values into subcircuits. The text parameters are specified by the pair: name = value.

Examples

X1 10 20 30 40 DEVICE
X2 10 50 60 50 DEVICE
X3 10 80 90 20 DEVICE

.MODEL DEVICE DEVICEMODEL (P1=10 P3=1 P5=5)

.SUBCKT DEVICEMODEL 1 2 3 4 PARAMS: P1=0 P2=0 P3=0 P4=0 P5=0
.....
.ENDS SUB1

See also

Subcircuit Calls
Subcircuit Definition