Tcl SpiceGenTcl package (v0.71)

::SpiceGenTcl::Xyce::BasicDevicesTop, Main, Index

ClassesTop, Main, Index

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

Method summary
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

Capacitor

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

Method summary
constructorConstructor for the class.
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Device

Subclasses

C

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

Creates object of class Capacitor that describes capacitor.

OBJECT constructor name np nm -c value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value? ?-ic value? ?-age value? ?-d value?
OBJECT constructor name np nm -beh -c value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value? ?-ic value? ?-age value? ?-d value?
OBJECT constructor name np nm -beh -q value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value? ?-ic value? ?-age value? ?-d value?
OBJECT constructor name np nm -model value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value? ?-ic value? ?-age value? ?-d value? ?-l value? ?-w value?
Details
Parameters
-ageAging coefficient, optional.
-behSelects behavioural type of capacitor, optional.
-cCapacitance value or equation.
-dAging coefficient, optional.
-icInitial voltage on capacitor, optional.
-lLength of semiconductor capacitor, optional.
-mMultiplier value, optional.
-modelModel of the capacitor, optional.
-qCharge equation.
-tc1Linear thermal coefficient, optional.
-tc2Quadratic thermal coefficient, optional.
-tempDevice temperature, optional.
-wWidth of semiconductor capacitor, optional.
nameName of the device without first-letter designator C.
nmName of node connected to negative pin.
npName of node connected to positive pin.
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:

C<device name> <(+) node> <(-) node> <value> [device parameters]

Example of class initialization as a simple capacitor:

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

Behavioral capacitor with C expression:

C<device name> <(+) node> <(-) node> C={expression} [device parameters]

Example of class initialization:

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

Behavioral capacitor with Q expression:

C<device name> <(+) node> <(-) node> Q={expression} [device parameters]

Example of class initialization:

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

Capacitor with model card:

C<device name> <(+) node> <(-) node> <model name> [value] [device parameters]

Example of class initialization:

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

    # Creates object of class `Capacitor` that describes capacitor.
    #  name - name of the device without first-letter designator C
    #  np - name of node connected to positive pin
    #  nm - name of node connected to negative pin
    #  -c - capacitance value or equation
    #  -q - charge equation
    #  -beh - selects behavioural type of capacitor, optional
    #  -model - model of the capacitor, optional
    #  -m - multiplier value, optional
    #  -temp - device temperature, optional
    #  -tc1 - linear thermal coefficient, optional
    #  -tc2 - quadratic thermal coefficient, optional
    #  -ic - initial voltage on capacitor, optional
    #  -age - aging coefficient, optional
    #  -d - aging coefficient, optional
    #  -l - length of semiconductor capacitor, optional
    #  -w - width of semiconductor capacitor, optional
    # 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:
    # ```
    # C<device name> <(+) node> <(-) node> <value> [device parameters]
    # ```
    # Example of class initialization as a simple capacitor:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::Capacitor new 1 netp netm 1e-6 -tc1 1 -temp {-eq temp}
    # ```
    # Behavioral capacitor with C expression:
    # ```
    # C<device name> <(+) node> <(-) node> C={expression} [device parameters]
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::Capacitor new 1 netp netm -c "V(a)+V(b)+pow(V(c),2)" -beh -tc1 1
    # ```
    # Behavioral capacitor with Q expression:
    # ```
    # C<device name> <(+) node> <(-) node> Q={expression} [device parameters]
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::Capacitor new 1 netp netm -q "V(a)+V(b)+pow(V(c),2)" -beh -tc1 1
    # ```
    # Capacitor with model card:
    # ```
    # C<device name> <(+) node> <(-) node> <model name> [value] [device parameters]
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::Capacitor new 1 netp netm -model capm -l 1e-6 -w 10e-6
    # ```
    # Synopsis: name np nm -c value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value? ?-ic value?
    #   ?-age value? ?-d value?
    # Synopsis: name np nm -beh -c value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value? ?-ic value?
    #   ?-age value? ?-d value?
    # Synopsis: name np nm -beh -q value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value? ?-ic value?
    #   ?-age value? ?-d value?
    # Synopsis: name np nm -model value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value? ?-ic value?
    #   ?-age value? ?-d value? ?-l value? ?-w value?
    set arguments [argparse -inline -pfirst -help {Creates object of class 'Capacitor' that describes capacitor} {
        {-c= -forbid q -help {Capacitance value or equation}}
        {-q= -require beh -forbid {c model} -help {Charge equation}}
        {-beh -forbid model -help {Selects behavioural type of capacitor}}
        {-model= -forbid beh -help {Model of the capacitor}}
        {-m= -help {Multiplier value}}
        {-temp= -help {Device temperature}}
        {-tc1= -help {Linear thermal coefficient}}
        {-tc2= -help {Quadratic thermal coefficient}}
        {-ic= -help {Initial voltage on capacitor}}
        {-age= -help {Aging coefficient}}
        {-d= -help {Aging coefficient}}
        {-l= -require model -help {Length of semiconductor capacitor}}
        {-w= -require model -help {Width of semiconductor capacitor}}
        {name -help {Name of the device without first-letter designator}}
        {np -help {Name of node connected to positive pin}}
        {nm -help {Name of node connected to negative pin}}
    }]
    if {[dexist $arguments model]} {
        lappend params [list -posnocheck model [dget $arguments model]]
    }
    if {[dexist $arguments c]} {
        set cVal [dget $arguments c]
        if {[dexist $arguments beh]} {
            lappend params [list -eq c $cVal]
        } elseif {([llength $cVal]>1) && ([@ $cVal 0] eq {-eq})} {
            lappend params [list -poseq c [@ $cVal 1]]
        } else {
            lappend params [list -pos c $cVal]
        }
    } elseif {![dexist $arguments model] && ![dexist $arguments q]} {
        return -code error {Capacitor value must be specified with '-c value'}
    }
    if {[dexist $arguments q]} {
        set qVal [dget $arguments q]
        lappend params [list -eq q $qVal]
    }
    dict for {paramName value} $arguments {
        if {$paramName ni {c q beh model name np nm}} {
            if {[@ $value 0] eq {-eq}} {
                lappend params [list -eq $paramName [@ $value 1]]
            } else {
                lappend params [list $paramName $value]
            }
        }
    }
    next c[dget $arguments name] [list [list np [dget $arguments np]] [list nm [dget $arguments nm]]] $params
}

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

Method summary
constructorConstructor for the class.
actOnParamSee ::SpiceGenTcl::Model.actOnParam
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Model.genSPICEString
Properties

Readable: -name, -type

Writable: -name, -type

Superclasses

::SpiceGenTcl::Model

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

Creates object of class CModel that describes semiconductor capacitor model.

OBJECT constructor name ?-option value ...?
Details
Parameters
argsKeyword instance parameters, for details please refer to Xyce reference manual, 2.3.4 section.
nameName of the model.
Description

Example of class initialization:

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

    # Creates object of class `CModel` that describes semiconductor capacitor model.
    #  name - name of the model
    #  args - keyword instance parameters, for details please refer to Xyce reference manual, 2.3.4 section.
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::CModel new capmod -tc1 1 -tc2 2
    # ```
    # Synopsis: name ?-option value ...?
    next {*}[my ArgsPreprocess {c cj cjsw defw narrow tc1 tc2 tnom} {name type} type {*}[linsert $args 1 c]]
}

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

Method summary
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

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

Subclasses

W

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

Method summary
constructorConstructor for the class.
actOnParamSee ::SpiceGenTcl::Model.actOnParam
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Model.genSPICEString
Properties

Readable: -name, -type

Writable: -name, -type

Superclasses

::SpiceGenTcl::Model

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

Creates object of class CSwitchModel that describes current switch model.

OBJECT constructor name ?-option value ...?
Details
Parameters
argsKeyword instance parameters, for details please refer to Xyce reference manual, 2.3.22 section.
nameName of the model.
Description

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::CSwitchModel new cswmod -ion 1 -ioff 0.5 -ron 1 -roff 1e6
method constructor {args} {

    # Creates object of class `CSwitchModel` that describes current switch model.
    #  name - name of the model
    #  args - keyword instance parameters, for details please refer to Xyce reference manual, 2.3.22 section.
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::CSwitchModel new cswmod -ion 1 -ioff 0.5 -ron 1 -roff 1e6
    # ```
    # Synopsis: name ?-option value ...?
    next {*}[my ArgsPreprocess {ioff ion off on roff ron} {name type} type {*}[linsert $args 1 iswitch]]
}

GenS [::SpiceGenTcl::Xyce::BasicDevices]Top, Main, Index

Method summary
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

GenSwitch

GenSwitch [::SpiceGenTcl::Xyce::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Device

Subclasses

GenS

constructor [::SpiceGenTcl::Xyce::BasicDevices::GenSwitch]GenSwitch, Top, Main, Index

Creates object of class GenSwitch that describes generic switch device.

OBJECT constructor name np nm -model value -control value ?-on|off?
Details
Parameters
-controlControl equation.
-modelModel name.
-on/-offInitial state of switch.
nameName of the device without first-letter designator S.
nmName of node connected to negative pin.
npName of node connected to positive pin.
Description
S<name> <(+) switch node> <(-) switch node> <model name> [ON] [OFF] <control = =ession>

Example of class initialization:

::SpiceGenTcl::Xyce::BasicDevices::GenSwitch new 1 net1 0 -model sw1 -control {I(VMON)}
method constructor {args} {

    # Creates object of class `GenSwitch` that describes generic switch device.
    #  name - name of the device without first-letter designator S
    #  np - name of node connected to positive pin
    #  nm - name of node connected to negative pin
    #  -model - model name
    #  -control - control equation
    #  -on/-off - initial state of switch
    # ```
    # S<name> <(+) switch node> <(-) switch node> <model name> [ON] [OFF] <control = =ession>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::GenSwitch new 1 net1 0 -model sw1 -control {I(VMON)}
    # ```
    # Synopsis: name np nm -model value -control value ?-on|off?
    set arguments [argparse -inline -pfirst -help {Creates object of class 'GenSwitch' that describes generic switch device} {
        {-model= -required -help {Model name}}
        {-control= -required -help {Control equation}}
        {-on -forbid {off} -help {Initial on state of switch}}
        {-off -forbid {on} -help {Initial off state of switch}}
        {name -help {Name of the device without first-letter designator}}
        {np -help {Name of node connected to positive pin}}
        {nm -help {Name of node connected to negative pin}}
    }]
    lappend params [list -posnocheck model [dget $arguments model]]
    if {[dexist $arguments on]} {
        lappend params {-sw on}
    } elseif {[dexist $arguments off]} {
        lappend params {-sw off}
    }
    lappend params [list -eq control [dget $arguments control]]
    next s[dget $arguments name] [list [list np [dget $arguments np]] [list nm [dget $arguments nm]]] $params
}

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

Method summary
constructorConstructor for the class.
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Device

Subclasses

L

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

Creates object of class Inductor that describes inductor.

OBJECT constructor name np nm -l value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value? ?-ic value?
OBJECT constructor name np nm -model value -l value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value? ?-ic value?
Details
Parameters
-icInitial current through inductor, optional.
-lInductance value.
-mMultiplier value, optional.
-modelModel of the inductor, optional.
-tc1Linear thermal coefficient, optional.
-tc2Quadratic thermal coefficient, optional.
-tempDevice temperature, optional.
nameName of the device without first-letter designator L.
nmName of node connected to negative pin.
npName of node connected to positive pin.
Description

Inductor type could be specified with additional switch -model modelName if we want to simulate inductor with model card. Simple inductor:

L<name> <(+) node> <(-) node> <value> [device parameters]

Example of class initialization as a simple inductor:

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

Inductor with model card:

L<name> <(+) node> <(-) node> [model] <value> [device parameters]

Example of class initialization:

::SpiceGenTcl::Xyce::BasicDevices::Inductor new 1 netp netm -l 1e-6 -model indm
method constructor {args} {

    # Creates object of class `Inductor` that describes inductor.
    #  name - name of the device without first-letter designator L
    #  np - name of node connected to positive pin
    #  nm - name of node connected to negative pin
    #  -l - inductance value
    #  -model - model of the inductor, optional
    #  -m - multiplier value, optional
    #  -temp - device temperature, optional
    #  -tc1 - linear thermal coefficient, optional
    #  -tc2 - quadratic thermal coefficient, optional
    #  -ic - initial current through inductor, optional
    # Inductor type could be specified with additional switch `-model modelName`
    # if we want to simulate inductor with model card.
    # Simple inductor:
    # ```
    # L<name> <(+) node> <(-) node> <value> [device parameters]
    # ```
    # Example of class initialization as a simple inductor:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::Inductor new 1 netp netm -l 1e-6 -tc1 1 -temp {-eq temp}
    # ```
    # Inductor with model card:
    # ```
    # L<name> <(+) node> <(-) node> [model] <value> [device parameters]
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::Inductor new 1 netp netm -l 1e-6 -model indm
    # ```
    # Synopsis: name np nm -l value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value? ?-ic value?
    # Synopsis: name np nm -model value -l value ?-tc1 value? ?-tc2 value? ?-m value? ?-temp value?
    #   ?-ic value?
    set arguments [argparse -inline -pfirst -help {Creates object of class 'Capacitor' that describes capacitor} {
        {-l= -required -help {Inductance value}}
        {-model= -help {Model of the inductor}}
        {-m= -help {Multiplier value}}
        {-temp= -help {Device temperature}}
        {-tc1= -help {Linear thermal coefficient}}
        {-tc2= -help {Quadratic thermal coefficient}}
        {-ic= -help {Initial current through inductor}}
        {name -help {Name of the device without first-letter designator}}
        {np -help {Name of node connected to positive pin}}
        {nm -help {Name of node connected to negative pin}}
    }]
    if {[dexist $arguments model]} {
        lappend params [list -posnocheck model [dget $arguments model]]
    }
    set lVal [dget $arguments l]
    if {([llength $lVal]>1) && ([@ $lVal 0] eq {-eq})} {
        lappend params [list -poseq l [@ $lVal 1]]
    } else {
        lappend params [list -pos l $lVal]
    }
    dict for {paramName value} $arguments {
        if {$paramName ni {l model name np nm}} {
            if {[@ $value 0] eq {-eq}} {
                lappend params [list -eq $paramName [@ $value 1]]
            } else {
                lappend params [list $paramName $value]
            }
        }
    }
    next l[dget $arguments name] [list [list np [dget $arguments np]] [list nm [dget $arguments nm]]] $params
}

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

Method summary
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

Inductor

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

Method summary
constructorConstructor for the class.
actOnParamSee ::SpiceGenTcl::Model.actOnParam
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Model.genSPICEString
Properties

Readable: -name, -type

Writable: -name, -type

Superclasses

::SpiceGenTcl::Model

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

Creates object of class LModel that describes inductor model.

OBJECT constructor name ?-option value ...?
Details
Parameters
argsKeyword instance parameters, for details please refer to Xyce reference manual, 2.3.5 section.
nameName of the model.
Description

Example of class initialization:

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

    # Creates object of class `LModel` that describes inductor model.
    #  name - name of the model
    #  args - keyword instance parameters, for details please refer to Xyce reference manual, 2.3.5 section.
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::LModel new indmod -tc1 1 -tc2 2
    # ```
    # Synopsis: name ?-option value ...?
    next {*}[my ArgsPreprocess {ic l tc1 tc2 tnom} {name type} type {*}[linsert $args 1 l]]
}

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

Method summary
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

Resistor

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

Method summary
constructorConstructor for the class.
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Device

Subclasses

R

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

Creates object of class Resistor that describes resistor.

OBJECT constructor name np nm -r value ?-tc1 value? ?-tc2 value? ?-tce value? ?-m value? ?-temp value?
OBJECT constructor name np nm -r value -beh ?-tc1 value? ?-tc2 value? ?-tce value? ?-m value? ?-temp value?
OBJECT constructor name np nm -r value -model ?-tc1 value? ?-tc2 value? ?-tce value? ?-m value? ?-temp value? ?-l value? ?-w value?
Details
Parameters
-behSelects behavioural type of resistor, optional.
-lLength of semiconductor resistor, optional.
-mMultiplier value, optional.
-modelModel of the resistor, optional.
-rResistance value or equation.
-tc1Linear thermal coefficient, optional.
-tc2Quadratic thermal coefficient, optional.
-tceExponential thermal coefficient, optional.
-tempDevice temperature, optional.
-wWidth of semiconductor resistor, optional.
nameName of the device without first-letter designator R.
nmName of node connected to negative pin.
npName of node connected to positive pin.
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:

R<name> <(+) node> <(-) node> <value> [device parameters]

Example of class initialization as a simple resistor:

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

Behavioral resistor:

