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

Re: gEDA-user: 1.) Feedback, 2.) gschem->gnetlist->ngspice question(s)



Hi Felix --

We can try to help you with your spice-sdb problems!

> From: Felix <schmitt@voidcast.de>
> 2.) gschem->gnetlist->ngspice question(s):
> My goal was to simulate a very simple switching power supply via the design 
> flow gschem->gnetlist->ngspice. The layout roughly looks like this:
> 
>                  +----------------+
>                  |                |
> Vref ------------|(-)             |
>                  |    OP_AMP (OUT)|----+-----+----- Vout
> Vin  --\/\/\--+--|(+)   U1        |    |     |
>          R1   |  |                |    |   =====
>               |  +----------------+    |   ===== C1
>               |                        |     |
>               +---------\/\/\----------+     |
>                           R2               -----
>                                             --- GND
>                                              -
> 
> (In pspice, this wouldn't be a problem.)
> I couln't get this through gnetlist.
> Then, I spent two days reading man pages/usage info. That did not help much.
> Any ideas?

Umm, here are some suggestions which will help us help you:

*  Please try running gnetlist in verbose mode.  This will help
identify where netlisting hangs.  To get verbose mode, run it this
way: 

gnetlist -v -g spice-sdb Circuit.sch

Typically, gnetlist will barf right at the offending symbol, which you
can identify in verbose mode.

*  Please post a session log of your gnetlist run.

*  Please post your .sch file & we can take a look at it.

> My guess is, that ngspice can only handle "basic" parts like R,C,L,Transistors 
> in different flavors, etc., and gnetlist is not able (yet) to generate the 
> apropriate hierarchical code or whatever to feed into ngspice, and therefore 
> just coughs up when hitting the opamp part.

Naw, I simulate opamps all the time.  You have to configure them
correctly.  Please be sure to attach a "file" attribute pointing to
the .cir file holding the opamp's SPICE model.  Also please be sure to
attach a "model-name" attribute to the symbol.  The model-name attribute
should match the name of the opamp held in the .cir file.

> Therefore my questions:
> a.) Not all .sym models in /usr/share/gEDA/syms/* make it through gnetlist, 
> right?

They should . . . .

> b.) Do you have a list of symbols that pass the gnetlist->spice-sdb process? 
> Is it possibly the "gEDA symbol library" I find on Your homepage? How do I 
> read it? (the legend did not help me very much :-( )

All symbols should make it as long as the attributes are set correctly.

> c.) Wouldn't it be nice to have a tool with which you could generate SPICE 
> code for new parts in the following manner: 
> I) You click the parts together out of which this new part consists 
> (graphical)
> II) You have this new part simulated in standard testing setups and get graphs 
> and specs from the simulation (automated, graphical)
> III) You can adjust the different parameters of the "atomic" parts and repeat 
> step II in order to match the data sheets you downloaded from the 
> manufacturer to your sim data.
> IV) the .MODEL or .SUBCKT file is then included into the .sym model file in 
> some fashion.

That program is called PSpice, and you can buy it from Orcad for
US$5000 or so.  Many other commercial GUI oriented SPICE programs
exist, like SuperSpice, SmartSpice, MicroCAD, CircuitMaker,
etc. etc. etc.  

Alternatively, if you don't mind using Windoze you can  
download LTSpice from Linear Tech's website and use it for SPICE.
It's a great program, and it's free.  It also runs under wine, if you
want to stick with your Linux box.  You can't use it for layout or
other design-oriented tasks, however.  For that, you need gEDA!  :-)

Anyway, lots of newbies want to have a graphical SPICE simulator built
on top of gschem.  However, they quickly either get over it and start
using the CLI-oriented "gschem -> gentlist -> ngspice" tool chain, or
they move on to LTSpice.  I doubt that gEDA will have a graphical
SPICE simulator very soon.

You could try writing one, however!  But it'd be a lot of work, and
other projects are more pressing, IMHO.

> I think gEDA does have much potential (I like it already). I would like to 
> work on a program that does things like the above-mentioned, if there would 
> be interest and use for it in the gEDA project. (can do c, perl, etc., cannot 
> do guile, python (yet))

Welcome aboard!  

I'd say that writing another GUI oriented SPICE
simulator on top of gschem would be a lot of work.  There are already
a lot commercial versions of that program out there, some of the as
cheap as a few hundred US$, which is pretty cheap.  As for free (as in
beer), LTSpice is a wonderful program offering exactly the
functionality you wish.  Therefore, why re-invent the wheel?

My opinion [which those who know me are tired of 
hearing :-) ] is this:  PCB's GUI need to be dragged into the 21st
century.  If you want to do GUI programming, why not look at working
on PCB?

CU,

Stuart