The integration of TITAN in SPICECAD works as follows.
The simulator can be chosen in the 'options*'-box in the main menu. TITAN3 (Versiond 3.2) and TITAN4 (TITAN4.0) buttons can be selected.
TITAN netlists are written automatically before each simulation. To force netlisting if a model file has changed since the last netlisting, the netlisting can be started explicitly by hitting the 'netlist' button. The netlist file ends with '.sp'. If the edited schematic topcell is called 'topcell', the netlist file will be called 'topcell.sp'.
Simulation results will be written in 'topcell.ac', 'topcell.dc', 'topcell.tr' and 'topcell.sim'. Error and warning messages are found in 'topcell.msg'.
By default, all simulation results are saved using the '.PRINT'-card :
.PRINT V(*) is default.
Currents are not saved, this has to be done explicitly in the simulation
menu.
To start the simulation, 'runsim' has to be selected in the simulation menu
(or use hotkey 'CTRL r').
If selected, a file called 'run' will be created in the current directory.
The file will be executed on a remote host (called 'simulatorhost')
on path 'simulatorpath' using the
command
rsh simulatorhost 'cd simulatorpath; run_titan topcell'
The variables 'simulatorhost' and 'simulatorpath' have to be specified in the 'options1*'-menu accessible from the main menu. 'simulatorhost' is the host where TITAN will be run, and 'simulatorpath' has to be set to your current path.
File content of 'run_titan':
rm -f titanmsg titmess.sunny.* run_titan topcell grep -n -v ERRORS topcell.msg | grep ERROR > titanmsg grep -n ERROR topcell.sim >> titanmsg sendmessage sunny 7696 rsh sunny kill --1 7696
First, some (old) files will be deleted wich contain information about the
last TITAN run.
Then, a shell script 'run_titan' will be called which has to be installed
in your current search path.
'run_titan' looks as follows:
#!/bin/csh -f /marbic/titan/bin/titan.ip_sun4 <<! > /dev/null $1.sp $1.msg zcd.$1 ! /marbic/titan/bin/titan.ak_sun4 <<! zcd.$1 $1.sim ! rm -f zcd.$1
This shell script starts the preprocessor and the simulator using the handled variable '$1'. The the above example, '$1' will be set to 'topcell'.
After executing 'run_titan', the 'run' - shellscript will be continued as follows:
grep -n -v ERRORS topcell.msg | grep ERROR > titanmsg grep -n ERROR topcell.sim >> titanmsg sendmessage sunny 7696 rsh sunny kill -1 7696
The error messages will be extracted from the files topcell.msg and 'topcell.sim' and stored in file titanmsg.
Afterwards, a shell-scipt called 'sendmessage' will be executed.
'sendmessage' contains the following lines:
#!/bin/csh -f echo "titan ready" > titmess.$1.$2
A file called 'titmess.sunny.7696' (this example) will be created which contains the line 'titan ready'. 7696 is the process id of the SPICECAD process.
The last line of shell-script 'run' is the line
rsh sunny kill -1 7696
A remote shell is started on host sunny, the same host SPICECAD is running on. The SPICECAD process (PID 7696) will receive a signal ( SIGNAL 1, HANGUP) . This signal tells SPICECAD that TITAN is ready.
SPICECAD will now open the file 'titanmsg' and look for the contents. If the TITAN simulation was successful, which means the 'titanmsg' contains only one line, 'titan ready', a window pops up in SPICECAD which contains this line. Afterwards, the simulation results will be read in by SPICECAD automatically. If the simulation was unsuccessful, which means that 'titanmsg' contains several error messages, the error messages will be displayed in the error-and-warning-window , but no simulation results will be read in.
If you have specified a '.op'-simulation (dc operating point),
the file 'topcell.sim' will be scanned, and all dc operating point voltages
will be written in a file called 'nodes.m' .
This file looks as follows:
.NODESET V(1) = 0.000000e+00 .NODESET V(2) = 0.000000e+00 .NODESET V(3) = 1.000000e+00 .NODESET V(4) = 4.999898e+00 .NODESET V(5) = 5.000000e+00
If you repeat the simulation with slightly different parameters, it would speed up the simulation if this file could be included in the netlist. To do this, open the 'options1*'-box in the main menu and set the entry 'default incfile 1' to 'nodes'.
Then, file 'nodes.m' will be included in the TITAN netlist during subsequent simulations.
After reading in the simulation results, you can select nodes or terminals to display them in the plot window.
Besides .ac, .tran and .dc simulation results dc operating point results (in file topcell.sim) are being read in, too. The whole file 'topcell.sim' is read in and stored in internal data structures. These data structures can be accessed and processed via different functions. dc op point voltages and currents can be displayed using 'show voltage' and 'show current'. Device information about bipolar and MOS transistors can be displayed using 'showdevice'. Devices in triode region or in saturation can be displayed using 'show bad devices'.