method constructor {args} {
# Creates object of class `Cccs` that describes linear current-controlled current source.# name - name of the device without first-letter designator F# np - name of node connected to positive pin# nm - name of node connected to negative pin# -consrc value - name of controlling source# -gain value - current gain# -m value - parallel source multiplicator# ```# FXXXXXXX N+ N- VNAM VALUE <m=val># ```# Example of class initialization:# ```# Cccs new 1 net1 0 netc 0 -consrc vc -gain 10 -m 1# ```# Synopsis: name np nm -consrc value -gain value ?-m value?set arguments [argparse -inline -pfirst -help {Creates object of class `Cccs` that describes linear current-controlled current source} {
{-consrc -required -help {Name of controlling source}}
{-gain -required -help {Current gain}}
{-m= -help {Parallel source multiplicator}}
{name -help {Name of the device without first-letter designator F}}
{np -help {Name of node connected to positive pin}}
{nm -help {Name of node connected to negative pin}}
}]
set consrcVal [dget $arguments consrc]
lappend params [list -posnocheck consrc $consrcVal]
set gainVal [dget $arguments gain]
if {([llength $gainVal]>1) && ([@ $gainVal 0] eq {-eq})} {
lappend params [list -poseq igain [@ $gainVal 1]]
} else {
lappend params [list -pos igain $gainVal]
}
dict for {paramName value} $arguments {
if {$paramName ni {consrc gain name np nm}} {
if {[@ $value 0] eq {-eq}} {
lappend params [list -eq $paramName [@ $value 1]]
} else {
lappend params [list $paramName $value]
}
}
}
next f[dget $arguments name] [my FormPinNodeList $arguments {np nm}] $params
}
method constructor {args} {
# Creates object of class `Ccvs` that describes linear current-controlled current source.# name - name of the device without first-letter designator H# np - name of node connected to positive pin# nm - name of node connected to negative pin# -consrc value - name of controlling source# -transr value - transresistance# ```# HXXXXXXX N+ N- VNAM VALUE# ```# Example of class initialization:# ```# Ccvs new 1 net1 0 -consrc vc -transr {-eq tres}# ```# Synopsis: name np nm -consrc value -transr valueset arguments [argparse -inline -pfirst -help {Creates object of class `Ccvs` that describes linear current-controlled current source} {
{-consrc -required -help {Name of controlling source}}
{-transr -required -help Transresistance}
{name -help {Name of the device without first-letter designator H}}
{np -help {Name of node connected to positive pin}}
{nm -help {Name of node connected to negative pin}}
}]
set consrcVal [dget $arguments consrc]
lappend params [list -posnocheck consrc $consrcVal]
set transrVal [dget $arguments transr]
if {([llength $transrVal]>1) && ([@ $transrVal 0] eq {-eq})} {
lappend params [list -poseq transr [@ $transrVal 1]]
} else {
lappend params [list -pos transr $transrVal]
}
next h[dget $arguments name] [my FormPinNodeList $arguments {np nm}] $params
}
method constructor {args} {
# Creates object of class `Iac` that describes ac current source.# name - name of the device without first-letter designator I# np - name of node connected to positive pin# nm - name of node connected to negative pin# -dc value - AC current value# -acphase value - phase of AC current# ```# IYYYYYYY n+ n- <AC<ACMAG<ACPHASE>>># ```# Example of class initialization:# ```# Iac new 1 netp netm -ac 10 -acphase 45# ```# Synopsis: name np nm -ac value ?-acphase value?next i {*}$args
}
method constructor {args} {
# Creates object of class `Idc` that describes simple constant current source.# name - name of the device without first-letter designator I# np - name of node connected to positive pin# nm - name of node connected to negative pin# -dc value - DC voltage value# ```# IYYYYYYY n+ n- <<DC> DC/TRAN VALUE>># ```# Example of class initialization:# ```# Idc new 1 netp netm -dc 10# ```# Synopsis: name np nm -dc valuenext i {*}$args
}
method constructor {args} {
# Creates object of class `Iexp` that describes exponential current source.# name - name of the device without first-letter designator I# np - name of node connected to positive pin# nm - name of node connected to negative pin# -i1 value - initial value# -i2 value - pulsed value# -td1 value - rise delay time# -tau1 value - rise time constant# -td2 value - fall delay time# -tau2 value - fall time constant# -dc value - DC value, optional# -ac value - AC value, optional# -acphase value - phase of AC signal, optional, requires `-ac`# ```# IYYYYYYY n+ n- EXP(V1 V2 TD1 TAU1 TD2 TAU2)# ```# Example of class initialization:# ```# Iexp new 1 net1 net2 -i1 0 -i2 1 -td1 1e-9 -tau1 1e-9 -td2 {-eq td2} -tau2 10e-6# ```# Synopsis: name np nm -i1 value -i2 value -td1 value -tau1 value -td2 value -tau2 value# ?-phase|phi value???next i {*}$args
}
method constructor {args} {
# Creates object of class `Ipulse` that describes pulse current source.# name - name of the device without first-letter designator I# np - name of node connected to positive pin# nm - name of node connected to negative pin# -low value - low value, aliases: `-voff`, `-ioff`# -high value - high value, aliases: `-von`, `-ion`# -td value - time delay# -tr value - rise time# -tf value - fall time# -pw value - width of pulse, alias `-ton`# -per value - period time, alias `-tper`# -dc value - DC value, optional# -ac value - AC value, optional# -acphase value - phase of AC signal, optional, requires `-ac`# ```# IYYYYYYY n+ n- PULSE(V1 V2 TD TR TF PW PER)# ```# Example of class initialization:# ```# Ipulse new 1 net1 net2 -low 0 -high 1 -td {-eq td} -tr 1e-9 -tf 1e-9 -pw 10e-6 -per 20e-6# ```# Synopsis: name np nm -voff|ioff|low value -von|ion|high value -td value -tr value -tf value# -pw|ton value ?-phase|phi value???next i {*}$args
}
method constructor {args} {
# Creates object of class `Ipwl` that describes piece-wise current source.# name - name of the device without first-letter designator I# np - name of node connected to positive pin# nm - name of node connected to negative pin# -seq list - sequence of pwl points in form `{t0 i0 t1 i1 t2 i2 t3 i3 ...}`# -dc value - DC value, optional# -ac value - AC value, optional# -acphase value - phase of AC signal, optional, requires `-ac`# ```# IYYYYYYY n+ n- PWL (T1 I1 <T2 I2 T3 I3 T4 I4 ...>)# ```# Example of class initialization:# ```# Ipwl new 1 np nm -seq {0 0 {-eq t1} 1 2 2 3 3 4 4}# ```# Synopsis: name np nm -seq list ?-phase|phi value???next i {*}$args
}
method constructor {args} {
# Creates object of class `Isffm` that describes single-frequency FM current source.# name - name of the device without first-letter designator I# np - name of node connected to positive pin# nm - name of node connected to negative pin# -i0 value - initial value, aliases: `-voff`, `-v0`, `-ioff`# -ia value - pulsed value, aliases: `-vamp`, `-va`, `-iamp`# -fc value - carrier frequency, alias `-fcar`# -mdi value - modulation index# -fs value - signal frequency, alias `-fsig`# -dc value - DC value, optional# -ac value - AC value, optional# -acphase value - phase of AC signal, optional, requires `-ac`# ```# IYYYYYYY n+ n- SFFM(VO VA FC MDI FS)# ```# Example of class initialization:# ```# Isin new 1 net1 net2 -i0 0 -ia 1 -fc {-eq freq} -mdi 0 -fs 1e3# ```# Synopsis: name np nm -i0|voff|ioff|v0 value -ia|vamp|iamp|va value -fc|fcar value -mdi value# -fs|fsig value ?-phi|phase value???next i {*}$args
}
method constructor {args} {
# Creates object of class `Isin` that describes sinusoidal current source.# name - name of the device without first-letter designator I# np - name of node connected to positive pin# nm - name of node connected to negative pin# -i0 value - DC shift value, aliases: `-voffset`, `-v0`, `-ioffset`# -ia value - amplitude value, aliases: `-vamp`, `-va`, `-iamp`# -freq value - frequency of sinusoidal signal# -td value - time delay, optional# -theta value - damping factor, optional, requires `-td`# -phase value - phase of signal, optional, requires `-td` and `-phase`, alias `-phi`# -dc value - DC value, optional# -ac value - AC value, optional# -acphase value - phase of AC signal, optional, requires `-ac`# ```# IYYYYYYY n+ n- SIN(VO VA FREQ TD THETA PHASE)# ```# Example of class initialization:# ```# Isin new 1 net1 net2 -i0 0 -ia 2 -freq {-eq freq} -td 1e-6 -theta {-eq theta}# ```# Synopsis: name np nm -i0|ioffset value -ia|iamp value -freq value ?-td value ?-theta value# ?-phase|phi value???next i {*}$args
}
method constructor {args} {
# Creates object of class `Vac` that describes ac voltage source.# name - name of the device without first-letter designator V# np - name of node connected to positive pin# nm - name of node connected to negative pin# -ac value - AC voltage value# -acphase value - phase of AC voltage# ```# VYYYYYYY n+ n- <AC<ACMAG<ACPHASE>>># ```# Example of class initialization:# ```# Vac new 1 netp netm -ac 10 -acphase 45# ```# Synopsis: name np nm -ac value ?-acphase value?next v {*}$args
}
method constructor {args} {
# Creates object of class `Vccs` that describes linear voltage-controlled current source.# name - name of the device without first-letter designator G# np - name of node connected to positive pin# nm - name of node connected to negative pin# ncp - name of node connected to positive controlling pin# ncm - name of node connected to negative controlling pin# -trcond value - transconductance# -m value - multiplier factor, optional# ```# GXXXXXXX N+ N- NC+ NC- VALUE <m=val># ```# Example of class initialization:# ```# Vccs new 1 net1 0 netc 0 -trcond 10 -m 1# ```# Synopsis: name np nm ncp ncm -trcond value ?-m value?set arguments [argparse -inline -pfirst -help {Creates object of class `Vccs` that describes linear voltage-controlled current source} {
{-trcond -required -help Transconductance}
{-m= -help {Multiplier factor}}
{name -help {Name of the device without first-letter designator G}}
{np -help {Name of node connected to positive pin}}
{nm -help {Name of node connected to negative pin}}
{ncp -help {Name of node connected to positive controlling pin}}
{ncm -help {Name of node connected to negative controlling pin}}
}]
set trcondVal [dget $arguments trcond]
if {([llength $trcondVal]>1) && ([@ $trcondVal 0] eq {-eq})} {
lappend params [list -poseq trcond [@ $trcondVal 1]]
} else {
lappend params [list -pos trcond $trcondVal]
}
dict for {paramName value} $arguments {
if {$paramName ni {trcond name np nm ncp ncm}} {
if {[@ $value 0] eq {-eq}} {
lappend params [list -eq $paramName [@ $value 1]]
} else {
lappend params [list $paramName $value]
}
}
}
next g[dget $arguments name] [my FormPinNodeList $arguments {np nm ncp ncm}] $params
}
method constructor {args} {
# Creates object of class `Vcvs` that describes linear voltage-controlled current source.# name - name of the device without first-letter designator E# np - name of node connected to positive pin# nm - name of node connected to negative pin# ncp - name of node connected to positive controlling pin# ncm - name of node connected to negative controlling pin# -gain value - voltage gain# ```# EXXXXXXX N+ N- NC+ NC- VALUE# ```# Example of class initialization:# ```# Vcvs new 1 net1 0 netc 0 -gain 10# ```# Synopsis: name np nm ncp ncm -gain valueset arguments [argparse -inline -pfirst -help {Creates object of class `Vcvs` that describes linear voltage-controlled current source} {
{-gain -required -help {Voltage gain}}
{name -help {Name of the device without first-letter designator E}}
{np -help {Name of node connected to positive pin}}
{nm -help {Name of node connected to negative pin}}
{ncp -help {Name of node connected to positive controlling pin}}
{ncm -help {Name of node connected to negative controlling pin}}
}]
set gainVal [dget $arguments gain]
if {([llength $gainVal]>1) && ([@ $gainVal 0] eq {-eq})} {
lappend params [list -poseq vgain [@ $gainVal 1]]
} else {
lappend params [list -pos vgain $gainVal]
}
next e[dget $arguments name] [my FormPinNodeList $arguments {np nm ncp ncm}] $params
}
method constructor {args} {
# Creates object of class `Vdc` that describes simple constant voltage source.# name - name of the device without first-letter designator V# np - name of node connected to positive pin# nm - name of node connected to negative pin# -dc value - DC voltage value# ```# VYYYYYYY n+ n- <<DC> DC/TRAN VALUE>># ```# Example of class initialization:# ```# Vdc new 1 netp netm -dc 10# ```# Synopsis: name np nm -dc valuenext v {*}$args
}
method constructor {args} {
# Creates object of class `Vexp` that describes exponential voltage source.# name - name of the device without first-letter designator V# np - name of node connected to positive pin# nm - name of node connected to negative pin# -v1 value - initial value# -v2 value - pulsed value# -td1 value - rise delay time# -tau1 value - rise time constant# -td2 value - fall delay time# -tau2 value - fall time constant# -dc value - DC value, optional# -ac value - AC value, optional# -acphase value - phase of AC signal, optional, requires `-ac`# ```# VYYYYYYY n+ n- EXP(V1 V2 TD1 TAU1 TD2 TAU2)# ```# Example of class initialization:# ```# Vexp new 1 net1 net2 -v1 0 -v2 1 -td1 1e-9 -tau1 1e-9 -td2 {-eq td2} -tau2 10e-6# ```# Synopsis: name np nm -i1|v1 value -i2|v2 value -td1 value -tau1 value -td2 value -tau2 value# ?-phi|phase value???next v {*}$args
}
Creates object of class Vpulse that describes pulse voltage source.
OBJECT constructorname np nm -voff|ioff|low value -von|ion|high value -td value -tr value -tf value -pw|ton value ?-dc value? ?-ac value ?-acphase value??
Parameters
-ac value
AC value, optional.
-acphase value
Phase of AC signal, optional, requires -ac
-dc value
DC value, optional.
-high value
High value, aliases: -von, -ion
-low value
Low value, aliases: -voff, -ioff
-td value
Time delay.
-tf value
Fall time.
-ton value
Width of pulse, alias -pw
-tper value
Period time, alias -per
-tr value
Rise time.
name
Name of the device without first-letter designator V.
method constructor {args} {
# Creates object of class `Vpulse` that describes pulse voltage source.# name - name of the device without first-letter designator V# np - name of node connected to positive pin# nm - name of node connected to negative pin# -low value - low value, aliases: `-voff`, `-ioff`# -high value - high value, aliases: `-von`, `-ion`# -td value - time delay# -tr value - rise time# -tf value - fall time# -ton value - width of pulse, alias `-pw`# -tper value - period time, alias `-per`# -dc value - DC value, optional# -ac value - AC value, optional# -acphase value - phase of AC signal, optional, requires `-ac`# ```# VYYYYYYY n+ n- PULSE(V1 V2 TD TR TF PW PER)# ```# Example of class initialization:# ```# Vpulse new 1 net1 net2 -low 0 -high 1 -td {td -eq} -tr 1e-9 -tf 1e-9 -pw 10e-6 -per 20e-6# ```# Synopsis: name np nm -voff|ioff|low value -von|ion|high value -td value -tr value -tf value# -pw|ton value ?-dc value? ?-ac value ?-acphase value??next v {*}$args
}
method constructor {args} {
# Creates object of class `Vpwl` that describes piece-wise voltage source.# name - name of the device without first-letter designator V# np - name of node connected to positive pin# nm - name of node connected to negative pin# -seq list - sequence of pwl points in form `{t0 v0 t1 v1 t2 v2 t3 v3 ...}`# -dc value - DC value, optional# -ac value - AC value, optional# -acphase value - phase of AC signal, optional, requires `-ac`# ```# VYYYYYYY n+ n- PWL (T1 V1 <T2 V2 T3 V3 T4 V4 ...>)# ```# Example of class initialization:# ```# Vpwl new 1 np nm -seq {0 0 {-eq t1} 1 2 2 3 3 4 4}# ```# Synopsis: name np nm -seq list ?-phase|phi value???next v {*}$args
}
method constructor {args} {
# Creates object of class `Vsffm` that describes single-frequency FM voltage source.# name - name of the device without first-letter designator V# np - name of node connected to positive pin# nm - name of node connected to negative pin# -v0 value - initial value, aliases: `-voff`, `-i0`, `-ioff`# -va value - pulsed value, aliases: `-vamp`, `-ia`, -iamp`# -fc value - carrier frequency, alias `-fcar`# -mdi value - modulation index# -fs value - signal frequency, alias `-fsig`# -dc value - DC value, optional# -ac value - AC value, optional# -acphase value - phase of AC signal, optional, requires `-ac`# ```# VYYYYYYY n+ n- SFFM(VO VA FC MDI FS)# ```# Example of class initialization:# ```# Vsin new 1 net1 net2 -v0 0 -va 1 -fc {-eq freq} -mdi 0 -fs 1e3# ```# Synopsis: name np nm -i0|voff|ioff|v0 value -ia|vamp|iamp|va value -fc|fcar value -mdi value# -fs|fsig ?-phi|phase value???next v {*}$args
}
method constructor {args} {
# Creates object of class `Vsin` that describes sinusoidal voltage source.# name - name of the device without first-letter designator V# np - name of node connected to positive pin# nm - name of node connected to negative pin# -v0 value - DC shift value, aliases: `-voffset`, `-i0`, `-ioffset`# -va value - amplitude value, aliases: `-vamp`, `-ia`, `-iamp`# -freq value - frequency of sinusoidal signal# -td value - time delay, optional# -theta value - damping factor, optional, requires `-td`# -phase value - phase of signal, optional, requires `-td` and `-phase`, alias `-phi`# -dc value - DC value, optional# -ac value - AC value, optional# -acphase value - phase of AC signal, optional, requiress `-ac`# ```# VYYYYYYY n+ n- SIN(VO VA FREQ TD THETA PHASE)# ```# Example of class initialization:# ```# Vsin new 1 net1 net2 -v0 0 -va 2 -freq {-eq freq} -td 1e-6 -theta {-eq theta}# ```# Synopsis: name np nm -i0|voffset|ioffset|v0 value -ia|vamp|iamp|va value -freq value# ?-td value ?-theta value ?-phi|phase value???next v {*}$args
}