ra3xdh / qucs_s

Qucs-S is a circuit simulation program with Qt-based GUI
https://ra3xdh.github.io/
GNU General Public License v2.0
886 stars 115 forks source link

Fix #1001 #1057

Closed ivandi69 closed 2 weeks ago

ivandi69 commented 2 weeks ago

This PR addresses #1001. Looks like in the case of crash on startup ngspice doesn't output anything to stdout or stderr: image But we can handle the crash correctly: image

ra3xdh commented 2 weeks ago

Still show an empty log for me using the test project (IGBT) from the first post in this thread. The log should be the following:

Circuit: * qucs 24.4.0  /home/vvk/.qucs/igbt_prj/igp20n60h3_dc_sweep.sch

Netlist line no. 5:
Undefined parameter [tj]
Netlist line no. 5:
 Formula() error.
      |tj=tj;| : |tj|=|tj|
Netlist line no. 9:
Undefined parameter [tj]
Netlist line no. 9:
 Formula() error.
      |n8ge3=0.013854554023489; n8ff6=1.57882194219674; n8702=3.46930288988777e-11; n86w9=8.41433062117716e-08; n84aq=1.32519041443202e-08; n7wd0=1.33871871875805e-08; n7v3x=9.92760529520462e-08; n7plu=1.50428905421895e-08; n7823=18.9093015526887; n77o2=6.45408315816135; n76ve=0; n76ll=0; n6zjd=0; n6yi8=0; n6ty8=0.00632004656777681; n6so3=2.29893281050078; n6lvg=-0.00133204969289205; n6i8c=-0.852047059737599; n6gn0=0.737142387800282; n6fw5=52.7037916495759; n6e08=-3.94369540325447e-06; n6cmj=0.0223970224737104; n6703=-7.77904953072956e-07; n65sh=-8.12563094647835e-05; n612n=7.97661835108196e-07; n60nx=-1.57641345523649e-05; n5yr0=9.47679870056731e-05; n5t5m=0.0368287907165867; n5s9x=9.65764610194974; n5s7h=0.000325950898955632; n5k9k=131.741872758703; tj=tj; n5e0u=n5e0u; n5ec8=n5ec8; kp=kp; n5m7t=n5m7t; n5q0a=n5q0a; is=is; n7l5l=n7l5l; n7ufh=n7ufh; n81cq=n81cq; n88ys=n88ys; n89dm=n89dm; n8dab=n8dab; n5t3b=n5t3b; n5zfd=n5zfd; n61an=n61an; n69y7=n69y7; n6edj=n6edj; n6gy2=n6gy2; n6pyf=n6pyf; n6uwq=n6uwq; n718f=n718f; n7w4m=n7w4m; n7yht=n7yht; n7zfx=n7zfx; n82h0=n82h0; n84cu=n84cu; n84k3=n84k3; n85kn=n85kn; n5kzl=n5kzl; n87xb=n87xb; n7tca=n7tca; n7tkt=n7tkt; n5lrx=n5lrx; n5lzv=n5lzv; n69hc=n69hc; n79xk=n79xk; n7b2g=n7b2g; n7b5h=n7b5h; n7ct5=n7ct5; n7drb=n7drb; n7gyu=n7gyu;| : |tj|=|tj|
Numparam expansion errors: Run Spice anyway? y/n ?
y
Error: no such function 'if' at line 99
from file
  "/home/vvk/.qucs/IGBT_prj/IGP20N60H3.cir

ERROR: fatal error in ngspice, exit(1)

I suspect that Ngspice requires a -b (batch mode) parameter. Otherwise it waits for the user input and cannot generate the output. It cannot recognize if it runs as the child process or with output redirection.

ra3xdh commented 2 weeks ago

I have tried the -b and it has no effect in child process mode. Probably Ngspice has problems when output redirection is used. Makes sense to provide a minimal example and report to Ngspice team.

ivandi69 commented 2 weeks ago

Ngspice crashes when compatibility mode is set. It doesn't crash in normal mode. It outputs the error log you see. image This PR fixes the misleading "Simulation successful" message displayed by Qucs-s after a simulator crash. The ngspice crash should be reported to developers.

ivandi69 commented 2 weeks ago

Here is an example in terminal: image

ra3xdh commented 2 weeks ago

Thanks! Merged. The crash should be reported to Ngspice team.