What can I do to wait for the simulation to finish...
# xschem
d
What can I do to wait for the simulation to finish and the run the
raw_read
command ?
p
Hi, I had faced a similar issue and came up with a very clunky
proc reloadaftercomplete {} {
set targfile "[file tail [file rootname [xschem get current_name]]].raw"
set targpath "simulations/$targfile"
set numprocs 1
while {$numprocs > 0} {
after 500
set isrunning [open "|/home/ttuser/spiceruns.sh" r]
gets $isrunning numprocs
puts stderr "SPICE RUNNING $numprocs"
}
after 500
xschem raw_clear
xschem raw_read $targpath
puts stderr "reloaded $targfile"
}
which was pretty awful, even relying on a shell script to just do a ps waux | grep '[n]gspice' | wc -l type thing. It worked but wasn't pretty -- hoping there's a better way.
Also, it'll stay stuck in a forever loop if there's another ngspice process running. So yeah, pretty awful. Curious to see if there's a way to get this info in a cleaner callback type way.