diff --git a/src/callback.c b/src/callback.c index fdd248b6..c88b4c8a 100644 --- a/src/callback.c +++ b/src/callback.c @@ -2442,6 +2442,11 @@ int rstate; /* (reduced state, without ShiftMask) */ dbg(1, "callback(): -------------\n"); } + else { + if(has_x) tcleval("alert_ {Can not write into the netlist directory. Please check} {}"); + else dbg(0, "Can not write into the netlist directory. Please check"); + err = 1; + } if(err) { if(has_x) { tclvareval(xctx->top_path, ".menubar.netlist configure -bg red", NULL); diff --git a/src/scheduler.c b/src/scheduler.c index 16ff0fe5..7f846db5 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -775,7 +775,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } } - /* exit [closewindow] + /* exit [closewindow] [force] * Exit the program, ask for confirm if current file modified. * if 'closewindow' is given close the window, otherwise leave with a blank schematic * when closing the last remaining window @@ -2704,6 +2704,11 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg Tcl_SetResult(interp, my_itoa(err), TCL_VOLATILE); } } + else { + if(has_x) tcleval("alert_ {Can not write into the netlist directory. Please check} {}"); + else dbg(0, "Can not write into the netlist directory. Please check"); + err = 1; + } if(err) { if(has_x) { tclvareval(xctx->top_path, ".menubar.netlist configure -bg red", NULL); diff --git a/src/xschem.tcl b/src/xschem.tcl index b5f9e1cf..c02d864f 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -1799,61 +1799,46 @@ proc simulate {{callback {}}} { set fg {execute} } set cmd [subst -nobackslashes $sim($tool,$def,cmd)] - if {$OS == "Windows"} { - # $cmd cannot be surrounded by {} as exec will change forward slash to backward slash - set save [pwd] - cd $netlist_dir - set_simulate_button list [xschem get top_path] [xschem get current_win_path] - if { $callback ne {} } { - uplevel #0 { - eval $callback - } - } - #eval exec {cmd /V /C "cd $netlist_dir&&$cmd} - eval exec $cmd & - cd $save - set id 0 - } else { - # window interface tabbed interface - # ----------------------------------------- - # top_path win_path top_path win_path - # {} .drw {} .drw - # .x1 .x1.drw {} .x1.drw - # .x2 .x2.drw {} .x2.drw - set execute(callback) " - set_simulate_button [list [xschem get top_path] [xschem get current_win_path]] - $callback - " - # puts $cmd - - if {$fg eq {execute_wait}} {xschem set semaphore [expr {[xschem get semaphore] +1}]} - - set save [pwd] - cd $netlist_dir - set id [eval execute $st $cmd] ;# Start simulation process - cd $save - - if {[info exists has_x] && $id >= 0 } { - set tctx::[xschem get current_win_path]_simulate_id $id - set button_path [xschem get top_path].menubar.simulate - $button_path configure -bg yellow - set tctx::[xschem get current_win_path]_simulate yellow - } - - puts "Simulation started: execution ID: $id" - - if {$fg eq {execute_wait}} { - if {$id >= 0} { - vwait execute(pipe,$id) - } - xschem set semaphore [expr {[xschem get semaphore] -1}] + + # window interface tabbed interface + # ----------------------------------------- + # top_path win_path top_path win_path + # {} .drw {} .drw + # .x1 .x1.drw {} .x1.drw + # .x2 .x2.drw {} .x2.drw + set execute(callback) " + set_simulate_button [list [xschem get top_path] [xschem get current_win_path]] + $callback + " + # puts $cmd + + if {$fg eq {execute_wait}} {xschem set semaphore [expr {[xschem get semaphore] +1}]} + + set save [pwd] + cd $netlist_dir + # Note: Windows $cmd cannot be surrounded by {} as exec will change forward slash to backward slash + set id [eval execute $st $cmd] ;# Start simulation process + cd $save + + if {[info exists has_x] && $id >= 0 } { + set tctx::[xschem get current_win_path]_simulate_id $id + set button_path [xschem get top_path].menubar.simulate + $button_path configure -bg yellow + set tctx::[xschem get current_win_path]_simulate yellow + } + + puts "Simulation started: execution ID: $id" + + if {$fg eq {execute_wait}} { + if {$id >= 0} { + vwait execute(pipe,$id) } + xschem set semaphore [expr {[xschem get semaphore] -1}] } return $id } else { return -1 } - } proc gaw_echoline {} { diff --git a/tests/create_save.tcl b/tests/create_save.tcl index ac3df64c..61664bb6 100644 --- a/tests/create_save.tcl +++ b/tests/create_save.tcl @@ -47,7 +47,7 @@ proc create_save {} { close $fd set filename [regsub {\.tcl$} $f {}] set output ${filename}_debug.txt - if {[catch {eval exec {$xschem_cmd ${results_dir}/$fn_sch -d 1 --script ${testname}/tests/${f} 2> ${results_dir}/$output}} msg]} { + if {[catch {eval exec {$xschem_cmd ${results_dir}/$fn_sch --pipe -d 1 --script ${testname}/tests/${f} 2> ${results_dir}/$output}} msg]} { puts "FATAL: $msg" incr num_fatals } else { diff --git a/tests/run_regression.tcl b/tests/run_regression.tcl index ecf3ada7..c5f46127 100644 --- a/tests/run_regression.tcl +++ b/tests/run_regression.tcl @@ -57,4 +57,4 @@ foreach tc $tcases { } source test_utility.tcl -exec $xschem_cmd --pipe -q --script xschemtest.tcl 2>&1 > stefan_xschemtest.log \ No newline at end of file +exec $xschem_cmd --pipe -q --script xschemtest.tcl > stefan_xschemtest.log 2>@1