R<name> <(+) node> <(-) node> R ={expression} [device parameters]

Example of class initialization:

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

Resistor with model card:

R<name> <(+) node> <(-) node> <model name> [value] [device parameters]

Example of class initialization:

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

    # Creates object of class `Resistor` that describes resistor.
    #  name - name of the device without first-letter designator R
    #  np - name of node connected to positive pin
    #  nm - name of node connected to negative pin
    #  -r - resistance value or equation
    #  -beh - selects behavioural type of resistor, optional
    #  -model - model of the resistor, optional
    #  -m - multiplier value, optional
    #  -temp - device temperature, optional
    #  -tc1 - linear thermal coefficient, optional
    #  -tc2 - quadratic thermal coefficient, optional
    #  -tce - exponential thermal coefficient, optional
    #  -l - length of semiconductor resistor, optional
    #  -w - width of semiconductor resistor, optional
    # 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:
    # ```
    # R<name> <(+) node> <(-) node> <value> [device parameters]
    # ```
    # Example of class initialization as a simple resistor:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::Resistor new 1 netp netm -r 1e3 -tc1 1 -temp {-eq temp_amb}
    # ```
    # Behavioral resistor:
    # ```
    # R<name> <(+) node> <(-) node> R ={expression} [device parameters]
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::Resistor new 1 netp netm -r "V(a)+V(b)+pow(V(c),2)" -beh -tc1 1
    # ```
    # Resistor with model card:
    # ```
    # R<name> <(+) node> <(-) node> <model name> [value] [device parameters]
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::Resistor new 1 netp netm -model resm -l 1e-6 -w 10e-6
    # ```
    # Synopsis: name np nm -r value ?-tc1 value? ?-tc2 value? ?-tce value? ?-m value? ?-temp value?
    # Synopsis: name np nm -r value -beh ?-tc1 value? ?-tc2 value? ?-tce value? ?-m value? ?-temp value?
    # Synopsis: name np nm -r value -model ?-tc1 value? ?-tc2 value? ?-tce value? ?-m value? ?-temp value?
    #   ?-l value? ?-w value?
    set arguments [argparse -inline -pfirst -help {Creates object of class 'Resistor' that describes resistor} {
        {-r= -help {Resistance value or equation}}
        {-beh -forbid model -require r -help {Selects behavioural type of resistor}}
        {-model= -forbid beh -help {Model of the resistor}}
        {-m= -help {Multiplier value}}
        {-temp= -help {Device temperature}}
        {-tc1= -help {Linear thermal coefficient}}
        {-tc2= -help {Quadratic thermal coefficient}}
        {-tce= -help {Exponential thermal coefficient}}
        {-l= -require model -help {Length of semiconductor resistor}}
        {-w= -require model -help {Width of semiconductor resistor}}
        {name -help {Name of the device without first-letter designator}}
        {np -help {Name of node connected to positive pin}}
        {nm -help {Name of node connected to negative pin}}
    }]
    if {[dexist $arguments model]} {
        lappend params [list -posnocheck model [dget $arguments model]]
    }
    if {[dexist $arguments r]} {
        set rVal [dget $arguments r]
        if {[dexist $arguments beh]} {
            lappend params [list -eq r $rVal]
        } elseif {([llength $rVal]>1) && ([@ $rVal 0] eq {-eq})} {
            lappend params [list -poseq r [@ $rVal 1]]
        } else {
            lappend params [list -pos r $rVal]
        }
    } elseif {![dexist $arguments model]} {
        return -code error {Resistor value must be specified with '-r value'}
    }
    dict for {paramName value} $arguments {
        if {$paramName ni {r beh model name np nm}} {
            if {[@ $value 0] eq {-eq}} {
                lappend params [list -eq $paramName [@ $value 1]]
            } else {
                lappend params [list $paramName $value]
            }
        }
    }
    next r[dget $arguments name] [list [list np [dget $arguments np]] [list nm [dget $arguments nm]]] $params
}

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

Method summary
constructorConstructor for the class.
actOnParamSee ::SpiceGenTcl::Model.actOnParam
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Model.genSPICEString
Properties

Readable: -name, -type

Writable: -name, -type

Superclasses

::SpiceGenTcl::Model

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

Creates object of class RModel that describes semiconductor resistor model.

OBJECT constructor name ?-option value ...?
Details
Parameters
argsKeyword instance parameters, for details please refer to Xyce reference manual, 2.3.7 section.
nameName of the model.
Description

Example of class initialization:

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

    # Creates object of class `RModel` that describes semiconductor resistor model.
    #  name - name of the model
    #  args - keyword instance parameters, for details please refer to Xyce reference manual, 2.3.7 section.
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::RModel new resmod -tc1 1 -tc2 2
    # ```
    # Synopsis: name ?-option value ...?
    next {*}[my ArgsPreprocess {defw narrow r rsh tc1 tc2 tce tnom} {name type} type {*}[linsert $args 1 r]]
}

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

Method summary
constructorConstructor for the class.
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Device

Subclasses

X

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

Creates object of class SubcircuitInstance that describes subcircuit instance.

SubcircuitInstance create OBJNAME ?args?
SubcircuitInstance new ?args?
Details
Parameters
nameName of the device without first-letter designator X.
params{{?-eq? paramName paramValue} {?-eq? paramName paramValue}}
pinsList of pins {{pinName nodeName} {pinName nodeName} ...}
subNameName of subcircuit definition.
Description
X<name> [nodes] <subcircuit name> [PARAMS: [<name> = <value>] ...]

Example of class initialization:

::SpiceGenTcl::Xyce::BasicDevices::SubcircuitInstance new 1 {{plus net1} {minus net2}} rcnet {{r 1} {-eq c cpar}}

#nagelfar implicitvarcmd {argparse Creates object of class 'SubcircuitInstance'} name pins subName params

method constructor {args} {

    # 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 - {{?-eq? paramName paramValue} {?-eq? paramName paramValue}}
    # ```
    # X<name> [nodes] <subcircuit name> [PARAMS: [<name> = <value>] ...]
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::SubcircuitInstance new 1 {{plus net1} {minus net2}} rcnet {{r 1} {-eq c cpar}}
    # ```
    ##nagelfar implicitvarcmd {argparse *Creates object of class 'SubcircuitInstance'*} name pins subName params
    argparse -pfirst -help {Creates object of class 'SubcircuitInstance' that describes subcircuit instance} {
        {name -help {Name of the device without first-letter designator}}
        {pins -help {List of pins {{pinName nodeName} {pinName nodeName} ...}}}
        {subName -help {Name of subcircuit definition}}
        {params -help {List of parameters {{?-eq? paramName paramValue} {?-eq? paramName paramValue}}}}
    }
    set params [linsert [linsert $params 0 [list -posnocheck model $subName]] 1 {-posnocheck params PARAMS:}]
    next x$name $pins $params
}

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

Method summary
constructorConstructor for the class.
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

::SpiceGenTcl::Device

Subclasses

XAuto

constructor [::SpiceGenTcl::Xyce::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 ?-eq? paramValue ...?
Details
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 {?-eq? paramValue} -paramName {?-eq? paramValue}
Description
X<name> [nodes] <subcircuit name> [PARAMS: [<name> = <value>] ...]

Example of class initialization:

::SpiceGenTcl::Xyce::BasicDevices::SubcircuitInstanceAuto new $subcktObj 1 {net1 net2} -r 1 -c {-eq cpar}
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 {?-eq? paramValue} -paramName {?-eq? paramValue}
    # ```
    # X<name> [nodes] <subcircuit name> [PARAMS: [<name> = <value>] ...]
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Xyce::BasicDevices::SubcircuitInstanceAuto new $subcktObj 1 {net1 net2} -r 1 -c {-eq cpar}
    # ```
    # Synopsis: subcktObj name nodes ?-paramName {?-eq? paramValue} ...?

    # 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 actOnPin -get -all]]
    # 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 [list $pinName $node]
    }
    # get parameters names of subcircuit
    if {[$subcktObj actOnParam -get -all] ne {}} {
        set paramsNames [dict keys [$subcktObj actOnParam -get -all]]
        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 {
            if {[@ $value 0] eq {-eq}} {
                lappend params [list -eq $paramName [@ $value 1]]
            } else {
                lappend params [list $paramName $value]
            }
        }
    } else {
        set params {}
    }
    set params [linsert $params 0 [list -posnocheck model $subName]]
    if {[info exists paramDefList]} {
        set params [linsert $params 1 { -posnocheck params PARAMS:}]
    }
    next x$name $pinsList $params
}

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

Method summary
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

VSwitch

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

Method summary
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

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

Subclasses

VSw

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

Method summary
constructorConstructor for the class.
actOnParamSee ::SpiceGenTcl::Model.actOnParam
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Model.genSPICEString
Properties

Readable: -name, -type

Writable: -name, -type

Superclasses

::SpiceGenTcl::Model

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

Creates object of class VSwitchModel that describes voltage switch model.

OBJECT constructor name ?-option value ...?
Details
Parameters
argsKeyword instance parameters, for details please refer to Xyce reference manual, 2.3.22 section.
nameName of the model.
Description

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::VSwitchModel new swmod -von 1 -voff 0.5 -ron 1 -roff 1e6
method constructor {args} {

    # Creates object of class `VSwitchModel` that describes voltage switch model.
    #  name - name of the model
    #  args - keyword instance parameters, for details please refer to Xyce reference manual, 2.3.22 section.
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::VSwitchModel new swmod -von 1 -voff 0.5 -ron 1 -roff 1e6
    # ```
    # Synopsis: name ?-option value ...?
    next {*}[my ArgsPreprocess {off on roff ron voff von} {name type} type {*}[linsert $args 1 vswitch]]
}

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

Method summary
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

CSwitch

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

Method summary
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

SubcircuitInstance

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

Method summary
actOnParamSee ::SpiceGenTcl::Device.actOnParam
actOnPinSee ::SpiceGenTcl::Device.actOnPin
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
Properties

Readable: -name

Writable: -name

Superclasses

SubcircuitInstanceAuto