Hello.
Hope this is the right place to post this query.
This problem shows up in v26 running in linux (command “uname –a” returns “Linux AGD-ADEETC-Ubuntu16 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux”), both in interactive mode and when used as a shared library.
Executing a transient analysis over any of the attached circuits leads to ngspice hanging: in interactive mode it becomes unresponsive to ctrl-c; and when using as a shared library it becomes unresponsive to command “bg_halt”. To see this happening in interactive mode, just do the following:
1) ngspice <any attached="" file="">
2) run
Although the attached circuits are somewhat peculiar, in the sense that it is not obvious what the purpose of those meshes of mosfets is, they seem to be formally/syntactically correct (there are no singular nodes, no ill-defined components or analysis, and so on). So, it is not obvious to me why ngspice hangs when simulating those circuits. Does anyone have any hint about what is happening?
Thanks a lot.
Miguel</any>
With ngspice-27, in console mode, three Ctrl-Cs break the .OP pass (this
is a new feature). I only tried problematic_circuit_after_unsuccessful_bg_halt_0.cir .
As shown, the .OP makes no progress, which might be
a logical / algorithmic bug for a corner case.
-marcel
Converges (still difficult) when putting a 10 Ohms resistance
in series with the PWL sources:
Made minor adjustment here ".tran 1ms 4 0 1ms" and
here ".option method=gear reltol=1m minbreak=200ps",
but it also worked without these changes.
The problem seems to be bad convergence on node 4 (or 5).
Output:
Last edit: marcel hendrix 2017-12-05
The bug is that ngspice enters a loop and does not leave it anymore. This occurs in function dynamic_gmin() in cktop.c.
This should not happen, despite of what customer input we have. If there is no convergence, ngspice should simply stop with an error message. I will look into it.
Holger
cktop.c:186 should read
factor = max(sqrt(factor), 1.00005); /* has to be larger than 1 */Holger
Hi.
Thank you all for your feedback on this topic.
Holger, I’ll try recompiling ngspice (still in v26) with your suggestion: updating cktop.c so that line 186 reads
factor = max(sqrt(factor), 1.00005); /* has to be larger than 1 */The thing is that in my machine, line 186 of cktop.c is empty (and I’m pretty sure I never edit this file before) but it may just be a matter of different file’s version. In my version of cktop.c, some lines around line 190 read like this:
So, I’ll assume that, according to this file extract, it is line 198 that, instead of reading
factor = sqrt (factor);should read
factor = max(sqrt(factor), 1.00005); /* has to be larger than 1 */Am I right?
Again, thanks very much.
Miguel
That's right.
Holger
Dear Miguel,
Holger is 100% right that you have found a nasty ng-spice
bug that should be killed forthwith.
However, you may try your circuit with the BSIM4 and a (then)
more appropriate Vdd = 1.8V and drive level of 1.2V. (Search the
manual for examples on BSIM4, e.g. 17.9 p337.)
I found it instructive to experiment with levels 1 - 54
and try different supply voltages -- your circuit clearly
shows how important it is to have a good model with good
parameters.
-marcel
PS: Shortened the simulation time from 4s to 4 us.
Last edit: marcel hendrix 2017-12-05
Hi Holger,
it should exit from dynamic_gmin at a certain point, if I remember correctly.
The problem is that it may take a very long time, depending on the circuit.
I will wait for your findings.
Fra
Hi.
I tried Holger’s suggestion and it worked (ngspice stopped hanging when simulating those circuits).
Thank you all.