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

Re: gEDA-user: Gnucap and summer of code.



On Monday 30 March 2009, Yamazaki R2 wrote:
> True, but I work in industry and the only thing I've seen
> associated with global nodes are voltage sources for power
> rails. In this case just copying the voltage source into each
> subckt will work just fine. It was just an idea anyway I
> don't know what the real implementation of that would be. And
> by definition a votlage source is any device in your netlist
> that starts with V.

I understand.  I suppose if you use global nodes only in that 
specific way they won't get you in too much trouble.


>
> > If that is all you need, you could make a preprocessor to
> > do that.
>
> I suppose thats true, but most simulators handle the .global
> statement without any preprocessors.

Actually, most of them use preprocessors internally.
>
> > Another possibility is that you could make a preprocessor
> > that adds the global nodes to all of the "X" port lists,
> > and to the declaration lines of the subcircuits.  That
> > should be easy.
> >
> > Maybe it could be part of your  netlister.

Now I see an easy way to implement it, essentially based on the 
preprocessor approach, but internally.  It should take about 5 
lines of code added to lang_spice_in.cc.  Take ".global" as a 
command that just stores the string.  Then on reading 
a ".subckt" line or an instance line (usually "X") that 
references such a subckt, insert the string as extra nodes.

so .. 
=============
.global dd ff gg

.subckt abcd (ww)
....
.ends

...
X1 (pp) abcd
=============
would be equivalent to:
=============
.subckt abcd (ww dd ff gg)
....
.ends

...
X1 (pp dd ff gg) abcd
=============

I think this is close enough to be useful, but I still have 
questions about the scope rules.  It seems to me that it should 
have file scope, and not pass down to included files.

I can look at it in about a week.  I'll let you know.  




_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user