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

Re: gEDA-user: Check for same refdes



On Sun, Jan 16, 2005 at 07:02:41PM -0500, Stuart Brorson wrote:
> > > As for gnetlist itself, I would have to look to see how easy it might
> > > be to rectify the problem you mention.  Personally, I think it should
> > > be fixed in the Scheme back end.
> > 
> > I just tried gnetlist -v. This seems to work right. But you might get a 
> > problem with gattrib (I just tried). 
> > 
> > This is not a spice problem. We could approach the problem either in 
> > - gnetlist with a warning or in 
> > - gschem with a check or with a 
> > - standalone script (DRC)
> > 
> > Is it possible to write a Scheme function to check for double refdes? Than we 
> Every Scheme backend should compile a list of refdeses it has seen
> while netlisting, and then compare each refdes it encounters against
> the previously seen list.


> I'll stick that into spice-sdb the next time I go around with it.  I
> can make it emit a warning.
 
how about make a generic function in scheme which does this and
a netlist backend can use it if it wants to?

You know, it might be a good idea to come up with some routines
to handle refdes name mangling too.  Why?  netlist format A might
be case sensitive and netlist format B might not be.  Ra vs RA
might then be unique for one backend and not another.  Length
of refdes is another issue.

FWIW, this problem existed for net names too.  If you take a look
at the switcap and futurenet backends you'll see a call like:

        ;; initialize the net-name aliasing
	(gnetlist:build-net-aliases futurenet2:map-net-names all-unique-nets)

at the beginning of the netlisting where futurenet2:map-net-names is the
function which describes how to produce a valid futurenet2 net name from
any geda netname.  Then later, if you want to output a netname, use

(gnetlist:alias-net "original_net_name")

You can go back with

(gnetlist:unalias-net "alised_net_name")

Oh, I think the pads backend uses this too.  The initialization function,
gnetlist:build-net-aliases looks for name collisions as a result of the
mapping.

I'd think this would be most useful for refdes's as well.  Shouldn't be
hard.

-Dan

--