[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: multiple attributes

> > And that is the way forward for the problematic overloading we have
> > right now, e.g., the pinseq attribute:
> > 
> > The spice netlist shall learn to use a (spice-)port-order
> > attribute, or however that shall be named, and fall back to pinseq,
> > with an obsolescence warning.
> > 
> >  spice-port-order
> >  port-order
> >  pin-seq  (obsolete)

Use the pinseq, and pinnumber for physical representations, this
prevents the annoying "magic" that slotted component instances give when
pinnumbers/slots change.

> I'd prefer a spice-prototype attribute, which would allow us to avoid
> many of the difficulties without a confusing proliferation of
> attributes. 

I have these procedures in my private git repository that could make
netlisting independent of the physical representation. My coding
format is different from the other gnetlist code so the coding needs
some review.

g_get_all_netnames_using_pinlabel(SCM scm_uref)
Returns a list of pairs: ( (pinlabelname netname) (pinlabelname netname)
 (pinlabelname netname) ... )

And g_get_netname_using_pinlabel(SCM scm_uref, SCM scm_pinlabel)
which returns one attibute value. This one is probably less useful.

For the idea using a spice prototype find a PSpice manual which
describes such a format. See the PSPICETEMPLATE in the User
Guide. There is no need to reinvent the format, maybe extend it a bit.
Are there commercial netlisters that could provide some other

A piece of documentation and an example copied from the PSpice user

%<pin name>

@<id>            Value of <id>. Error if no <id> attribute or
                       if no value assigned.
&<id>            Value of <id> if <id> is defined.
?<id>s...s       Text between s...s separators if <id> is defined.
?<id>s...ss...s  Text between the first s...s separators if
                         <id> is defined, else the second s...s clause.
~<id>s...s       Text between s...s separators if <id> is undefined.
~<id> s...ss...s Text between the first s...s separators if
                          <id> is undefined, else the second s...s
#<id>s...s       Text between s...s separators if <id> is
                      defined, but delete rest of template if <id>
                      is undefined.

^   This is the complete hierarchical path to the device being

s is a separator character i.e.: , . / |

    R^@REFDES %1 %2 @VALUE
    V^@REFDES %+ %- ?DC|DC=@DC| ?AC|AC=@AC|

I don't have guile code for such a netlister. In 2007 someone
wrote something similar with guile. On sourceforge there is this: "Allow
the definition of spice syntax in symbols. - ID: 1758382"

Being able to fetch netnames using pinseq and pinnumber could prevent
one of those bloody email wars without an implementation in sight.

> For the symbol nmos-3.sym, a suitable prototype might be:
> M? #D #G #S #S $model-name L= W= AS= AD= PS= PD= M=
> We can yell at each other about syntax, but I think the basic idea is
> sound. Right now, spice-sdb is essentially reduced to guessing what
> the symbol represents. It can't always tell reliably (it's been know
> to decide my flip-flops are diodes!). There isn't generally one right
> answer: with a different kind of model (subcircuit), the prototype
> for nmos-3.sym might be:
> X? #D #G #S $model-name
> Suggested syntax:
> First characters up to the "?" are the device prefix.
> #x means the net attached to pinnumber x.
> %x means the net attached to pinseq x.
> `x means the net attached to pinlabel x.
> $x means the value of attribute x.
> x= means an optional x=value string to be emitted only if the x
> attribute is present.
> An improved SPICE netlister could incorporate heuristics similar to
> spice-sdb to pick a prototype from a collection of defaults, or fall
> back purely on pinseq and model-name, if no spice-prototype attribute
> is present, for backward compatibility.


geda-user mailing list