[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gEDA-user: Gschem, gnetlist, and SPICE



Ladies and Gentlemen,

A while ago I downloaded and installed gEDA version 20020527.  I have
recently gotten around to playing with it.   Gschem is pretty cool, I
must say.  Great work! 

One thing I would like to use gEDA for is to create spice netlists for
subsequent simulation.  I have read the docs (at least the ones which
exist), browsed the website archives, and played around with gnetlist
itself to get an idea of how it is supposed to work.  So far, I have
only had success getting passive components to pass their values to
the SPICE netlist by using the VALUE attribute attached to the
symbol. 

When it comes to more complex components, I am at a loss about how it
should work.  Here are some questions/observations:

--  Is there any documentation anywhere (docs or website) discussing how
to prepare spice netlists using gschem?  Besides mentioning that the
VALUE attribute is used to pass component values to the spice netlist,
the docs don't seem to cover this.  

--  Is there any documentation or notes discussing how the various
scheme backends process the netlist created by gnetlist?  I have
examined the source for gnet-spice.scm, gnet-spice-1.scm, and
gnet-spice-2.scm (the last two are contributions by W. Kazubski), but
getting some kind of description of what the scheme progs expect and
do is far easier and quicker than reverse-engineering the progs. 

--  Complex components are usually modeled with multi-line text files
like the one below.  This kind of model doesn't really work with a
one-line VALUE attribute.  This was noted in a post several months
ago.  

--  In certain circumstances, I can imagine wanting to try different
spice models for the same component.  For example, I might place a
generic op-amp on the schematic, and then try simulating circuit
performance using different vendor models.

--  IHMO, a smart way to address the last two issues is to create a
SPICE attribute which points to a file holding the spice model.  Then,
the spice netlister would be hacked to recognize VALUE, MODEL, and SPICE
attributes when building a spice netlist.  VALUE would be used to pass
the values of passives.  MODEL could be used to pass one-line spice
models.  SPICE could be used to point to a file holding the
corresponding spice code.

Any reactions?  Comments?  If I am completely off-base, or if this
problem has been solved in newer versions of gEDA, please say so.  I
would be particularly interested in communicating with the people who
are actively working on building spice functionality into gEDA.  And
if I am not walking on somebody's toes, I might try hacking spice file
functionality into gEDA myself!

Thanks!

Stuart

--------- Example multi-line SPICE model -----------------------
.model 2N3904   NPN(Is=6.734f Xti=3 Eg=1.11 Vaf=74.03 Bf=416.4 Ne=1.259
+               Ise=6.734f Ikf=66.78m Xtb=1.5 Br=.7371 Nc=2 Isc=0 Ikr=0 Rc=1
+               Cjc=3.638p Mjc=.3085 Vjc=.75 Fc=.5 Cje=4.493p Mje=.2593 Vje=.75
+               Tr=239.5n Tf=301.2p Itf=.4 Vtf=4 Xtf=2 Rb=10)
*               Fairchild        pid=23          case=TO92
*               88-09-08 bam    creation