Vwsim-spice
VWSIM-compatible SPICE commands.
SPICE provides many textual commands to define and simulate a
circuit. The small subset of SPICE commands that VWSIM understands
are presented below. The commands are case-insensitive (due to our
use of Lisp, which upcases lower-case characters).
Note: see vwsim-names for the expected format of device
and node names when defining netlists.
Devices
Voltage Source
Vname N+ N- Type (Values)
where
- N+ is the node connected to the positive terminal.
- N- is the node connected to the negative terminal.
- Type is PWL, EXP, SIN, or PULSE.
- Values is a list of space-separated constants that
depends on the Type. See vwsim-input-source-waveforms for more information on how to
specify waveforms.
Examples:
- VV1 a gnd pwl (0 0 1 2 10 20)
- VV2 a gnd pulse (0 1 2 1 1 3 15)
Current Source
Iname N+ N- Type (Values)
where
- N+ is the node connected to the positive terminal.
- N- is the node connected to the negative terminal.
- Type is PWL, EXP, PULSE, or SIN.
- Values is a list of space-separated constants that
depends on the Type. See vwsim-input-source-waveforms for more information on how to
specify waveforms.
Examples:
- II1 a gnd pwl (0 0 1 2 10 20)
- II2 a gnd pulse (0 1 2 1 1 3 15)
Phase Source
Pname N+ N- Type (Values)
where
- N+ is the node connected to the positive terminal.
- N- is the node connected to the negative terminal.
- Type is PWL, EXP, PULSE, or SIN.
- Values is a list of space-separated constants that
depends on the Type. See vwsim-input-source-waveforms for more information on how to
specify waveforms.
Examples:
- PP1 a gnd pwl (0 0 1 2 10 20)
- PP2 a gnd pulse (0 1 2 1 1 3 15)
Resistor
Rname N+ N- Value
where
- N+ is the node connected to the positive terminal.
- N- is the node connected to the negative terminal.
- Value is the resistance in Ohms. It is a positive constant.
Examples:
Inductor
Lname N+ N- Value
where
- N+ is the node connected to the positive terminal.
- N- is the node connected to the negative terminal.
- Value is the inductance in Henries. It is a positive constant.
Examples:
Capacitor
Cname N+ N- Value
where
- N+ is the node connected to the positive terminal.
- N- is the node connected to the negative terminal.
- Value is the capacitance in Farads. It is a positive constant.
Examples:
Josephson Junction
Bname N+ N- Model area=Value
where
- N+ is the node connected to the positive terminal.
- N- is the node connected to the negative terminal.
- Model is the name of a model defined using the model command.
- Value is the JJ area. It is a positive constant.
Examples:
- BJ1 a gnd jjmodel area=2.5
Mutual Inductance
Kname Ind1 Ind2 Value
where
- Ind1 is the name of the first coupled inductor.
- Ind1 is the name of the second coupled inductor.
- Value is the coupling factor. It is a constant between -1 and 1, inclusive.
Examples:
Transmission Line
Tname N1+ N1- N2+ N2-
TD=Value1 Z0=Value2
where
- N1+ is the node connected to the first positive terminal.
- N1- is the node connected to the first negative terminal.
- N2+ is the node connected to the second positive terminal.
- N2- is the node connected to the second negative terminal.
- Value1 is the delay (propagation time). It is a non-negative constant.
- Value2 is the impedance. It is a non-negative constant.
Examples:
- T1 A1 gnd B1 gnd TD=200p Z0=1
Statements
Transient Analysis
.tran tstep tstop [tstart]
- tstep is the printing/simulation step size (in seconds).
- tstop is the time to stop the simulation (in seconds).
- tstart is the time to start the simulation (in
seconds). If not provided, the simulation starts at 0 seconds.
Global Node
.global Node
- Node is a node (wire) name that is available to all
subcircuits.
Subcircuit Definition
.subckt Name Nodes
where
- Name is the subcircuit name.
- Nodes is a space-separated list of external nodes
The lines that immediately follow the .subckt line define the
subcircuit.
.ends [name]
where
- name is an optional subcircuit name.
The .ends line indicates the end of the subcircuit
definition. If a subcircuit name is provided, it will be checked
that the subcircuit being specified is ended. Note that this
allows nested subcircuit definitions. That is, it is acceptable
to use the .subckt line while already defining a subcircuit.
Model
.model Name Type([Parameters])
where
- Name is the name of the model.
- Type is the device type.
- Parameters is an optional space-separated list. Each
parameter is of the form:
ParameterName=Value
VWSIM currently only supports the Type "jj". The
parameters for the JJ model are:
Parameter Name |
Description |
icrit |
JJ critical current. |
vg |
JJ gap voltage. |
rn |
JJ normal resistance. |
r0 |
JJ subgap resistance. |
cap |
JJ capacitance. |
Print
.print PrintType Name
See vwsim-output-request-format for the format of
PrintType and Name
Unit Prefixes
A SPICE value can be followed by a unit prefix. The prefix is a
multiplier applied on the value.
Prefix |
T |
G |
MEG/X |
K |
M |
U |
N |
P |
F |
Value |
10e+12 |
10e+9 |
10e+6 |
10e+3 |
10e-3 |
10e-6 |
10e-9 |
10e-12 |
10e-15 |
Examples:
- LL1 a b 2p
- VVS1 c d pwl (0 0 2p 10.2m 5p 7k)
Comments
The character * at the beginning of a new line denotes a commented line.