next up previous contents
Next: What's new and very Up: SPICECAD The Schematic Entry Previous: Required Hardware Platforms

Batch execution

 SPICECAD has a simple command interpreter which allows for execution of command files. The command syntax is simple (no variables, no branches, no loops, no if-then-else). The file which is executed can be defined in the 'options1' - dialog, entry 'batch file'. Lines beginning with a '#' are skipped, they can be used to insert comments.

In tables 20.1 ... 20.5, the available commands are described in short. First, three batch file examples will show how to use these commands.
First batch file example :

set simulator spice3
#set simulator hspice
#set xrange 0 10
set xlabel time [s]
set ylabel Vout [V]
set title example of a batch file
set param cap1 1.0
set param res1 2.0
set calculatorline 0 V(1) tran
open calculator
runsim
# for correct line count!
plot calc
#generate hardcopy of plot result window, into file tmp.ps
hardcopy ps
#
system mv tmp.ps tmp1.ps
set param cap1 .2
set param res1 20.0
runsim
plot calc
hardcopy ps
#stop
#open calculator
set calculatorline 0 V(2) tran
#import measurement
set calculatorline 1 import tmp.txt
set calculatorline 2 -
plot calc
#
hardcopy ps
system mv tmp.ps tmp2.ps
#stop
set calculatorline 2 -
plot calc
hardcopy ps
system mv tmp.ps tmp3.ps
#
set param cap1 .4
set param res1 10.0
runsim
#
plot calc
hardcopy ps
system mv tmp.ps tmp4.ps
#
close calculator
close plotwindow
stop

Second batch file example: calls an external SPICE3 simulation core and reads its results afterwards.

set simulator spice3
netlist
system spice3 -b rctest1.sp -raw rawspice.raw
load spice3 rawspice.raw
stop

Third batch file example : sweep over different technology files, temperatures and special command files

set simulator spice3
#set simulator hspice
#set xrange 0 10
set xlabel input voltage [V]
set ylabel output voltage [V]
set title CMOS inverter transfer function using different technology sets
set modelpath 1 /usr1/kimtr/models/hspice/035/ff
runsim
select net outnet
open plotwindow
plot dcsweep
hardcopy ps
system mv tmp.ps ff.ps
#
set modelpath 0 /usr1/kimtr/models/hspice/035/ss
runsim
plot dcsweep
hardcopy ps
system mv tmp.ps ss.ps
#
set modelpath 0 /usr1/kimtr/models/hspice/035/fs
runsim
plot dcsweep
hardcopy ps
system mv tmp.ps fs.ps
#
set modelpath 0 /usr1/kimtr/models/hspice/035/sf
runsim
plot dcsweep
hardcopy ps
system mv tmp.ps sf.ps
set modelpath 0 /usr1/kimtr/models/hspice/035/ty
set temp 100
runsim
plot dcsweep
hardcopy ps
system mv tmp.ps ty_100.ps
#
set temp -40
runsim
plot dcsweep
hardcopy ps
system mv tmp.ps ty_-40.ps
#
set temp 25
set includefile 0 specialcommands1
runsim
plot dcsweep
hardcopy ps
system mv tmp.ps ty_special1.ps
#
set includefile 0 specialcommands2
runsim
plot dcsweep
hardcopy ps
system mv tmp.ps ty_special2.ps
stop



 
Table 20.1: Begin of batch command list

stop :

stops execution

no_execution:

test the script, the commands are not executed

redo_execution:

exit test mode, execute commands starting here

run batchfile :

call another batchfile.
run monte : run Monte Carlo simulation
run paramsweep : run parameter sweep simulation
run optimgrad : run optimization, use gradient search
run optimmonte : run optimization, use Monte Carlo approach (rapid thermal annealing)

plot voltages :

plot voltages only (no mix of voltages and currents)
plot currents : plot terminal currents only (no mix of voltages and currents)
plot tran: Plot selected voltage or terminal currents from transient simulation
plot dcsweep: Plot selected voltage or terminal currents from dc sweep simulation
plot acm: Plot selected voltage or terminal currents from ac sweep simulation (magnitudes)
plot acp: Plot selected voltage or terminal currents from ac sweep simulation(phase)
plot inoise: plot input referred noise from noise simulation
plot onoise: plot output referred noise from noise simulation

plot calc normal :

plot the calulator contents in normal (non-parametric) mode
plot calc parametric : plot the calulator contents in parametric mode

clear xrange:

sets plot xrange to default (=autoscale)
clear yrange: sets plot yrange to default (=autoscale)
clear xlabel: sets plot xlabel string to default = "(none)"
clear ylabel: sets plot ylabel string to default = "(none)"
clear title: sets plot title string to default = "(none)"
clear selectednet : clear list of selected net voltages to be plotted
clear selectedterm : clear list of selected terminal currents to be plotted

 


 
Table 20.2: Continuation of batch command list

select net 'alias':

Select the net with the attached 'alias' shall be plotted after the next 'plot' command

select terminal 'alias' 'name':

Select the terminal 'name' of the device with the attached 'alias' to be plotted after the next 'plot' command.
The terminal names are : 'B' 'D' 'S' 'G' for MOS transistors
'S' 'D' 'G' for JFET and MESFET transistors
'B' 'C' 'E' 'S' for bipolar transistors
'coil1','coil2' for coupled inductors
No terminal names are required for two - terminal devices like sources and passive elements

unselect net 'alias':

Deselect the net with the attached 'alias' which shall no longer be plotted after the next 'plot' command

