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

Re: gEDA-user: Gnucap crash



On Sunday 08 April 2007 22:10, Patrick Doyle wrote:
> Hello Al and other Gnucap developers on this list...
>
> I posted a message similar to this to the gnucap list a few
> days ago, but I suspect the list manager bounced me since I'm
> not on the list -- I don't see it in the archives anyway. 
> Since then, I've learned some more, so hear I go again...

The list manager never saw it.  The list gets hundreds of spams 
per day, which are automatically discarded.

You need to subscribe to post.

> The following netlist crashes the 3-29 snapshot when I run it
> on my PC.  When compiled with debugging enabled, I get an
> assertion failure.
>
> * gnetlist -g spice-sdb -o spice.netlist.wpd TwoStageAmp.sch
> .model 2N3904 NPN(IS=1E-14 VAF=100
> +  Bf=300 IKF=0.4 XTB=1.5 BR=4
> +  CJC=4E-12  CJE=8E-12 RB=20 RC=0.1 RE=0.1
> +  TR=250E-9  TF=350E-12 ITF=1 VTF=2 XTF=3 Vceo=40
> + Icrating=200m mfg=Philips) 
> R5 Vin 1 10 
> .OP
> RE1 0 Vem1 100
> Q1 Vcoll1 Vbase1 Vem1 2N3904
> R2 0 Vbase1 2K
> .end
>
> The crash/assertion failure occurs when I execute the "op"
> command at the Gnucap prompt.

It didn't crash for me.

You need to move the .op to after all of the components, and you 
need to put a probe command before the op or you won't see 
anything.

Putting the .op where you have it will only give you the 
resistor R5.  Nothing else.

Try this ...

.model ... 
R5 ..
RE1....
Q1....
R1.....

.probe op v(nodes)
.op
.end

> I've poked around and it appears that since I execute the
> ".op" command halfway through the script, 
> 'DEV_RESISTANCE::precalc()' never gets called for RE1 and R2,
> leading to unpleasantness.

.. because it hasn't yet encountered RE1 and R2.

> Poking around some more, I see in 'SIM::init()' where
> 'precalc()' would be called, and I wonder if it would do any
> harm to move the call to 'precalc()' to be outside the if
> statement.  At that point, I stop, since I don't know enough
> about the overall design and implementation of Gnucap to know
> if invoking the 'precalc()' method multiple times on the
> elements in a design would be a good thing or not.
>
> So, now I'll turn this over to the experts.  Have fun! :-)

This one is a common error when moving from spice to gnucap.  
Spice dumps everything in a bag , shakes it up, and reorders as 
it wants.  Gnucap does things in exactly the order you ask.

The reason is that with gnucap you can do reasoable scripting.

Two gotchas ...

1. Print/probe/plot command goes before the analysis.
2. All that after you have the circuit.
3. always do op before ac.

I never want simple batch scripts like that except for 
regressions.  I usually run it interactively.

When I do use batch scripts, having it do exactly what I say is 
a big advantage.  You can build, measure, build more, test 
again, modify it, test again, ...  all in the same file.



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