[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-user: symbols for SPICE netlisting
Hi,
This is a question for the authors of the SPICE netlisters. I'm
wondering if the netlisters could be set up so that when they encounter
a symbol, the output is directly specified by a symbol attribute,
rather than by the netlister's interpretation of the refdes or model
attributes.
PSpice does something like this; for example, it comes with a LOG
symbol with pins named 'in' and 'out'. The voltage at out = log(in).
It's implemented by setting an attribute in the symbol with the string:
E^@REFDES %out 0 VALUE{LOG(V(%in))}
When the netlister sees this, it replaces REFDES with the appropriate
refdes, %out with the name of the net connected to the out pin, and the
same for in, and appends the string to the output SPICE file.
Now, the symbol above can be made using the existing netlisters, but
this feature would make it easier to work with nonstandard spice
models, or simulators with nonstandard syntax. It could also enable
the user to make a symbol that represents multiple SPICE components,
without having to attach a separate schematic or subcircuit file. That
would make it much more convenient to distribute / share the symbol.
Again, Pspice has an example of this. the differentiator is
implemented using a voltage source sensing current through a capacitor,
and the current controlling a current controlled voltage source. The
whole thing is defined in a symbol with the string:
C^@REFDES %in $$U^REFDES 1\n
V^@REFDES $$U^REFDES 0 0v \n
E^@REFDES %out 0 VALUE {@GAIN*I(V^@REFDES)}
(in PSpice, this is all written on one line.)
Here, three components are created, each with a refdes based on the
symbol's refdes to make sure it is unique. It also contains a node
that is 'internal' to the symbol; its name is also based on the refdes
to make it unique. The symbol contains a GAIN attribute, which is
referenced by the definition here.
(both of these examples are from the documentation for PSpice 9.1).
I think this approach could coexist peacefully with the current method
of specifying symbols; just use the normal method unless some
attribute, say 'spicecode', is defined. As I said above, it would
provide a much more flexible way of defining a symbol, and would enable
symbols representing multiple components without requiring a separate
subcircuit file.
What do the developers think?
Matt
______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca