RE: [ng-spice-devel] An Historical note on spice netlist format


To "'ng-spice-devel@ieee.ing.uniroma1.it'" <ng-spice-devel@ieee.ing.uniroma1.it>
From Paolo Nenzi <pnenzi@ieee.ing.uniroma1.it>
Date Wed, 7 Feb 2001 17:08:43 +0100 (CET)
Delivered-To mailing list ng-spice-devel@ieee.ing.uniroma1.it
In-Reply-To <CF654D964573D311A1CA0090278A36FF4CBD7E@EDIN_EXM1 >
Mailing-List contact ng-spice-devel-help@ieee.ing.uniroma1.it; run by ezmlm
Reply-To ng-spice-devel@ieee.ing.uniroma1.it

On Wed, 7 Feb 2001, Gillespie, Alan wrote:

> 
> I agree completely that we should be aiming to replace
> the whole syntax with a better one. Eventually. But
> designing a complete new syntax is non-trivial, if
> we're to get it right.

Yes, but I hope that some good parser exists for a regular grammar in the
ton of freely source code, something to start with.

> On the other hand, it would be neater if the "fix"
> we do now didn't look out of place in the "final"
> syntax. So if we could decide on a device line
> format that we can keep in the eventual new syntax,
> then it would make everybody's life easier.
> 
> Paolo's format of -

> 
> Paolo, did you intend the "resistance" to be the name of the
> device, or did you mean it to be the type, with another field
> possibly between "resistance" and <node1> to be the name ?

I should have wrote resistor .... (in italina, the resistor is called
"resistenza", and sometime I confuse the device with its property).

Oops, the correct line shold be:

resistor     myresistor node1 node2 ...
device_type  name       ..    ..    ...

we may even add a device called:

poly_resistor myresistor2 node1 node2

which use a different model than the resitor device



> Actually, looking back at Al's original stuff, I don't think
> he's got an example of a device with both a device type and
> a model name on the line. I assume, Al, that you were intending
> the model name to be in the usual position, i.e. between the
> node list and the parameter list.

Yes, correct.

> 
> In Al's example above, the "10k" as assumed, by virtue of its
> position on the line to be the value parameter for the device.
> Spice, at the moment, has a set number of "position implied"
> parameters for each device, and then optional parameters
> which must be set with "param=value" pairs. This mix is
> defined on a per-device basis, and is a nightmare when it
> comes to making a general purpose parser which would work
> for all devices.

I think that regularization will help to make a simpler parser. On the
other end, we may allow for only one unlabeled parameter, this will be 
not hard to do, since every unalbeled parameter is a number ({1-9}*)
and a keyword must not start with a number.


> 
> For generality, I think it's best at this stage to say that
> all parameters should be set by "param=value", even the
> parameters that are currently implied, e.g. resistor value,
> bipolar area, etc.

It is easier but almost any eng. in thi world know will complain.

> 
> Paolo has got even the model name as a "param=value" pair.
> Apart from laziness, (i.e. not wanting to type it all out),
> there's no reason not to do this. In fact, it might be more
> "future-proof", in the sense that, eventually, we might
> want to have models and "submodels", i.e. a model which
> defines most of the parameters of a device, and a submodel
> which varies just a few parameters. If that was the case,
> it would be inconsistant to have a "position-implied"
> model parameter, and the submodel somewhere in the parameter
> list.

Can you explain better, what do you mean for a submodel ?


> Also, if we choose the format where the device type is
> the specified at the start of the line, then the model
> name does not need to be so readily accessible in order
> to determine the device type.

This depends what the first word means:

eg:

bsim1 mybjt 3 2 4 1 ....

bjt mybjt 3 2 4 1 bsim1

What format do you prefer ?


> devicetype name nodelist paramlist
  
  bsim1      mybjt  3 2 4 1 emitter_area=1uM ...

Am I right ?


Bye,Paolo


Partial thread listing: