::SpiceGenTcl::Xyce::SimulatorsTop, Main, Index
ClassesTop, Main, Index
Batch [::SpiceGenTcl::Xyce::Simulators]Top, Main, Index
Method summary
| Constructor for the class. | |
configure | Configure properties. |
getLog | See ::SpiceGenTcl::Simulator.getLog |
| Reads raw data file, create RawFile object and return it's reference name. | |
| Reads log file of last simulation and save it's content to Log variable. | |
run | See ::SpiceGenTcl::Simulator.run |
| Runs netlist circuit file. |
Properties
-data | Readable, writable. |
-log | Readable, writable. |
-name | Readable, writable. |
-runlocation | Readable, writable. |
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 ?args?
Batch new ?args?
Batch new ?args?
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. |
method constructor {args} {
# 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
argparse -help {Creates batch ngspice simulator that can be attached to top-level 'Circuit'} {
{name -help {Name of simulator object}}
{runLocation -optional -default . -help {Location at which input netlist is stored and all output files will be saved}}
}
my configure -name $name
my variable Command
set Command Xyce
my configure -runlocation $runLocation
}readData [::SpiceGenTcl::Xyce::Simulators::Batch]Batch, Top, Main, Index
Reads raw data file, create RawFile object and return it's reference name.
BATCHOBJ readData ?args?
Parameters
method readData {args} {
# Reads raw data file, create RawFile object and return it's reference name.
argparse -help {Reads raw data file, create RawFile object and return it's reference name} {}
my variable data
set data [::SpiceGenTcl::RawFile new [file join [my configure -runlocation] ${LastRunFileName}.raw] * ngspice]
return
}readLog [::SpiceGenTcl::Xyce::Simulators::Batch]Batch, Top, Main, Index
Reads log file of last simulation and save it's content to Log variable.
BATCHOBJ readLog ?args?
Parameters
method readLog {args} {
# Reads log file of last simulation and save it's content to Log variable.
argparse -help {Reads log file of last simulation and save it's content to Log variable} {}
set logFile [open [file join [my configure -runlocation] ${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?
Parameters
-nodelete | Flag to forbid simulation file deletion. |
circuitStr | Top-level netlist string. |
method runAndRead {args} {
# Runs netlist circuit file.
# circuitStr - top-level netlist string
# -nodelete - flag to forbid simulation file deletion
# Synopsis: circuitStr ?-nodelete?
argparse -pfirst -help {Runs netlist circuit file} {
{circuitStr -help {Top-level netlist string}}
{-nodelete -help {Flag to forbid simulation file deletion}}
}
my variable Command
set firstLine [@ [split $circuitStr \n] 0]
set runLocation [my configure -runlocation]
set cirFile [open [file join $runLocation ${firstLine}.cir] w+]
puts $cirFile $circuitStr
close $cirFile
set rawFileName [file join $runLocation ${firstLine}.raw]
set logFileName [file join $runLocation ${firstLine}.log]
set cirFileName [file join $runLocation ${firstLine}.cir]
exec {*}[list $Command -r $rawFileName -l $logFileName $cirFileName]
set LastRunFileName $firstLine
my readLog
my readData
if {![info exists nodelete]} {
file delete $rawFileName
file delete $logFileName
file delete $cirFileName
}
}