11.1.10.6. Netlist¶
This modules implements circuit and subcircuit.
The definition of a netlist follows the same conventions as SPICE. For example this SPICE netlist is translated to Python like this:
.title Voltage Divider
Vinput in 0 10V
R1 in out 9k
R2 out 0 1k
.end
 circuit = Circuit('Voltage Divider')
circuit.V('input', 'in', circuit.gnd, 10)
 circuit.R(1, 'in', 'out', kilo(9))
 circuit.R(2, 'out', circuit.gnd, kilo(1))
or as a class definition:
class VoltageDivider(Circuit):
    def __init__(self, **kwargs):
        super().__init__(title='Voltage Divider', **kwargs)
        self.V('input', 'in', self.gnd, '10V')
        self.R(1, 'in', 'out', kilo(9))
        self.R(2, 'out', self.gnd, kilo(1))
The circuit attribute gnd represents the ground of the circuit or subcircuit, usually set to
0.
We can get an element or a model using its name using these two possibilities:
circuit['R1'] # dictionary style
circuit.R1    # attribute style
The dictionary style always works, but the attribute only works if it complies with the Python syntax, i.e. the element or model name is a valide attribute name (identifier), i.e. starting by a letter and not a keyword like ‘in’, cf. Python Language Reference.
We can update an element parameter like this:
circuit.R1.resistance = kilo(1)
To simulate the circuit, we must create a simulator instance using the Circuit.simulator():
simulator = circuit.simulator()
- 
class 
PySpice.Spice.Netlist.Circuit(title, ground=0, global_nodes=())[source]¶ Bases:
PySpice.Spice.Netlist.NetlistThis class implements a cicuit netlist.
To get the corresponding Spice netlist use:
circuit = Circuit() ... str(circuit)
- 
class 
PySpice.Spice.Netlist.DeviceModel(name, modele_type, **parameters)[source]¶ Bases:
objectThis class implements a device model.
Ngspice model types:
Code
Model Type
R
Semiconductor resistor model
C
Semiconductor capacitor model
L
Inductor model
SW
Voltage controlled switch
CSW
Current controlled switch
URC
Uniform distributed RC model
LTRA
Lossy transmission line model
D
Diode model
NPN
NPN BJT model
PNP
PNP BJT model
NJF
N-channel JFET model
PJF
P-channel JFET model
NMOS
N-channel MOSFET model
PMOS
P-channel MOSFET model
NMF
N-channel MESFET model
PMF
P-channel MESFET model
- 
class 
PySpice.Spice.Netlist.Element(netlist, name, *args, **kwargs)[source]¶ Bases:
objectThis class implements a base class for an element.
It use a metaclass machinery for the declaration of the parameters.
- 
class 
PySpice.Spice.Netlist.ElementParameterMetaClass(class_name, base_classes, namespace)[source]¶ Bases:
typeMetaclass to customise the element classes when they are created and to register SPICE prefix.
Element classes are of type
ElementParameterMetaClassinstead oftypeclass Resistor(metaclass=ElementParameterMetaClass): <=> Resistor = ElementParameterMetaClass('Foo', ...)
- 
class 
PySpice.Spice.Netlist.Netlist[source]¶ Bases:
objectThis class implements a base class for a netlist.
Note
This class is completed with element shortcuts when the module is loaded.
- 
A(*args, **kwargs)¶ This class implements a sub-circuit.
Spice syntax:
AXXXXXXX <%v ,%i ,%vd ,%id ,%g,%gd ,%h,%hd , or %d> + <[> <~><%v ,%i ,%vd ,%id ,%g,%gd ,%h,%hd , or %d> + <NIN1 or +NIN1 -NIN1 or "null"> + <~>...< NIN2 .. <]> > + <%v ,%i ,%vd ,%id ,%g,%gd ,%h,%hd ,%d or %vnam > + <[> <~><%v ,%i ,%vd ,%id ,%g,%gd ,%h,%hd , or %d>< NOUT1 or +NOUT1 -NOUT1 > + <~>...< NOUT2 .. <]>> + MODELNAME . MODEL MODELNAME MODELTYPE + <( PARAMNAME1 = <[> VAL1 <VAL2 ... <]>> PARAMNAME2 ..>)>
Attributes:
Note
As opposite to Spice, the model is specified before the nodes so as to act as *args.
Warning
Partially implemented.
- 
AmplitudeModulatedCurrentSource(*args, **kwargs)¶ This class implements a amplitude modulated waveform current source.
See
AmplitudeModulatedMixinfor documentation.
- 
AmplitudeModulatedVoltageSource(*args, **kwargs)¶ This class implements a amplitude modulated waveform voltage source.
See
AmplitudeModulatedMixinfor documentation.
- 
B(*args, **kwargs)¶ This class implements a behavioral source.
Spice syntax:
BXXXXXXX n+ n- <i=expr> <v=expr> <tc1=value> <tc2=value> <temp=value> <dtemp=value>
Keyword Parameters:
current_expressionalias i
voltage_expressionalias v
tc1tc2temperaturealias temp
device_temperaturealias dtemp
Attributes:
current_expressionvoltage_expressiontc1tc2temperaturedevice_temperature
- 
BJT(*args, **kwargs)¶ This class implements a bipolar junction transistor.
Spice syntax:
QXXXXXXX nc nb ne <ns> mname <area=val> <areac=val> <areab=val> <m=val> <off> <ic=vbe,vce> <temp=val> <dtemp=val>
Keyword Parameters:
Attributes:
- 
BehavioralCapacitor(*args, **kwargs)¶ This class implements a behavioral capacitor.
Spice syntax:
CXXXXXXX n+ n- 'expression' <tc1=value> <tc2=value> CXXXXXXX n+ n- C='expression' <tc1=value> <tc2=value>
Keyword Parameters:
tc1tc2Attributes:
capacitance_expressiontc1tc2
- 
BehavioralInductor(*args, **kwargs)¶ This class implements a behavioral inductor.
Spice syntax:
LXXXXXXX n+ n- 'expression' <tc1=value> <tc2=value> LXXXXXXX n+ n- L='expression' <tc1=value> <tc2=value>
Keyword Parameters:
tc1tc2Attributes:
inductance_expressiontc1tc2
- 
BehavioralResistor(*args, **kwargs)¶ This class implements a behavioral resistor.
Spice syntax:
RXXXXXXX n+ n- 'expression' <tc1=value> <tc2=value> Rxxxxxxx n+ n- R='expression' <tc1=value> <tc2=value>
Keyword Parameters:
tc1tc2Attributes:
resistance_expressiontc1tc2
- 
BehavioralSource(*args, **kwargs)¶ This class implements a behavioral source.
Spice syntax:
BXXXXXXX n+ n- <i=expr> <v=expr> <tc1=value> <tc2=value> <temp=value> <dtemp=value>
Keyword Parameters:
current_expressionalias i
voltage_expressionalias v
tc1tc2temperaturealias temp
device_temperaturealias dtemp
Attributes:
current_expressionvoltage_expressiontc1tc2temperaturedevice_temperature
- 
BipolarJunctionTransistor(*args, **kwargs)¶ This class implements a bipolar junction transistor.
Spice syntax:
QXXXXXXX nc nb ne <ns> mname <area=val> <areac=val> <areab=val> <m=val> <off> <ic=vbe,vce> <temp=val> <dtemp=val>
Keyword Parameters:
Attributes:
- 
C(*args, **kwargs)¶ This class implements a capacitor.
Spice syntax:
CXXXXXXX n+ n- <value> <mname> <m=val> <scale=val> <temp=val> <dtemp=val> <ic=init_condition>
Keyword Parameters:
multiplieralias m
scaletemperaturealias temp
device_temperaturealias dtemp
initial_conditionalias ic
Attributes:
- 
CCCS(*args, **kwargs)¶ This class implements a linear current-controlled current sources (CCCS).
Spice syntax:
FXXXXXXX n+ n- vname value <m=val>
Keyword Parameters:
multiplieralias m
Attributes:
sourcecurrent_gain
- 
CCS(*args, **kwargs)¶ This class implements a current controlled switch.
Spice syntax:
WYYYYYYY n+ n- vname model <on> <off>
Keyword Parameters:
Attributes:
- 
CCVS(*args, **kwargs)¶ This class implements a linear current-controlled voltage sources (CCVS).
Spice syntax:
HXXXXXXX n+ n- vname value
Keyword Parameters:
Attributes:
sourcetransresistance
- 
Capacitor(*args, **kwargs)¶ This class implements a capacitor.
Spice syntax:
CXXXXXXX n+ n- <value> <mname> <m=val> <scale=val> <temp=val> <dtemp=val> <ic=init_condition>
Keyword Parameters:
multiplieralias m
scaletemperaturealias temp
device_temperaturealias dtemp
initial_conditionalias ic
Attributes:
- 
CoupledInductor(*args, **kwargs)¶ This class implementss a coupled (mutual) inductors.
Spice syntax:
KXXXXXXX LYYYYYYY LZZZZZZZ value
Keyword Parameters:
Attributes:
inductor1inductor2coupling_factor
- 
CoupledMulticonductorLine(*args, **kwargs)¶ This class implements coupled multiconductor lines.
Spice syntax:
PXXXXXXX NI1 NI2 ... NIX GND1 NO1 NO2 ... NOX GND2 model <len=length>
Attributes:
lengthalias len length of the line in meters
Note
As opposite to Spice, the model is specified before the nodes so as to act as *args.
- 
CurrentControlledCurrentSource(*args, **kwargs)¶ This class implements a linear current-controlled current sources (CCCS).
Spice syntax:
FXXXXXXX n+ n- vname value <m=val>
Keyword Parameters:
multiplieralias m
Attributes:
sourcecurrent_gain
- 
CurrentControlledSwitch(*args, **kwargs)¶ This class implements a current controlled switch.
Spice syntax:
WYYYYYYY n+ n- vname model <on> <off>
Keyword Parameters:
Attributes:
- 
CurrentControlledVoltageSource(*args, **kwargs)¶ This class implements a linear current-controlled voltage sources (CCVS).
Spice syntax:
HXXXXXXX n+ n- vname value
Keyword Parameters:
Attributes:
sourcetransresistance
- 
CurrentSource(*args, **kwargs)¶ This class implements an independent sources for current.
Spice syntax:
IYYYYYYY n+ n- <<dc> dc/tran value> <ac <acmag <acphase>>> <distof1 <f1mag <f1phase>>> <distof2 <f2mag <f2phase>>>
Keyword Parameters:
Attributes:
dc_value
- 
D(*args, **kwargs)¶ This class implements a junction diode.
Spice syntax:
DXXXXXXX n+ n- mname <area=val> <m=val> <pj=val> <off> <ic=vd> <temp=val> <dtemp=val>
Keyword Parameters:
Attributes:
- 
Diode(*args, **kwargs)¶ This class implements a junction diode.
Spice syntax:
DXXXXXXX n+ n- mname <area=val> <m=val> <pj=val> <off> <ic=vd> <temp=val> <dtemp=val>
Keyword Parameters:
Attributes:
- 
ExponentialCurrentSource(*args, **kwargs)¶ This class implements a exponential waveform current source.
See
ExponentialMixinfor documentation.
- 
ExponentialVoltageSource(*args, **kwargs)¶ This class implements a exponential waveform voltage source.
See
ExponentialMixinfor documentation.
- 
F(*args, **kwargs)¶ This class implements a linear current-controlled current sources (CCCS).
Spice syntax:
FXXXXXXX n+ n- vname value <m=val>
Keyword Parameters:
multiplieralias m
Attributes:
sourcecurrent_gain
- 
GSSElement(*args, **kwargs)¶ This class implements GSS device.
Warning
Not implemented
- 
H(*args, **kwargs)¶ This class implements a linear current-controlled voltage sources (CCVS).
Spice syntax:
HXXXXXXX n+ n- vname value
Keyword Parameters:
Attributes:
sourcetransresistance
- 
I(*args, **kwargs)¶ This class implements an independent sources for current.
Spice syntax:
IYYYYYYY n+ n- <<dc> dc/tran value> <ac <acmag <acphase>>> <distof1 <f1mag <f1phase>>> <distof2 <f2mag <f2phase>>>
Keyword Parameters:
Attributes:
dc_value
- 
Inductor(*args, **kwargs)¶ This class implements an inductor.
Spice syntax:
LYYYYYYY n+ n- <value> <mname> <nt=val> <m=val> <scale=val> <temp=val> <dtemp=val> <ic=init_condition>
Keyword Parameters:
ntmultiplieralias m
scaletemperaturealias temp
device_temperaturealias dtemp
initial_conditionalias ic
Attributes:
- 
J(*args, **kwargs)¶ This class implements a bipolar junction transistor.
Spice syntax:
JXXXXXXX nd ng ns mname <area> <off> <ic=vds,vgs> <temp=t>
Keyword Parameters:
Attributes:
- 
JFET(*args, **kwargs)¶ This class implements a bipolar junction transistor.
Spice syntax:
JXXXXXXX nd ng ns mname <area> <off> <ic=vds,vgs> <temp=t>
Keyword Parameters:
Attributes:
- 
JunctionFieldEffectTransistor(*args, **kwargs)¶ This class implements a bipolar junction transistor.
Spice syntax:
JXXXXXXX nd ng ns mname <area> <off> <ic=vds,vgs> <temp=t>
Keyword Parameters:
Attributes:
- 
K(*args, **kwargs)¶ This class implementss a coupled (mutual) inductors.
Spice syntax:
KXXXXXXX LYYYYYYY LZZZZZZZ value
Keyword Parameters:
Attributes:
inductor1inductor2coupling_factor
- 
L(*args, **kwargs)¶ This class implements an inductor.
Spice syntax:
LYYYYYYY n+ n- <value> <mname> <nt=val> <m=val> <scale=val> <temp=val> <dtemp=val> <ic=init_condition>
Keyword Parameters:
ntmultiplieralias m
scaletemperaturealias temp
device_temperaturealias dtemp
initial_conditionalias ic
Attributes:
- 
LosslessTransmissionLine(*args, **kwargs)¶ This class implements a lossless transmission line.
Spice syntax:
TXXXXXXX N1 N2 N3 N4 Z0=VALUE <TD=VALUE> <F=FREQ <NL=NRMLEN>> <IC=V1, I1, V2, I2>
where TD or F, NL must be specified.
Keyword Parameters:
impedancealias:Z0 is the characteristic impedance
time_delayalias:TD is the transmission delay
frequencyalias:F
normalized_lengthalias:NL
Attributes:
impedancetime_delayfrequencynormalized_lengthThe transmission delay, td, may be specified directly (as td=10ns, for example). Alternatively, a frequency f may be given, together with nl, the normalized electrical length of the transmission line with respect to the wavelength in the line at the frequency f. If a frequency is specified but nl is omitted, 0.25 is assumed (that is, the frequency is assumed to be the quarter-wave frequency). Note that although both forms for expressing the line length are indicated as optional, one of the two must be specified.
Note: Either time_delay or frequency must be given.
- 
LossyTransmission(*args, **kwargs)¶ This class implements lossy transmission lines.
Spice syntax:
OXXXXXXX n1 n2 n3 n4 model
Attributes:
Note
As opposite to Spice, the model is specified before the nodes so as to act as *args.
- 
M(*args, **kwargs)¶ This class implements a Metal Oxide Field Effect Transistor.
Spice syntax:
MXXXXXXX nd ng ns nb mname <m=val> <l=val> <w=val> + <ad=val> <as=val> <pd=val> <ps=val> <nrd=val> + <nrs=val> <off> <ic=vds,vgs,vbs> <temp=t>
Keyword Parameters:
multiplieralias m
lengthalias l
widthalias w
nfinonly for Xyce
drain_areaalias ad
source_areaalias as
drain_perimeteralias pd
source_perimeteralias ps
drain_number_squarealias nrd
source_number_squarealias nrs
offictemperaturealias temp
Attributes:
multiplierlengthwidthnfinonly for Xyce
drain_areasource_areadrain_perimetersource_perimeterdrain_number_squaresource_number_squareoffictemperature
- 
MESFET(*args, **kwargs)¶ This class implements a Metal Semiconductor Field Effect Transistor.
Spice syntax:
ZXXXXXXX nd ng ns mname <area> <off> <ic=vds,vgs>
Keyword Parameters:
Attributes:
- 
MOSFET(*args, **kwargs)¶ This class implements a Metal Oxide Field Effect Transistor.
Spice syntax:
MXXXXXXX nd ng ns nb mname <m=val> <l=val> <w=val> + <ad=val> <as=val> <pd=val> <ps=val> <nrd=val> + <nrs=val> <off> <ic=vds,vgs,vbs> <temp=t>
Keyword Parameters:
multiplieralias m
lengthalias l
widthalias w
nfinonly for Xyce
drain_areaalias ad
source_areaalias as
drain_perimeteralias pd
source_perimeteralias ps
drain_number_squarealias nrd
source_number_squarealias nrs
offictemperaturealias temp
Attributes:
multiplierlengthwidthnfinonly for Xyce
drain_areasource_areadrain_perimetersource_perimeterdrain_number_squaresource_number_squareoffictemperature
- 
Mesfet(*args, **kwargs)¶ This class implements a Metal Semiconductor Field Effect Transistor.
Spice syntax:
ZXXXXXXX nd ng ns mname <area> <off> <ic=vds,vgs>
Keyword Parameters:
Attributes:
- 
Mosfet(*args, **kwargs)¶ This class implements a Metal Oxide Field Effect Transistor.
Spice syntax:
MXXXXXXX nd ng ns nb mname <m=val> <l=val> <w=val> + <ad=val> <as=val> <pd=val> <ps=val> <nrd=val> + <nrs=val> <off> <ic=vds,vgs,vbs> <temp=t>
Keyword Parameters:
multiplieralias m
lengthalias l
widthalias w
nfinonly for Xyce
drain_areaalias ad
source_areaalias as
drain_perimeteralias pd
source_perimeteralias ps
drain_number_squarealias nrd
source_number_squarealias nrs
offictemperaturealias temp
Attributes:
multiplierlengthwidthnfinonly for Xyce
drain_areasource_areadrain_perimetersource_perimeterdrain_number_squaresource_number_squareoffictemperature
- 
N(*args, **kwargs)¶ This class implements GSS device.
Warning
Not implemented
- 
NonLinearCurrentSource(*args, **kwargs)¶ This class implements a non-linear current sources.
Warning
Partially implemented
Spice syntax:
Gxxx n+ n- value={expr} Gxxx n1 n2 TABLE {expression}=(x0,y0) (x1,y1) (x2,y2) Gxxx n+ n- ( POLY (nd) ) nc1+ nc1- ( nc2+ nc2- ... ) p0 ( p1 ... ) LaplaceKeyword Parameters:
Attributes:
transconductance
- 
NonLinearVoltageSource(*args, **kwargs)¶ This class implements a non-linear voltage source.
Warning
Partially implemented
Spice syntax:
Exxx n+ n- vol='expr' Exxx n+ n- value={expr} Exxx n1 n2 TABLE {expression}=(x0,y0) (x1,y1) (x2,y2) Exxx n+ n- ( POLY (nd) ) nc1+ nc1- ( nc2+ nc2- ... ) p0 ( p1 ... ) LaplaceKeyword Parameters:
Attributes:
- 
O(*args, **kwargs)¶ This class implements lossy transmission lines.
Spice syntax:
OXXXXXXX n1 n2 n3 n4 model
Attributes:
Note
As opposite to Spice, the model is specified before the nodes so as to act as *args.
- 
P(*args, **kwargs)¶ This class implements coupled multiconductor lines.
Spice syntax:
PXXXXXXX NI1 NI2 ... NIX GND1 NO1 NO2 ... NOX GND2 model <len=length>
Attributes:
lengthalias len length of the line in meters
Note
As opposite to Spice, the model is specified before the nodes so as to act as *args.
- 
PieceWiseLinearCurrentSource(*args, **kwargs)¶ This class implements a piece wise linear waveform current source.
See
PieceWiseLinearMixinfor documentation.
- 
PieceWiseLinearVoltageSource(*args, **kwargs)¶ This class implements a piece wise linear waveform voltage source.
See
PieceWiseLinearMixinfor documentation.
- 
PulseCurrentSource(*args, **kwargs)¶ This class implements a pulse waveform current source.
See
PulseMixinfor documentation.
- 
PulseVoltageSource(*args, **kwargs)¶ This class implements a pulse waveform voltage source.
See
PulseMixinfor documentation.
- 
Q(*args, **kwargs)¶ This class implements a bipolar junction transistor.
Spice syntax:
QXXXXXXX nc nb ne <ns> mname <area=val> <areac=val> <areab=val> <m=val> <off> <ic=vbe,vce> <temp=val> <dtemp=val>
Keyword Parameters:
Attributes:
- 
R(*args, **kwargs)¶ This class implements a resistor.
Spice syntax:
RXXXXXXX n+ n- value <ac=val> <m=val> <scale=val> <temp=val> <dtemp=val> <noisy=0|1>
Keyword Parameters:
acmultiplieralias m
scaletemperaturealias temp
device_temperaturealias dtemp
noisyAttributes:
resistanceacmultiplierscaletemperaturedevice_temperaturenoisy
- 
RandomCurrentSource(*args, **kwargs)¶ This class implements a random waveform current source.
See
RandomMixinfor documentation.
- 
RandomVoltageSource(*args, **kwargs)¶ This class implements a random waveform voltage source.
See
RandomMixinfor documentation.
- 
Resistor(*args, **kwargs)¶ This class implements a resistor.
Spice syntax:
RXXXXXXX n+ n- value <ac=val> <m=val> <scale=val> <temp=val> <dtemp=val> <noisy=0|1>
Keyword Parameters:
acmultiplieralias m
scaletemperaturealias temp
device_temperaturealias dtemp
noisyAttributes:
resistanceacmultiplierscaletemperaturedevice_temperaturenoisy
- 
S(*args, **kwargs)¶ This class implements a voltage controlled switch.
Spice syntax:
SXXXXXXX n+ n- nc+ nc- model <on> <off>
Keyword Parameters:
initial_stateAttributes:
initial_state
- 
SemiconductorCapacitor(*args, **kwargs)¶ This class implements a semiconductor capacitor.
Spice syntax:
CXXXXXXX n+ n- <value> <mname> <l=length> <w=width> <m=val> <scale=val> <temp=val> <dtemp=val> <ic=init_condition>
Keyword Parameters:
lengthalias l
widthalias w
multiplieralias m
scaletemperaturealias temp
device_temperaturealias dtemp
initial_conditionalias ic
Attributes:
- 
SemiconductorResistor(*args, **kwargs)¶ This class implements a Semiconductor resistor.
Spice syntax:
RXXXXXXX n+ n- <value> <mname> <l=length> <w=width> <temp=val> <dtemp=val> m=<val> <ac=val> <scale=val> <noisy=0|1>
Keyword Parameters:
lengthalias l
widthalias w
temperaturealias temp
device_temperaturealias dtemp
multiplieralias m
acscalenoisyAttributes:
- 
SingleFrequencyFMCurrentSource(*args, **kwargs)¶ This class implements a single frequency FM waveform current source.
See
SingleFrequencyFMMixinfor documentation.
- 
SingleFrequencyFMVoltageSource(*args, **kwargs)¶ This class implements a single frequency FM waveform voltage source.
See
SingleFrequencyFMMixinfor documentation.
- 
SingleLossyTransmissionLine(*args, **kwargs)¶ This class implements single lossy transmission lines.
Spice syntax:
YXXXXXXX N1 0 N2 0 model <len=length>
Attributes:
lengthalias len length of the line in meters
Note
As opposite to Spice, the model is specified before the nodes so as to act as *args.
- 
SinusoidalCurrentSource(*args, **kwargs)¶ This class implements a sinusoidal waveform current source.
See
SinusoidalMixinfor documentation.
- 
SinusoidalVoltageSource(*args, **kwargs)¶ This class implements a sinusoidal waveform voltage source.
See
SinusoidalMixinfor documentation.
- 
SubCircuitElement(*args, **kwargs)¶ This class implements a sub-circuit.
Spice syntax:
XYYYYYY node1 node2 ... subcircuit_name parameter1=value1 ...
Attributes:
subcircuit_nameNote
As opposite to Spice, the circuit’s name is specified before the nodes so as to act as *args.
- 
TransmissionLine(*args, **kwargs)¶ This class implements a lossless transmission line.
Spice syntax:
TXXXXXXX N1 N2 N3 N4 Z0=VALUE <TD=VALUE> <F=FREQ <NL=NRMLEN>> <IC=V1, I1, V2, I2>
where TD or F, NL must be specified.
Keyword Parameters:
impedancealias:Z0 is the characteristic impedance
time_delayalias:TD is the transmission delay
frequencyalias:F
normalized_lengthalias:NL
Attributes:
impedancetime_delayfrequencynormalized_lengthThe transmission delay, td, may be specified directly (as td=10ns, for example). Alternatively, a frequency f may be given, together with nl, the normalized electrical length of the transmission line with respect to the wavelength in the line at the frequency f. If a frequency is specified but nl is omitted, 0.25 is assumed (that is, the frequency is assumed to be the quarter-wave frequency). Note that although both forms for expressing the line length are indicated as optional, one of the two must be specified.
Note: Either time_delay or frequency must be given.
- 
U(*args, **kwargs)¶ This class implements uniform distributed RC lines.
Spice syntax:
UXXXXXXX n1 n2 n3 model l=length <n=number_of_lumps>
Attributes:
lengthalias l length of the RC line in meters
number_of_lumpsalias n
Note
As opposite to Spice, the model is specified before the nodes so as to act as *args.
- 
UniformDistributedRCLine(*args, **kwargs)¶ This class implements uniform distributed RC lines.
Spice syntax:
UXXXXXXX n1 n2 n3 model l=length <n=number_of_lumps>
Attributes:
lengthalias l length of the RC line in meters
number_of_lumpsalias n
Note
As opposite to Spice, the model is specified before the nodes so as to act as *args.
- 
V(*args, **kwargs)¶ This class implements an independent sources for voltage.
Spice syntax:
VXXXXXXX n+ n- <<dc> dc/tran value> <ac <acmag <acphase>>> <distof1 <f1mag <f1phase>>> <distof2 <f2mag <f2phase>>>
Keyword Parameters:
Attributes:
dc_value
- 
VCCS(*args, **kwargs)¶ This class implements a linear voltage-controlled current sources (VCCS).
Spice syntax:
Gxxx n+ n- nc+ nc- value <m=val>
Keyword Parameters:
multiplieralias m
Attributes:
transconductance
- 
VCS(*args, **kwargs)¶ This class implements a voltage controlled switch.
Spice syntax:
SXXXXXXX n+ n- nc+ nc- model <on> <off>
Keyword Parameters:
initial_stateAttributes:
initial_state
- 
VCVS(*args, **kwargs)¶ This class implements a linear voltage-controlled voltage sources (VCVS).
Spice syntax:
EXXXXXXX n+ n- nc+ nc- value
Keyword Parameters:
Attributes:
voltage_gain
- 
VoltageControlledCurrentSource(*args, **kwargs)¶ This class implements a linear voltage-controlled current sources (VCCS).
Spice syntax:
Gxxx n+ n- nc+ nc- value <m=val>
Keyword Parameters:
multiplieralias m
Attributes:
transconductance
- 
VoltageControlledSwitch(*args, **kwargs)¶ This class implements a voltage controlled switch.
Spice syntax:
SXXXXXXX n+ n- nc+ nc- model <on> <off>
Keyword Parameters:
initial_stateAttributes:
initial_state
- 
VoltageControlledVoltageSource(*args, **kwargs)¶ This class implements a linear voltage-controlled voltage sources (VCVS).
Spice syntax:
EXXXXXXX n+ n- nc+ nc- value
Keyword Parameters:
Attributes:
voltage_gain
- 
VoltageSource(*args, **kwargs)¶ This class implements an independent sources for voltage.
Spice syntax:
VXXXXXXX n+ n- <<dc> dc/tran value> <ac <acmag <acphase>>> <distof1 <f1mag <f1phase>>> <distof2 <f2mag <f2phase>>>
Keyword Parameters:
Attributes:
dc_value
- 
W(*args, **kwargs)¶ This class implements a current controlled switch.
Spice syntax:
WYYYYYYY n+ n- vname model <on> <off>
Keyword Parameters:
Attributes:
- 
X(*args, **kwargs)¶ This class implements a sub-circuit.
Spice syntax:
XYYYYYY node1 node2 ... subcircuit_name parameter1=value1 ...
Attributes:
subcircuit_nameNote
As opposite to Spice, the circuit’s name is specified before the nodes so as to act as *args.
- 
XSpiceElement(*args, **kwargs)¶ This class implements a sub-circuit.
Spice syntax:
AXXXXXXX <%v ,%i ,%vd ,%id ,%g,%gd ,%h,%hd , or %d> + <[> <~><%v ,%i ,%vd ,%id ,%g,%gd ,%h,%hd , or %d> + <NIN1 or +NIN1 -NIN1 or "null"> + <~>...< NIN2 .. <]> > + <%v ,%i ,%vd ,%id ,%g,%gd ,%h,%hd ,%d or %vnam > + <[> <~><%v ,%i ,%vd ,%id ,%g,%gd ,%h,%hd , or %d>< NOUT1 or +NOUT1 -NOUT1 > + <~>...< NOUT2 .. <]>> + MODELNAME . MODEL MODELNAME MODELTYPE + <( PARAMNAME1 = <[> VAL1 <VAL2 ... <]>> PARAMNAME2 ..>)>
Attributes:
Note
As opposite to Spice, the model is specified before the nodes so as to act as *args.
Warning
Partially implemented.
- 
Y(*args, **kwargs)¶ This class implements single lossy transmission lines.
Spice syntax:
YXXXXXXX N1 0 N2 0 model <len=length>
Attributes:
lengthalias len length of the line in meters
Note
As opposite to Spice, the model is specified before the nodes so as to act as *args.
- 
Z(*args, **kwargs)¶ This class implements a Metal Semiconductor Field Effect Transistor.
Spice syntax:
ZXXXXXXX nd ng ns mname <area> <off> <ic=vds,vgs>
Keyword Parameters:
Attributes:
- 
 
- 
class 
PySpice.Spice.Netlist.Node(netlist, name)[source]¶ Bases:
objectThis class implements a node in the circuit. It stores a reference to the pins connected to the node.
- 
class 
PySpice.Spice.Netlist.Pin(element, pin_definition, node)[source]¶ Bases:
PySpice.Spice.Netlist.PinDefinitionThis class implements a pin of an element. It stores a reference to the element, the name of the pin and the node.
- 
class 
PySpice.Spice.Netlist.PinDefinition(position, name=None, alias=None, optional=False)[source]¶ Bases:
objectThis class defines a pin of an element.
- 
class 
PySpice.Spice.Netlist.SubCircuit(name, *nodes, **kwargs)[source]¶ Bases:
PySpice.Spice.Netlist.NetlistThis class implements a sub-cicuit netlist.
- 
property 
parameters¶ Parameters
- 
property