User Guide
Chapter 6 Analog behavioral modeling
152
ABM part templates
For most ABM parts, a single PSpice “E” or “G” device
declaration is output to the netlist per part instance. The
PSPICETEMPLATE property in these cases is
straightforward. For example the LOG part defines an
expression variant of the E device with its output being
the natural logarithm of the voltage between the input pin
and ground:
E^@REFDES %out 0 VALUE { LOG(V(%in)) }
The fragment E^@REFDES is standard. The “E” specifies
a PSpice controlled voltage source (E device); %in and
%out are the input and output pins, respectively; VALUE
is the keyword specifying the type of ABM device; and the
expression inside the curly braces defines the logarithm of
the input voltage.
Several ABM parts produce more than one primitive
PSpice device per part instance. In this case, the
PSPICETEMPLATE property may be quite complicated.
An example is the DIFFER (differentiator) part. This is
implemented as a capacitor in series with a current sensor
together with an E device which outputs a voltage
proportional to the current through the capacitor.
The template has several unusual features: it gives rise to
three primitives in the PSpice netlist, and it creates a local
node for the connection of the capacitor and its
current-sensing V device.
C^@REFDES %in $$U^@REFDES 1\n
V^@REFDES $$U^@REFDES 0 0v\n
E^@REFDES %out 0 VALUE {@GAIN * I(V^@REFDES)}
The fragments C^@REFDES, V^@REFDES, and
E^@REFDES create a uniquely named capacitor, current
sensing V device, and E device, respectively. The
fragment $$U^@REFDES creates a name suitable for use
as a local node. The E device generates an output
proportional to the current through the local V device.
For c
l
arity, t
h
e temp
l
ate is s
h
own on t
h
ree
lines although the actual template is a
single line.
Pspug.book Page 152 Wednesday, November 11, 1998 1:14 PM