unselect terminal 'alias' 'name':

Select the terminal 'name' of the device with the attached 'alias' which shall no longer be plotted to be plotted after the next 'plot' command. The terminal names are : 'B' 'D' 'S' 'G' for MOS transistors
'S' 'D' 'G' for JFET and MESFET transistors
'B' 'C' 'E' 'S' for bipolar transistors
'coil1','coil2' for coupled inductors
No terminal names are required for two - terminal devices like sources and passive elements

set calculatorline 'n' 'string' :

'n' is the number of the calculator line you want to set, 'string' is the string which shall appear in this line. 'n' starts at 0 (see page [*]).

set modelpath 'n' 'path' :

Set model path no. 'n'. 'n' starts at 0.
set host 'n' 'host' : Set simulator no. 'n'. 'n' starts at 0.
set scriptfile 'scriptfile' : Set 'scriptfile' to the name of a script file which can filter the SPICECAD generated netlist
set nice 'prio' : Sets the nice priority of the simulator task.
set librarypath 'n' 'path': Set library path no. 'n'. 'n' starts at 0.
set includefile 'n' 'file' : Set include file name no 'n' to 'file'. 'n' starts at 0.

 


 
Table 20.3: Continuation of batch command list

set param 'name' 'value' :

Sets parameter 'name' inside parameter box to value 'value'
set axis 'look': 'look' may be 'nolog','xlog','ylog','loglog'.
set grid : Switch grid in plotwindow on
set nogrid : Switch grid in plotwindow off
set key : Displays plot description in plotwindow
set nokey: Do not display plot description in plotwindow

 


 
Table 20.4: Continuation of batch command list

set style 'look':

'look' may be 'lines','points' or 'linespoints'.
set xrange 'xmin' 'xmax' : Define plot x-range.
set yrange 'ymin' 'ymax' : Define plot y-range.
set xlabel : Defines label of x-axis in plotwindow
set ylabel : Defines label of y-axis in plotwindow
set title : Defines title in plotwindow
set simulator 'sim' : 'sim' can be 'spice3','hspice' or 'titan'
set tran 'prop' 'val' : set properties inside the TRAN simulation box 'prop' may be one of 'tstep' 'tstop' 'tstart' 'tmax' 'UIC' 'MONTE'
set dcop 'prop' 'val' : set properties inside the DCOP simulation box 'prop' may be one of 'when' 'MONTE' (only when using HSPICE!)
set dcsweep 'prop' 'val' : set properties inside the DCSWEEP simulation box 'prop' may be one of 'source1' 'start1' 'stop1' 'step1' 'source2' 'start2' 'stop2' 'MONTE'
set acsweep 'prop' 'val' : set properties inside the ACSWEEP simulation box 'prop' may be one of 'inctype' 'num' 'fstart' 'fstop' 'MONTE'

set temp 'prop' 'val' :

set properties inside the TEMP simulation box 'prop' may be one of 'temp'
set paramsweep 'prop' 'val' : set properties inside the PARAMETER SWEEP simulation box 'prop' may be one of 'varname1' 'sweeptype1' 'start1' 'stop1' 'steps1' 'varname2' 'start2' 'stop2' 'steps2'
set option 'prop' 'val' : set properties inside the OPTIONS simulation box 'prop' may be one of abstol reltol method gmin tnom probe post gmindc converge gshunt interpolation delmax vntol trtol limpts scale
set hbfreq 'prop' 'val' : set properties inside the harmonic balance analysis box 'prop' may be one of startfile freqfile hbstab
set hbtran 'prop' 'val' : set properties inside the harmonic balance analysis box 'prop' may be one of source start stop inc hbstab
set startup 'prop' 'val' : set properties inside the startup analysis box 'prop' may be one of ianmod epscon muldaf ngsmax ntimpo ninper nenvwr ninwri

 


 
Table 20.5: Continuation of batch command list

load spice 'file' :

load spice3 results file
load schematic 'schemname' : Load schematic. Use very carefully!
read params : Read parameter file 'varlist'
read calcfile n : Load the contents of file 'calcn.con' , where n is equal or between 1 and 3. This commands sets the lines of the calculator window.
read tran : Read simulation results from transient simulation
read dc : Read simulation results from dcsweep simulation
read ac : Read simulation results from small-signal simulation

spice3command 'command':

with this command, you can send commands directly to the spice3 command interpreter. Using this command, you can control which simulations you want to save in which file etc.

save spice3 :

save all SPICE3 simulation results into file 'rawspice.raw'.
open calculator : opens the calculator window (see page [*])
open plotwin : opens the plot results window

close calculator :

closes the calculator window
close plotwin : closes the plot results window

hardcopy ps :

plot plotwindow contents into postscript file tmp.ps
hardcopy hpgl : plot plotwindow contents into hpgl file tmp.hgl
hardcopy table : save plotwindow contents in an ascii file 'tmp.txt' in tabular format

save as goal :

save plotwindow contents in goal file format in an ascii file 'tmp.txt' for later use in an optimization.

system 'command' :

executing 'command' using 'system "command"'
runsim : run simulator
netlist : run netlisting explicitly. Althogh SPICECAD netlists automatically when library or model paths have been changed, it is better to run 'netlist' before each simulation explicitly.

reload :

reloads schematic after changing library path

 


next up previous contents
Next: What's new and very Up: SPICECAD The Schematic Entry Previous: Required Hardware Platforms
Martin Maschmann
1999-10-10