::SpiceGenTcl::Xyce::SimulatorsTop, Main, Index
ClassesTop, Main, Index
Batch [::SpiceGenTcl::Xyce::Simulators]Top, Main, Index
Method summary
constructor | Constructor for the class. |
clearLog | Clear saved log by unsetting log variable. |
configure | Configure properties. |
getLog | See ::SpiceGenTcl::Simulator.getLog |
readData | Reads raw data file, create RawFile object and return it's reference name. |
readLog | Reads log file of last simulation and save it's content to Log variable. |
run | See ::SpiceGenTcl::Simulator.run |
runAndRead | Runs netlist circuit file. |
Properties
Readable: -Command
, -LastRunFileName
, -data
, -log
, -name
, -runlocation
Writable: -Command
, -LastRunFileName
, -data
, -log
, -name
, -runlocation
Superclasses
constructor [::SpiceGenTcl::Xyce::Simulators::Batch]Batch, Top, Main, Index
Creates batch ngspice simulator that can be attached to top-level Circuit.
Batch create OBJNAME name ?runLocation?
Batch new name ?runLocation?
Batch new name ?runLocation?
Details
Parameters
name | Name of simulator object. |
runLocation | Location at which input netlist is stored and all output files will be saved, default is current directory. Optional, default . . |
method constructor {name {runLocation .}} { # Creates batch ngspice simulator that can be attached to top-level Circuit. # name - name of simulator object # runLocation - location at which input netlist is stored and all output files will be saved, # default is current directory my configure -name $name my configure -Command Xyce my configure -runlocation $runLocation }
clearLog [::SpiceGenTcl::Xyce::Simulators::Batch]Batch, Top, Main, Index
Clear saved log by unsetting log variable.
OBJECT clearLog
Details
method clearLog {} { # Clear saved log by unsetting log variable. if {[info exists log]} { unset log return } else { return -code error "Log does not exists for simulator '[my configure -name]'" } }
readData [::SpiceGenTcl::Xyce::Simulators::Batch]Batch, Top, Main, Index
Reads raw data file, create RawFile object and return it's reference name.
OBJECT readData
Details
method readData {} { # Reads raw data file, create RawFile object and return it's reference name. my variable data set data [::SpiceGenTcl::RawFile new "[my configure -runlocation]/[my configure -LastRunFileName].raw"] return }
readLog [::SpiceGenTcl::Xyce::Simulators::Batch]Batch, Top, Main, Index
Reads log file of last simulation and save it's content to Log variable.
OBJECT readLog
Details
method readLog {} { # Reads log file of last simulation and save it's content to Log variable. set logFile [open "[my configure -runlocation]/[my configure -LastRunFileName].log" r+] set log [read $logFile] close $logFile return }
runAndRead [::SpiceGenTcl::Xyce::Simulators::Batch]Batch, Top, Main, Index
Runs netlist circuit file.
OBJECT runAndRead circuitStr ?-nodelete?
Details
Parameters
circuitStr | Top-level netlist string. |
-nodelete | Flag to forbid simulation file deletion. |
method runAndRead {circuitStr args} { # Runs netlist circuit file. # circuitStr - top-level netlist string # -nodelete - flag to forbid simulation file deletion # Synopsis: circuitStr ?-nodelete? set arguments [argparse { -nodelete }] set firstLine [@ [split $circuitStr \n] 0] set runLocation [my configure -runlocation] set cirFile [open "${runLocation}/${firstLine}.cir" w+] puts $cirFile $circuitStr close $cirFile set rawFileName "${runLocation}/${firstLine}.raw" set logFileName "${runLocation}/${firstLine}.log" set cirFileName "${runLocation}/${firstLine}.cir" exec "[my configure -Command]" -r $rawFileName -l $logFileName $cirFileName my configure -LastRunFileName ${firstLine} my readLog my readData if {[info exists nodelete]==0} { file delete $rawFileName file delete $logFileName file delete $cirFileName } }