User Guide

Chapter 5 Creating parts for models
144
Parameterized subcircuit call (X) template
Suppose you have a subcircuit Z that has:
two pins: a and b
a subcircuit parameter: G, where G defaults to 1000
when no value is supplied
To allow the parameter to be changed on the schematic
page, treat G as an property in the template.
Template
X^@REFDES %a %b Z PARAMS: ?G|G=@G|
~G|G=1000|
Equivalent template (using the if...else form)
X^@REFDES %a %b Z PARAMS: ?G|G=@G||G=1000|
Sample translation
X_U33 101 102 Z PARAMS: G=1024
where REFDES equals U33, G is set to 1024, and the
subcircuit connects to nets 101 and 102.
Sample translation
X_U33 101 102 Z PARAMS: G=1000
where the settings of the previous translation apply
except that G is undefined.
Pin callout in subcircuit templates
The number and sequence of pins named in a template for
a subcircuit must agree with the definition of the
subcircuit itself—that is, the node names listed in the
.SUBCKT statement, which heads the definition of a
subcircuit. These are the pinouts of the subcircuit.
Example: Consider the following first line of a
(hypothetical) subcircuit definition:
.SUBCKT SAMPLE 10 3 27 2
The four numbers following the name SAMPLE—10, 3,
27, and 2—are the node names for this subcircuit’s
pinouts.
Note
For c
l
arity, t
h
e PSPICETEMPLATE
property value is shown here in multiple
lines; in a part definition, it is specified in
one line (no line breaks).
To
f
in
d
out
h
ow to
d
e
f
ine su
b
circuits, re
f
er
to the .SUBCKT command in the online
OrCAD PSpice A/D Reference
M
anual.
Pspug.book Page 144 Wednesday, November 11, 1998 1:14 PM