Tcl SpiceGenTcl package (v0.60)

::SpiceGenTcl::Ngspice::BasicDevicesTop, Main, Index

ClassesTop, Main, Index

C [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

Capacitor

Capacitor [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Device

Subclasses

C

constructor [::SpiceGenTcl::Ngspice::BasicDevices::Capacitor]Capacitor, Top, Main, Index

Creates object of class Capacitor that describes capacitor.

OBJECT constructor name npNode nmNode -c value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value|-dtemp value? ?-scale value? ?-ic value?
OBJECT constructor name npNode nmNode -beh -c value ?-tc1 value? ?-tc2 value?
OBJECT constructor name npNode nmNode -beh -q value ?-tc1 value? ?-tc2 value?
OBJECT constructor name npNode nmNode -model value ?-c value? ?-l value? ?-w value? ?-temp value|-dtemp value? ?-m value? ?scale value? ?-ic value?
Parameters
nameName of the device without first-letter designator C.
npNodeName of node connected to positive pin.
nmNodeName of node connected to negative pin.
argsKeyword instance parameters.
Description

Capacitor type could be specified with additional switches: -beh if we want to model circuit's variable dependent capacitor, or -model modelName if we want to simulate capacitor with model card. Simple capacitor:

CXXXXXXX n+ n- <value> <mname> <m=val> <scale=val> <temp=val>
+ <dtemp=val> <tc1=val> <tc2=val> <ic=init_condition>

Example of class initialization as a simple capacitor:

::SpiceGenTcl::Ngspice::BasicDevices::Capacitor new 1 netp netm 1e-6 -tc1 1 -temp {temp -eq}

Behavioral capacitor with C =ession:

CXXXXXXX n+ n- C={expression} <tc1=value> <tc2=value>

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::Capacitor new 1 netp netm -c "V(a)+V(b)+pow(V(c),2)" -beh -tc1 1

Behavioral capacitor with Q expression:

CXXXXXXX n+ n- Q={expression} <tc1=value> <tc2=value>

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::Capacitor new 1 netp netm -q "V(a)+V(b)+pow(V(c),2)" -beh -tc1 1

Capacitor with model card:

CXXXXXXX n+ n- <value> <mname> <l=length> <w=width> <m=val>
+ <scale=val> <temp=val> <dtemp=val> <ic=init_condition>

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::Capacitor new 1 netp netm -model capm -l 1e-6 -w 10e-6
method constructor {name npNode nmNode args} {

    # Creates object of class `Capacitor` that describes capacitor.
    #  name - name of the device without first-letter designator C
    #  npNode - name of node connected to positive pin
    #  nmNode - name of node connected to negative pin
    #  args - keyword instance parameters
    # Capacitor type could be specified with additional switches: `-beh` if we
    # want to model circuit's variable dependent capacitor, or `-model modelName`
    # if we want to simulate capacitor with model card.
    # Simple capacitor:
    # ```
    # CXXXXXXX n+ n- <value> <mname> <m=val> <scale=val> <temp=val>
    # + <dtemp=val> <tc1=val> <tc2=val> <ic=init_condition>
    # ```
    # Example of class initialization as a simple capacitor:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::Capacitor new 1 netp netm 1e-6 -tc1 1 -temp {temp -eq}
    # ```
    # Behavioral capacitor with C =ession:
    # ```
    # CXXXXXXX n+ n- C={expression} <tc1=value> <tc2=value>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::Capacitor new 1 netp netm -c "V(a)+V(b)+pow(V(c),2)" -beh -tc1 1
    # ```
    # Behavioral capacitor with Q expression:
    # ```
    # CXXXXXXX n+ n- Q={expression} <tc1=value> <tc2=value>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::Capacitor new 1 netp netm -q "V(a)+V(b)+pow(V(c),2)" -beh -tc1 1
    # ```
    # Capacitor with model card:
    # ```
    # CXXXXXXX n+ n- <value> <mname> <l=length> <w=width> <m=val>
    # + <scale=val> <temp=val> <dtemp=val> <ic=init_condition>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::Capacitor new 1 netp netm -model capm -l 1e-6 -w 10e-6
    # ```
    # Synopsis: name npNode nmNode -c value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value|-dtemp value?
    #   ?-scale value? ?-ic value?
    # Synopsis: name npNode nmNode -beh -c value ?-tc1 value? ?-tc2 value?
    # Synopsis: name npNode nmNode -beh -q value ?-tc1 value? ?-tc2 value?
    # Synopsis: name npNode nmNode -model value ?-c value? ?-l value? ?-w value? ?-temp value|-dtemp value?
    #   ?-m value? ?scale value? ?-ic value?
    set arguments [argparse -inline {
        {-c= -forbid {q}}
        {-q= -require {beh} -forbid {c model}}
        {-beh -forbid {model}}
        {-model= -forbid {beh}}
        {-m= -forbid {beh}}
        {-scale= -forbid {beh}}
        {-temp= -forbid {beh dtemp}}
        {-dtemp= -forbid {beh temp}}
        {-tc1= -forbid {model}}
        {-tc2= -forbid {model}}
        {-ic= -forbid {beh}}
        {-l= -require {model}}
        {-w= -require {model}}
    }]
    set params ""
    if {[dexist $arguments c]} {
        set cVal [dget $arguments c]
        if {[dexist $arguments beh]} {
            lappend params "c $cVal -eq"
        } elseif {([llength $cVal]>1) && ([@ $cVal 1]=="-eq")} {
            lappend params "c [@ $cVal 0] -poseq"
        } else {
            lappend params "c $cVal -pos"
        }
    } elseif {([dexist $arguments model]==0) && ([dexist $arguments q]==0)} {
        return -code error "Capacitor value must be specified with '-c value'"
    }
    if {[dexist $arguments q]} {
        set qVal [dget $arguments q]
        lappend params "q $qVal -eq"
    }
    if {[dexist $arguments model]} {
        lappend params "model [dget $arguments model] -posnocheck"
    }
    dict for {paramName value} $arguments {
        if {$paramName ni {c q beh model}} {
            lappend params "$paramName $value"
        }
    }
    next c$name [list "np $npNode" "nm $nmNode"] $params
}

CModel [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Model.addParam
argsPreprocessSee ::SpiceGenTcl::KeyArgsBuilder.argsPreprocess
buildArgStrSee ::SpiceGenTcl::KeyArgsBuilder.buildArgStr
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Model.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Model.genSPICEString
getParamsSee ::SpiceGenTcl::Model.getParams
setParamValueSee ::SpiceGenTcl::Model.setParamValue
Properties

Readable: -name, -type

Writable: -name, -type

Superclasses

::SpiceGenTcl::Model

Mixins

::SpiceGenTcl::KeyArgsBuilder

constructor [::SpiceGenTcl::Ngspice::BasicDevices::CModel]CModel, Top, Main, Index

Creates object of class CModel that describes semiconductor capacitor model.

OBJECT constructor name ?-option value ...?
Parameters
nameName of the model.
argsKeyword instance parameters.
Description

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::CModel new capmod -tc1 1 -tc2 2
method constructor {name args} {

    # Creates object of class `CModel` that describes semiconductor capacitor model.
    #  name - name of the model
    #  args - keyword instance parameters
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::CModel new capmod -tc1 1 -tc2 2
    # ```
    # Synopsis: name ?-option value ...?
    set paramsNames [list cap cj cjsw defw narrow short tc1 tc2 tnom di thick]
    next $name c [my argsPreprocess $paramsNames {*}$args]
}

CSwitch [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Common::BasicDevices::CSwitch

Subclasses

W

CSwitchModel [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Model.addParam
argsPreprocessSee ::SpiceGenTcl::KeyArgsBuilder.argsPreprocess
buildArgStrSee ::SpiceGenTcl::KeyArgsBuilder.buildArgStr
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Model.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Model.genSPICEString
getParamsSee ::SpiceGenTcl::Model.getParams
setParamValueSee ::SpiceGenTcl::Model.setParamValue
Properties

Readable: -name, -type

Writable: -name, -type

Superclasses

::SpiceGenTcl::Model

Mixins

::SpiceGenTcl::KeyArgsBuilder

constructor [::SpiceGenTcl::Ngspice::BasicDevices::CSwitchModel]CSwitchModel, Top, Main, Index

Creates object of class CSwitchModel that describes current switch model.

OBJECT constructor name ?-option value ...?
Parameters
nameName of the model.
argsKeyword instance parameters.
Description

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::CSwitchModel new cswmod -it 1 -ih 0.5 -ron 1 -roff 1e6
method constructor {name args} {

    # Creates object of class `CSwitchModel` that describes current switch model.
    #  name - name of the model
    #  args - keyword instance parameters
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::CSwitchModel new cswmod -it 1 -ih 0.5 -ron 1 -roff 1e6
    # ```
    # Synopsis: name ?-option value ...?
    set paramsNames [list it ih ron roff]
    next $name csw [my argsPreprocess $paramsNames {*}$args]
}

Inductor [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Device

Subclasses

L

constructor [::SpiceGenTcl::Ngspice::BasicDevices::Inductor]Inductor, Top, Main, Index

Creates object of class Inductor that describes inductor.

OBJECT constructor name npNode nmNode -l value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value|-dtemp value? ?-scale value? ?-ic value?
OBJECT constructor name npNode nmNode -beh -l value ?-tc1 value? ?-tc2 value?
OBJECT constructor name npNode nmNode -model value ?-l value? ?-temp value|-dtemp value? ?-m value? ?scale value? ?-ic value? ?-nt value? ?-tc1 value? ?-tc2 value?
Parameters
nameName of the device without first-letter designator L.
npNodeName of node connected to positive pin.
nmNodeName of node connected to negative pin.
argsKeyword instance parameters.
Description

Inductor type could be specified with additional switches: -beh if we want to model circuit's variable dependent inductor, or -model modelName if we want to simulate inductor with model card. Simple inductor:

LYYYYYYY n+ n- <value> <m=val>
+ <scale=val> <temp=val> <dtemp=val> <tc1=val>
+ <tc2=val> <ic=init_condition>

Example of class initialization as a simple inductor:

::SpiceGenTcl::Ngspice::BasicDevices::Inductor new 1 netp netm -l 1e-6 -tc1 1 -temp {temp -eq}

Behavioral inductor:

LYYYYYYY n+ n- L={expression} <tc1=val> <tc2=val>

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::Inductor new 1 netp netm -l "V(a)+V(b)+pow(V(c),2)" -beh -tc1 1

Inductor with model card:

LYYYYYYY n+ n- <value> <mname> <nt=val> <m=val>
+ <scale=val> <temp=val> <dtemp=val> <tc1=val>
+ <tc2=val> <ic=init_condition>

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::Inductor new 1 netp netm -l 1e-6 -model indm
method constructor {name npNode nmNode args} {

    # Creates object of class `Inductor` that describes inductor.
    #  name - name of the device without first-letter designator L
    #  npNode - name of node connected to positive pin
    #  nmNode - name of node connected to negative pin
    #  args - keyword instance parameters
    # Inductor type could be specified with additional switches: `-beh` if we
    # want to model circuit's variable dependent inductor, or `-model modelName`
    # if we want to simulate inductor with model card.
    # Simple inductor:
    # ```
    # LYYYYYYY n+ n- <value> <m=val>
    # + <scale=val> <temp=val> <dtemp=val> <tc1=val>
    # + <tc2=val> <ic=init_condition>
    # ```
    # Example of class initialization as a simple inductor:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::Inductor new 1 netp netm -l 1e-6 -tc1 1 -temp {temp -eq}
    # ```
    # Behavioral inductor:
    # ```
    # LYYYYYYY n+ n- L={expression} <tc1=val> <tc2=val>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::Inductor new 1 netp netm -l "V(a)+V(b)+pow(V(c),2)" -beh -tc1 1
    # ```
    # Inductor with model card:
    # ```
    # LYYYYYYY n+ n- <value> <mname> <nt=val> <m=val>
    # + <scale=val> <temp=val> <dtemp=val> <tc1=val>
    # + <tc2=val> <ic=init_condition>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::Inductor new 1 netp netm -l 1e-6 -model indm
    # ```
    # Synopsis: name npNode nmNode -l value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value|-dtemp value?
    #   ?-scale value? ?-ic value?
    # Synopsis: name npNode nmNode -beh -l value ?-tc1 value? ?-tc2 value?
    # Synopsis: name npNode nmNode -model value ?-l value? ?-temp value|-dtemp value? ?-m value? ?scale value?
    #   ?-ic value? ?-nt value? ?-tc1 value? ?-tc2 value?
    set arguments [argparse -inline {
        -l=
        {-beh -forbid {model} -require {l}}
        {-model= -forbid {beh}}
        {-m= -forbid {beh}}
        {-scale= -forbid {beh}}
        {-temp= -forbid {beh dtemp}}
        {-dtemp= -forbid {beh temp}}
        -tc1=
        -tc2=
        {-nt= -require {model}}
        {-ic= -forbid {beh}}
    }]
    set params ""
    if {[dexist $arguments l]} {
        set lVal [dget $arguments l]
        if {[dexist $arguments beh]} {
            lappend params "l $lVal -eq"
        } elseif {([llength $lVal]>1) && ([@ $lVal 1]=="-eq")} {
            lappend params "l [@ $lVal 0] -poseq"
        } else {
            lappend params "l $lVal -pos"
        }
    } elseif {[dexist $arguments model]==0} {
        return -code error "Inductor value must be specified with '-l value'"
    }
    if {[dexist $arguments model]} {
        lappend params "model [dget $arguments model] -posnocheck"
    }
    dict for {paramName value} $arguments {
        if {$paramName ni {l beh model}} {
            lappend params "$paramName $value"
        }
    }
    next l$name [list "np $npNode" "nm $nmNode"] $params
}

L [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

Inductor

LModel [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Model.addParam
argsPreprocessSee ::SpiceGenTcl::KeyArgsBuilder.argsPreprocess
buildArgStrSee ::SpiceGenTcl::KeyArgsBuilder.buildArgStr
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Model.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Model.genSPICEString
getParamsSee ::SpiceGenTcl::Model.getParams
setParamValueSee ::SpiceGenTcl::Model.setParamValue
Properties

Readable: -name, -type

Writable: -name, -type

Superclasses

::SpiceGenTcl::Model

Mixins

::SpiceGenTcl::KeyArgsBuilder

constructor [::SpiceGenTcl::Ngspice::BasicDevices::LModel]LModel, Top, Main, Index

Creates object of class LModel that describes inductor model.

OBJECT constructor name ?-option value ...?
Parameters
nameName of the model.
argsKeyword instance parameters.
Description

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::LModel new indmod -tc1 1 -tc2 2
method constructor {name args} {

    # Creates object of class `LModel` that describes inductor model.
    #  name - name of the model
    #  args - keyword instance parameters
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::LModel new indmod -tc1 1 -tc2 2
    # ```
    # Synopsis: name ?-option value ...?
    set paramsNames [list ind csect dia length tc1 tc2 tnom nt mu]
    next $name l [my argsPreprocess $paramsNames {*}$args]
}

R [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

Resistor

Resistor [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Device

Subclasses

R

constructor [::SpiceGenTcl::Ngspice::BasicDevices::Resistor]Resistor, Top, Main, Index

Creates object of class Resistor that describes resistor.

OBJECT constructor name npNode nmNode -r value ?-tc1 value? ?-tc2 value? ?-ac value? ?-m value? ?-noisy 0|1? ?-temp value|-dtemp value? ?-scale value?
OBJECT constructor name npNode nmNode -beh -r value ?-tc1 value? ?-tc2 value?
OBJECT constructor name npNode nmNode -model value ?-r value? ?-l value? ?-w value? ?-temp value|-dtemp value? ?-m value? ?-noisy 0|1? ?-ac value? ?scale value?
Parameters
nameName of the device without first-letter designator R.
npNodeName of node connected to positive pin.
nmNodeName of node connected to negative pin.
argsKeyword instance parameters.
Description

Resistor type could be specified with additional switches: -beh if we want to model circuit's variable dependent resistor, or -model modelName if we want to simulate resistor with model card. Simple resistor:

RXXXXXXX n+ n- <resistance|r=>value <ac=val> <m=val>
+ <scale=val> <temp=val> <dtemp=val> <tc1=val> <tc2=val>
+ <noisy=0|1>

Example of class initialization as a simple resistor:

::SpiceGenTcl::Ngspice::BasicDevices::Resistor new 1 netp netm -r 1e3 -tc1 1 -ac 1e6 -temp {temp_amb -eq}

Behavioral resistor:

RXXXXXXX n+ n- R={expression} <tc1=value> <tc2=value> <noisy=0>

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::Resistor new 1 netp netm -r "V(a)+V(b)+pow(V(c),2)" -beh -tc1 1

Resistor with model card:

RXXXXXXX n+ n- <value> <mname> <l=length> <w=width>
+ <temp=val> <dtemp=val> <m=val> <ac=val> <scale=val>
+ <noisy=0|1>

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::Resistor new 1 netp netm -model resm -l 1e-6 -w 10e-6
method constructor {name npNode nmNode args} {

    # Creates object of class `Resistor` that describes resistor.
    #  name - name of the device without first-letter designator R
    #  npNode - name of node connected to positive pin
    #  nmNode - name of node connected to negative pin
    #  args - keyword instance parameters
    # Resistor type could be specified with additional switches: `-beh` if we
    # want to model circuit's variable dependent resistor, or `-model modelName`
    # if we want to simulate resistor with model card.
    # Simple resistor:
    # ```
    # RXXXXXXX n+ n- <resistance|r=>value <ac=val> <m=val>
    # + <scale=val> <temp=val> <dtemp=val> <tc1=val> <tc2=val>
    # + <noisy=0|1>
    # ```
    # Example of class initialization as a simple resistor:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::Resistor new 1 netp netm -r 1e3 -tc1 1 -ac 1e6 -temp {temp_amb -eq}
    # ```
    # Behavioral resistor:
    # ```
    # RXXXXXXX n+ n- R={expression} <tc1=value> <tc2=value> <noisy=0>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::Resistor new 1 netp netm -r "V(a)+V(b)+pow(V(c),2)" -beh -tc1 1
    # ```
    # Resistor with model card:
    # ```
    # RXXXXXXX n+ n- <value> <mname> <l=length> <w=width>
    # + <temp=val> <dtemp=val> <m=val> <ac=val> <scale=val>
    # + <noisy=0|1>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::Resistor new 1 netp netm -model resm -l 1e-6 -w 10e-6
    # ```
    # Synopsis: name npNode nmNode -r value ?-tc1 value? ?-tc2 value? ?-ac value? ?-m value? ?-noisy 0|1?
    #   ?-temp value|-dtemp value? ?-scale value?
    # Synopsis: name npNode nmNode -beh -r value ?-tc1 value? ?-tc2 value?
    # Synopsis: name npNode nmNode -model value ?-r value? ?-l value? ?-w value? ?-temp value|-dtemp value?
    #   ?-m value? ?-noisy 0|1? ?-ac value? ?scale value?
    set arguments [argparse -inline {
        -r=
        {-beh -forbid {model} -require {r}}
        {-model= -forbid {beh}}
        {-ac= -forbid {model beh}}
        {-m= -forbid {beh}}
        {-scale= -forbid {beh}}
        {-temp= -forbid {beh dtemp}}
        {-dtemp= -forbid {beh temp}}
        {-tc1= -forbid {model}}
        {-tc2= -forbid {model}}
        {-noisy= -enum {0 1}}
        {-l= -require {model}}
        {-w= -require {model}}
    }]
    set params ""
    if {[dexist $arguments r]} {
        set rVal [dget $arguments r]
        if {[dexist $arguments beh]} {
            lappend params "r $rVal -eq"
        } elseif {([llength $rVal]>1) && ([@ $rVal 1]=="-eq")} {
            lappend params "r [@ $rVal 0] -poseq"
        } else {
            lappend params "r $rVal -pos"
        }
    } elseif {[dexist $arguments model]==0} {
        return -code error "Resistor value must be specified with '-r value'"
    }
    if {[dexist $arguments model]} {
        lappend params "model [dget $arguments model] -posnocheck"
    }
    dict for {paramName value} $arguments {
        if {$paramName ni {r beh model}} {
            lappend params "$paramName $value"
        }
    }
    next r$name [list "np $npNode" "nm $nmNode"] $params
}

RModel [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Model.addParam
argsPreprocessSee ::SpiceGenTcl::KeyArgsBuilder.argsPreprocess
buildArgStrSee ::SpiceGenTcl::KeyArgsBuilder.buildArgStr
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Model.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Model.genSPICEString
getParamsSee ::SpiceGenTcl::Model.getParams
setParamValueSee ::SpiceGenTcl::Model.setParamValue
Properties

Readable: -name, -type

Writable: -name, -type

Superclasses

::SpiceGenTcl::Model

Mixins

::SpiceGenTcl::KeyArgsBuilder

constructor [::SpiceGenTcl::Ngspice::BasicDevices::RModel]RModel, Top, Main, Index

Creates object of class RModel that describes semiconductor resistor model.

OBJECT constructor name ?-option value ...?
Parameters
nameName of the model.
argsKeyword instance parameters.
Description

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::RModel new resmod -tc1 1 -tc2 2
method constructor {name args} {

    # Creates object of class `RModel` that describes semiconductor resistor model.
    #  name - name of the model
    #  args - keyword instance parameters
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::RModel new resmod -tc1 1 -tc2 2
    # ```
    # Synopsis: name ?-option value ...?
    set paramsNames [list tc1 tc2 rsh defw narrow short tnom kf af wf lf ef {r res}]
    next $name r [my argsPreprocess $paramsNames {*}$args]
}

SubcircuitInstance [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Device

Subclasses

X

constructor [::SpiceGenTcl::Ngspice::BasicDevices::SubcircuitInstance]SubcircuitInstance, Top, Main, Index

Creates object of class SubcircuitInstance that describes subcircuit instance.

SubcircuitInstance create OBJNAME name pins subName params
SubcircuitInstance new name pins subName params
Parameters
nameName of the device without first-letter designator X.
pinsList of pins {{pinName nodeName} {pinName nodeName} ...}
subNameName of subcircuit definition.
params{{paramName paramValue ?-eq?} {paramName paramValue ?-eq?}}
Description
XYYYYYYY N1 <N2 N3 ...> SUBNAM

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::SubcircuitInstance new 1 {{plus net1} {minus net2}} rcnet {{r 1} {c cpar -eq}}
method constructor {name pins subName params} {

    # Creates object of class `SubcircuitInstance` that describes subcircuit instance.
    #  name - name of the device without first-letter designator X
    #  pins - list of pins {{pinName nodeName} {pinName nodeName} ...}
    #  subName - name of subcircuit definition
    #  params - {{paramName paramValue ?-eq?} {paramName paramValue ?-eq?}}
    # ```
    # XYYYYYYY N1 <N2 N3 ...> SUBNAM
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::SubcircuitInstance new 1 {{plus net1} {minus net2}} rcnet {{r 1} {c cpar -eq}}
    # ```
    set params [linsert $params 0 "model $subName -posnocheck"]
    next x$name $pins $params
}

SubcircuitInstanceAuto [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Device

Subclasses

XAuto

constructor [::SpiceGenTcl::Ngspice::BasicDevices::SubcircuitInstanceAuto]SubcircuitInstanceAuto, Top, Main, Index

Creates object of class SubcircuitInstanceAuto that describes subcircuit instance with already created subcircuit definition object.

OBJECT constructor subcktObj name nodes ?-paramName paramValue ?-eq? ...?
Parameters
subcktObjObject of subcircuit that defines it's pins, subName and parameters.
nameNot documented.
nodesList of nodes connected to pins in the same order as pins in subcircuit definition {nodeName1 nodeName2 ...}
argsParameters as argument in form : -paramName {paramValue ?-eq?} -paramName {paramValue ?-eq?}
Description
XYYYYYYY N1 <N2 N3 ...> SUBNAM

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::SubcircuitInstanceAuto new $subcktObj 1 {net1 net2} -r 1 -c {cpar -eq}
method constructor {subcktObj name nodes args} {

    # Creates object of class `SubcircuitInstanceAuto` that describes subcircuit instance with already created
    # subcircuit definition object.
    #  subcktObj - object of subcircuit that defines it's pins, subName and parameters
    #  nodes - list of nodes connected to pins in the same order as pins in subcircuit definition
    #   {nodeName1 nodeName2 ...}
    #  args - parameters as argument in form : -paramName {paramValue ?-eq?} -paramName {paramValue ?-eq?}
    # ```
    # XYYYYYYY N1 <N2 N3 ...> SUBNAM
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::SubcircuitInstanceAuto new $subcktObj 1 {net1 net2} -r 1 -c {cpar -eq}
    # ```
    # Synopsis: subcktObj name nodes ?-paramName {paramValue ?-eq?} ...?

    # check that inputs object class is Subcircuit
    if {[info object class $subcktObj "::SpiceGenTcl::Subcircuit"]!=1} {
        set objClass [info object class $subcktObj]
        return -code error "Wrong object class '$objClass' is passed as subcktObj, should be '::SpiceGenTcl::Subcircuit'"
    }
    # get name of subcircuit
    set subName [$subcktObj configure -name]
    # get pins names of subcircuit
    set pinsNames [dict keys [$subcktObj getPins]]
    # check if number of pins in subcircuit definition matchs the number of supplied nodes
    if {[llength $pinsNames]!=[llength $nodes]} {
        return -code error "Wrong number of nodes '[llength $nodes]' in definition, should be '[llength $pinsNames]'"
    }
    # create list of pins and connected nodes
    foreach pinName $pinsNames node $nodes {
        lappend pinsList "$pinName $node"
    }
    # get parameters names of subcircuit
    set paramsNames [dict keys [$subcktObj getParams]]
    foreach paramName $paramsNames {
        lappend paramDefList "-${paramName}="
    }
    if {[info exists paramDefList]} {
        # create definition for argparse module for passing parameters as optional arguments
        set arguments [argparse -inline "
            [join $paramDefList \n]
        "]
        # create list of parameters and values from which were supplied by args
        dict for {paramName value} $arguments {
            lappend params "$paramName $value"
        }
    } else {
        set params ""
    }
    set params [linsert $params 0 "model $subName -posnocheck"]
    next x$name $pinsList $params
}

VSw [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

VSwitch

VSwitch [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Common::BasicDevices::VSwitch

Subclasses

VSw

VSwitchModel [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Model.addParam
argsPreprocessSee ::SpiceGenTcl::KeyArgsBuilder.argsPreprocess
buildArgStrSee ::SpiceGenTcl::KeyArgsBuilder.buildArgStr
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Model.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Model.genSPICEString
getParamsSee ::SpiceGenTcl::Model.getParams
setParamValueSee ::SpiceGenTcl::Model.setParamValue
Properties

Readable: -name, -type

Writable: -name, -type

Superclasses

::SpiceGenTcl::Model

Mixins

::SpiceGenTcl::KeyArgsBuilder

constructor [::SpiceGenTcl::Ngspice::BasicDevices::VSwitchModel]VSwitchModel, Top, Main, Index

Creates object of class VSwitchModel that describes voltage switch model.

OBJECT constructor name ?-option value ...?
Parameters
nameName of the model.
argsKeyword instance parameters.
Description

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::VSwitchModel new swmod -vt 1 -vh 0.5 -ron 1 -roff 1e6
method constructor {name args} {

    # Creates object of class `VSwitchModel` that describes voltage switch model.
    #  name - name of the model
    #  args - keyword instance parameters
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::VSwitchModel new swmod -vt 1 -vh 0.5 -ron 1 -roff 1e6
    # ```
    # Synopsis: name ?-option value ...?
    set paramsNames [list vt vh ron roff]
    next $name sw [my argsPreprocess $paramsNames {*}$args]
}

W [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

CSwitch

X [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

SubcircuitInstance

XAuto [::SpiceGenTcl::Ngspice::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -name

Writable: -name

Superclasses

SubcircuitInstanceAuto