Netlist format extension


To "Ng-Spice-Devel (E-mail)" <ng-spice-devel@ieee.ing.uniroma1.it>
From "Gillespie, Alan" <Alan.Gillespie@analog.com>
Date Wed, 7 Feb 2001 10:23:22 -0000
Delivered-To mailing list ng-spice-devel@ieee.ing.uniroma1.it
Mailing-List contact ng-spice-devel-help@ieee.ing.uniroma1.it; run by ezmlm
Reply-To ng-spice-devel@ieee.ing.uniroma1.it


I was just thinking about rawfiles and stuff last night,
when it struck me that we need to consider the implications
of the netlist format extension on the way we access data
from the simulation.

At the moment, to save, for example, the collector current
of a bipolar device, you need to ask for it in the format -

.save @qname[ic]

or

.save @q:subckt1:subcktn:name[ic]

if we apply the proposed netlist extension, the first
character after the @ will not necessarily signify the
device type.

How do we incorporate the new devices into this without
interfering with the existing syntax?

If we assume that a new device line would take the form -

.newdevicetype name n1 n2 ... nN modelname param=val ... param=val

We can't just say

.save @name[param]

or

.save @subckt1:subcktn:name[param]

because then we couldn't start the name with one of the
pre-defined device letters, and we couldn't have top level
subcircuits which were single letters which were pre-defined.

It looks like the @ sign has to be followed immediately by
something that says, at least, that this is a new syntax, or
even something identifying the device type.

We could make it -

.save @.name[param]

or

.save @.subckt1:subcktn:name[param]

or even -

.save @.newdevicetype.name[param]

or

.save @.newdevicetype.subckt1:subcktn:name[param]

where the second . is just an arbitrary delimiter. It could
be a : to match the rest of the line, or whatever.

If we don't do the second form, i.e. the form which declares
the device type before the actual name, then spice must search
through all the instances of all the device types to find the
correct device.

Personally, I don't think that should be a problem. If, for
example, I'm programming in C, C++ or Pascal, I don't expect
to have to include the type of every procedure or function
when I call it. If this slows down spice too much, then the
solution would seem to be to hold a name table in some kind
of "quick-searchable" structure, not to force us to type
in potentially long newdevicetype names every time we want
access to some device data.

I suppose we could replace the .newdevicetype. in the above
lines with (newdevicetype), and call it a typecast, or
something, but it seems to me to be starting to get kinda
messy.

Would the \ character be more consistant, i.e. the device line
would look like -

\name n1 n2 ... nN modelname param=val ... param=val

and we ask for it with -

.save @\name[param]

or

.save @\subckt1:subcktn:name[param]

Now the syntax looks less clumsy (to me anyway), but
neither the device line nor the .save line mentions
what the device type is. That would be defined by the
.model statement which defines the model for "modelname".

I think I'm correct in saying that spice already looks
through the file first for all the models, and then
passes through again for the actual circuit. (I could
be wrong, though). So it already knows the device type
from the model name when it reads in the device line.

I don't know how this effects ACS.

I'll finish here for now, although I've got more to say
in the next email ......

Partial thread listing: