[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gEDA: spice-SDB backend, library included two times
Hi Peter --
>
> Hi Stuart,
>
> when you ask for my opinion, here it is:
>
>
> >
> > gnetlist -I -g spice-sdb foo.sch
> >
> > The -I flag tells gnetlist to not put the contents of any file into
> > the netlist, but rather just put a ".include foo.bar" directive in the
> > deck. (Note that I don't think I have tested this on .include
> > directives, so if it does the wrong thing, please let me know.
> >
>
> Revert this behaviour. By default, write only the .include line and when
> using:
>
> gnetlist -I -g spice-sdb foo.sch
>
> Include the model to the spice input file.
I could do this, but there is a snag: The -I flag is really meant to
control the behavior of .model and .subckt cards. By default the
contents of a .model or .subckt file gets dumped into the main SPICE
deck *unless* you specify the -I flag. As a correlary, it will also
control the behavior of the ".include" symbol.
Therefore, I don't want to invert the logic of the -I flag without
more thought since it impacts the behavior of things beyond the
.include symbol.
The problem is that ".include" is both a SPICE statement (command),
and a gschem symbol. It is one of the only SPICE commands which also
has a gschem symbol; most other SPICE commands are entered exclusively
by manually sticking them into a SPICE-directive symbol. Since users
see the .include symbol in the SPICE symbols lib, they assume that it
generates a .include statement, but it instead embedds the named file.
I probably exascerbated this by labeling the symbol ".include", when I
really meant "embedd external file".
Moving forward, here is another suggestion:
3. Borrowing a riff from you, Peter, I could make the default behavior
of the .include symbol to just write out the string ".include
foo.bar". Then I can add a gnetlist flag, say -e, which will force
all .include symbols to embedd the external file into
the SPICE deck.
This creates the desired effect (i.e. stick a ".include foo.bar" into
the netlist by default) while not messing around with spice-sdb's
behavior with .model and .subckt cards. What do you think?
Stuart