<@U01819B63HP> Hi, hope you're very well. Could you clarify me the difference between batch/interact...
n
@Stefan Schippers Hi, hope you're very well. Could you clarify me the difference between batch/interactive/control modes of ngspice? What I understand of each one after some reading in the manual is this: • When we use batch mode, we add
-b
parameter when starting ngspice, but in simple words, ngspice runs whatever it is in the
file.cir
and that's all (then it closes). • In the interactive mode, I run the file and then the ngspice prompt remains there waiting any input from my keyboard. • And control mode is just when I add a control section (or import a file with one of it). Now batch mode allows some commands (
tran, sp, pz, op, meas, trig-targ, find-when, avg, deriv
, etc -chapter 15-) and interactive mode another ones (
alias, altermod, compose, display, diff, load, plot, option, run, save
, etc -chapter 17-) some of them can be mixed into a control section, but others are mutually exclusive. Am I right?
s
Yes, you are right. batch mode means simulation starts and ends with no human intervention, no commands whatsoever. Ngspice dictates that if a -b (batch) option is given no .control / .ends section can be used. Interactive mode is without -b option. If no -a (autorun) option is given (xschem starts ngspice with -a in interactive mode) ngspice does not even start simulating. You get a ngspice prompt and have access to some ngspice commands, for example
run
starts a simulation,
display
to print the saved vectors,
write
to write them to file,
plot
to get a wave plot. All these 'interactive' commands an also be embedded within a .control / .ends section for convenience. They behave as these commands were given from keyboard. In interactive mode you an also break a simulation with '`ctrl-C`'
write
temporary results into a file and then
resume
simulation There is some overlap between commands that can be given in interactive mode (tran, save, plot) and batch mode (.tran, .save, .plot)