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
|
|
|
|