@@ -24,7 +24,7 @@ use spice::netlist::{
24
24
} ;
25
25
use spice:: Spice ;
26
26
use substrate:: context:: Installation ;
27
- use substrate:: execute:: Executor ;
27
+ use substrate:: execute:: { ExecOpts , Executor , LogOutput } ;
28
28
use substrate:: schematic:: schema:: Schema ;
29
29
use substrate:: simulation:: { SimulationContext , Simulator } ;
30
30
use templates:: { write_run_script, RunScriptContext } ;
@@ -297,6 +297,7 @@ struct CachedSimState {
297
297
input : Vec < Input > ,
298
298
netlist : PathBuf ,
299
299
output_file : PathBuf ,
300
+ stdout_path : PathBuf ,
300
301
log : PathBuf ,
301
302
err_log : PathBuf ,
302
303
run_script : PathBuf ,
@@ -317,6 +318,7 @@ impl CacheableWithState<CachedSimState> for CachedSim {
317
318
input,
318
319
netlist,
319
320
output_file,
321
+ stdout_path,
320
322
log,
321
323
err_log,
322
324
run_script,
@@ -343,7 +345,13 @@ impl CacheableWithState<CachedSimState> for CachedSim {
343
345
let mut command = std:: process:: Command :: new ( "/bin/bash" ) ;
344
346
command. arg ( & run_script) . current_dir ( & work_dir) ;
345
347
executor
346
- . execute ( command, Default :: default ( ) )
348
+ . execute (
349
+ command,
350
+ ExecOpts {
351
+ logs : LogOutput :: File ( stdout_path) ,
352
+ ..Default :: default ( )
353
+ } ,
354
+ )
347
355
. map_err ( |_| Error :: NgspiceError ) ?;
348
356
349
357
let contents = std:: fs:: read ( & output_file) ?;
@@ -431,6 +439,7 @@ impl Ngspice {
431
439
432
440
let output_file = ctx. work_dir . join ( "data.raw" ) ;
433
441
let log = ctx. work_dir . join ( "ngspice.log" ) ;
442
+ let stdout_path = ctx. work_dir . join ( "ngspice.out" ) ;
434
443
let err_log = ctx. work_dir . join ( "ngspice.err" ) ;
435
444
let run_script = ctx. work_dir . join ( "simulate.sh" ) ;
436
445
let work_dir = ctx. work_dir . clone ( ) ;
@@ -448,6 +457,7 @@ impl Ngspice {
448
457
input,
449
458
netlist,
450
459
output_file,
460
+ stdout_path,
451
461
log,
452
462
err_log,
453
463
run_script,
0 commit comments