Syntax Guide
In this section we will attempt to provide the user with a comprehensive guide of the available syntax within JoSIM
JoSIM is CaSe InSeNsItIvE as each line is cast to uppercase upon read-in.
Additionally, it is discouraged to add units to values since in some specific cases this creates confusion in interpretation of the values. An example of this is specifying Farad when assigning a capacitor its value since a value followed by F would be interpreted as Femto. This will lead to wanting a 5 Farad capacitor but receiving a 5 Femto Farad capacitor. Units are not interpreted by the simulator in any way since the component type implies the unit.
Basic Syntax
Each line follows similar syntax which uses the first non-blank space character as identifier. Each identifier tells JoSIM how to handle that specific line.
Identifiers that start with a letter relate to physical components in the design, e.g. L, C, R. Lines of this kind almost always follows the same syntax in that it requires a label and two nodes. These nodes can be alphanumeric with the restriction of 0 and GND which indicate a grounded node. Additionally, the use of period (.) or vertical bars (|) in label or node names are prohibited as these are reserved characters within JoSIM.
Only the exact names 0 and GND indicate ground. GNDREF, AGND and other
names containing those letters are ordinary nodes. Declared subcircuit pins are
bound to their instance connections before physical nodes are classified. A pin
named GND can therefore connect to a non-ground node; undeclared ground
references inside the subcircuit still refer to global ground.
Lines that start with a period (.) indicate that the line relates in some way to simulation control. In this case the command that follows the period identifies the control, e.g. .tran, .print, .end.
Comments are lines that start with an asterisk (*) or a hash (#). Comments are meant to be in a line of their own and will not work if placed at the end of a line.
Lines that start with a plus sign (+) indicate that the line is a continuation of the previous line. Internally the two lines will be combined.
In most cases the VALUE of a component can be replaced by a variable name or an expression. Variables can be defined using the .PARAM control. These will be discussed in detail further.
Values in JoSIM can be modified with engineering notation or through suffixes. A list of the available suffixes is found below:
| Suffix | Meaning | Engineering Notation Equivalent |
|---|---|---|
| F | Femto | 1E-15 |
| P | Pico | 1E-12 |
| N | Nano | 1E-9 |
| U | Micro | 1E-6 |
| M | Milli | 1E-3 |
| K | Kilo | 1E3 |
| MEG | Mega | 1E6 |
| X | Mega | 1E6 |
| G | Giga | 1E9 |
| T | Tera | 1E12 |
Basic Components
We will now run through all the available physical components and their limitations. Any parameter surrounded by square brackets are optional and nested square brackets mean that the encapsulated parameter relies on the existence of the previous.
Resistor
RLabel \(N^{+}\) \(N^{-}\) VALUE [temp=<TEMP>] [neb=<FREQ>]
The value of a resistor is in Ohms.
Temperature used for noise analysis in Kelvin. Units need to be excluded since K for Kelvin will be interpreted as Kilo by JoSIM, e.g. 4K will become 4000.
Optional neb= sets the thermal-noise effective bandwidth in Hz. The default
is 1 THz. The noise guide defines the interpolated spectrum,
timestep floor and classical thermal-noise assumptions.
Inductor
LLabel \(N^{+}\) \(N^{-}\) VALUE [ALPHA=\(a\)]
The value of an inductor is in Henry.
Without ALPHA, L is constant. ALPHA=a selects differential inductance
Ld(I)=L0*(1+a*I^2), with VALUE supplying L0. L0 must be finite and positive;
a must be finite and non-negative, in A^-2. Both accept scoped parameter
expressions evaluated once. ALPHA=0 gives the constant-L model. See the
nonlinear-inductor guide for the flux law,
mutual coupling and examples.
Capacitor
CLabel \(N^{+}\) \(N^{-}\) VALUE [IC=\(V_0\)]
The value of a capacitor is in Farad.
IC= specifies the signed terminal voltage at t=0, in volts. It accepts
parameter expressions and requires .TRAN ... DST and positive capacitance.
The initial-voltage path supports RLC/junction circuits and unenergized lines;
phase sources and controlled sources are currently rejected. See the
initial-state guide for constraints and examples.
Josephson Junction (JJ)
BLabel \(N^{+}\) \(N^{-}\) <PhaseNode> MODEL [area=<AREA>] [ic=<IC>] [temp=<TEMP>] [neb=<FREQ>]
A Josephson junction has two electrical terminals. An optional third field is
normally an unused WRspice phase-node placeholder. A model explicitly specifying
GWIDTH can instead use it as a gate, or use the explicit GC=node field. See
the gate-controlled junction guide for unambiguous syntax
and the physical gate-voltage convention in both modes.
The Josephson junction requires specification of a model name which can be defined anywhere in the program using the control .MODEL.
When AREA or IC is not specified then an area=1 is used as default.
The temp and neb commands have the same descriptions as for the resistor.
Model
This model control has the following syntax
.MODEL ModelName ModelType([MODEL PARAMETERS])
The only junction model currently supported by JoSIM is the RCSJ model and thus the only available ModelType is jj with the following tunable parameters:
| Parameter | Range | Default | Description |
|---|---|---|---|
| RTYPE | 0, 1 | 1 | Linearization model used |
| VG or VGAP | -\(\infty\), \(\infty\) | 2.8E-3 | Junction gap voltage |
| IC or ICRIT | -\(\infty\), \(\infty\) | 1E-3 | Junction critical current |
| RN | 0, \(\infty\) | 5 | Junction normal resistance |
| BETA_C | \(0 < \beta_c < \infty\) | unset | Dimensionless nominal damping; calculates RN for RTYPE=0 |
| R0 | 0, \(\infty\) | 30 | Junction subgap resistance |
| C or CAP | \(0 \le C < \infty\) | 2.5E-12 | Junction capacitance |
| T | \(0 \le T < T_C\) | 4.2 | Temperature-dependent CPR temperature in K |
| TC | 0, \(\infty\) | 9.1 | Critical temperature of superconducting material |
| DELV | 0, \(\infty\) | 0.1E-3 | Transitional voltage from subgap to normal |
| D | 0.0, 1 | 0.0 | Point of contact transparency affecting current phase relationship |
| ICFCT or ICFACT | 0, 1 | \(\frac{\pi}{4}\) | Ratio of critical current to quasiparticle step height |
| PHI | 0, \(2\pi\) | 0 | Allows phi-junction capability such as the \(\pi\)-junction. |
| CPR | {\(-\infty\), \(\infty\)} | {1} | Sets the Current Phase Relationship harmonic amplitudes. |
| GWIDTH | \(0 < GWIDTH < \infty\) | 0.1E-3 | Gate voltage for complete suppression; enable with GC=node or explicit third-field gate syntax |
The .model line belongs to its containing subcircuit. Separate subcircuits can
use the same model name. Lookup checks the current instance, its containing
instances, then globals. A missing model is an error; it does not select a
default model.
For RTYPE=0, BETA_C= calculates the constant resistance RN from the
Stewart–McCumber parameter, Ic and C. Ic and C must be positive. Do not also
specify RN or enable temperature-dependent model parameters T, TC or D.
See the damping guide for the equation and example.
All values must be finite. RN/R0/DELV/ICFCT/TC are strictly positive; D is in [0,1]. Temperature-dependent models require positive Ic; ordinary sinusoidal models retain signed/zero Ic support. D=1 uses its finite positive-temperature limit, while the zero-temperature cusp is singular. See model domains for the checked boundaries.
The AREA and IC parameters act as modifiers to the model parameters. AREA is a critical current multiplier, where if IC is specified it replaces the AREA value by \(AREA=\frac{IC_{jj}}{IC_{model}}\).
By setting the PHI parameter of the model, the phase value is persistantly subtracted from the phase (\(\phi\)) in the \(\sin(\phi)\) part of the JJ current. This allows elements such as the \(\pi\)-junction to be modeled.
The CPR parameter alters each individual harmonic of the junction supercurrent. It can either be a singular value or an array of n values encapsulated with curly braces. i.e CPR={0.9, 0.1} to set the current phase relationship to the following \(I = I_C(0.9\sin(\phi) + 0.1\sin(2\phi))\).
Transmission Line
TLabel \(N^{+}_{1}\) \(N^{-}_{1}\) \(N^{+}_{2}\) \(N^{-}_{2}\) TD=VALUE Z0=VALUE
TD is the time delay in seconds.
Z0 is the impedance in Ohms.
Mutual Inductance
KLabel \(L_{1}\) \(L_{2}\) VALUE
The value is the coupling factor k.
Sources
Independent Sources
Voltage Source
VLabel \(N^{+}\) \(N^{-}\) SOURCETYPE
Current Source
ILabel \(N^{+}\) \(N^{-}\) SOURCETYPE
Phase Source
PLabel \(N^{+}\) \(N^{-}\) SOURCETYPE
Dependent Sources
Current controlled current source
FLabel \(N^{+}\) \(N^{-}\) \(N^{+}\)Control \(N^{-}\)Control CURRENT GAIN
Current controlled voltage source
HLabel \(N^{+}\) \(N^{-}\) \(N^{+}\)Control \(N^{-}\)Control TRANSRESISTANCE IN OHMS
Voltage controlled current source
GLabel \(N^{+}\) \(N^{-}\) \(N^{+}\)Control \(N^{-}\)Control TRANSCONDUCTANCE IN MHOS
Voltage controlled voltage source
ELabel \(N^{+}\) \(N^{-}\) \(N^{+}\)Control \(N^{-}\)Control VOLTAGE GAIN
Source Types
Piece Wise Linear (PWL)
pwl(0 0 \(T_{1}\) \(A_{1}\) ... \(T_{n}\) \(A_{n}\))
This source linearly interpolates amplitude values for every time point in the simulation between the specified amplitudes.
Times must be finite, nonnegative and strictly increasing; amplitudes must be finite. The first amplitude can be nonzero. If the first time is positive, JoSIM prepends time zero with that same amplitude and reports a warning. Negative first times are rejected. The final amplitude is held after the last point. PWL returns zero before time zero during startup; PWS holds its first amplitude before the first point.
Pulse
pulse(\(A_{1}\) \(A_{2}\) [\(T_{D}\) [\(T_{R}\) [\(T_{F}\) [PW [PER]]]]] )
This source generates a pulse between two amplitudes (\(A_{1}\) and \(A_{2}\)), starts after \(T_{D}\) and has a rise and fall time (\(T_{R}\) & \(T_{F}\)), which default to the transient simulation step size.
PW and PER refer to the pulse width and the period respectively. These values default to the transient simulation stop time when not specified.
Amplitudes must be finite. Delay, rise time, fall time and width must be finite and nonnegative; the period must be finite and strictly positive. Zero rise/fall times give instantaneous edges. Zero width gives a triangular pulse when the edges are nonzero. At each period boundary, the waveform restarts from its rise. At most seven arguments are accepted. Resolve pulse edges and the period with the internal timestep; a finite sampled value does not establish adequate sampling.
Sinusoidal
sin(\(A_{O}\) \(A\) [\(f\) [\(T_{D}\) [\(\theta\) [\(\phi\) [\(N_{C}\)]]]]] )
A source that generates a (optionally damped) sinusoidal signal with DC offset \(A_{O}\) and amplitude \(A\) at frequency \(f\) (Hz). If omitted, \(f\) defaults to \(\frac{1}{T_{STOP}}\).
\(T_{D}\) is a start delay: for \(t<T_{D}\) the output is held at \(A_{O}\).
\(\theta\) is an exponential damping factor (units \(s^{-1}\)). When \(\theta=0\), no damping is applied.
\(\phi\) is supplied in degrees and converted internally by \(\phi=\phi_{\deg}\pi/180\).
If \(N_{C}\) is provided and \(N_{C}\) \(>0\), the sinusoid runs for that many cycles and then stops, returning to the offset \(A_{O}\) for all subsequent times.
The function generates a data point for each step in the transient simulation based on the following piecewise definition (let \(\tau=t-T_{D}\)):
Notes:
- If \(N_{C}\) is omitted (or \(\le 0\)), the sinusoid continues for the full simulation duration.
- If \(N_{C}\) \(>0\), \(f\) must be positive to define the stop time.
SINandSINEare aliases. Positive fractional cycle counts specify the corresponding fraction of a period. At the stop time output returns to the offset, including when a nonzero phase makes that return discontinuous.- For
SINE(0 315u 4g 20p 0 0 4), the stop is 1020 ps.
Custom Waveform
cus( wavefile \(T_S\) [SF IM \(T_D\) PER] )
The file contains one line of finite, space-separated amplitude samples. Relative paths use the input netlist's directory, or the current directory for a bare filename or standard input. Samples are multiplied by SF (default 1).
Sample \(k\) occurs at \(T_D+kT_S\). \(T_S\) must be finite and positive; it is not stretched when the simulation uses a coarser step. Choose a simulation step small enough to resolve the input waveform. Before \(T_D\) (default 0), the output is zero.
IM selects a hold (0), linear interpolation (1, default), or a natural cubic spline (2, requiring at least three samples). Linear and cubic methods pass through the stored samples. The last sample is held for one final interval. For \(N\) samples the duration is \(NT_S\): at its end the waveform returns to zero, or repeats from its first sample when PER=1. Repetition is measured from \(T_D\); it does not enforce derivative continuity at a period boundary. PER must be 0 (default) or 1, and \(T_D\) must be finite and non-negative.
DC
dc \(A\)
A DC source that is always at \(A\) at any given time during the simulation.
Noise
noise(\(A\) \(T_{D}\) \(T_{STEP}\))
The source is zero before \(T_D\). \(A\) is a one-sided amplitude spectral density in A/sqrt(Hz) or V/sqrt(Hz). \(T_{STEP}\) is the Gaussian update interval, limited to at least the internal simulation timestep. If omitted, it is \(1/(3NEB)\) before that floor. The independent values at update points are
\(f(t) = A\frac{GRAND()}{\sqrt{2T_{STEP}}}\)
\(GRAND()\) is a unit-variance Gaussian sample. Values between update points are linearly interpolated, giving time-averaged variance \(A^2/(3T_{STEP})\) and a smooth spectral rolloff. Grid-point variance differs. See the noise guide for sampling and bandwidth conventions.
Exponential
exp( \(A_{1}\) \(A_{2}\) \(T_{D1}\) \(\tau_{1}\) \(T_{D2}\) \(\tau_{2}\))
| Parameter | Default |
|---|---|
| \(T_{D1}\) | 0.0 |
| \(T_{D2}\) | \(T_{STEP}\) |
| \(\tau_{1}\) | \(T_{STEP}\) |
| \(\tau_{2}\) | \(T_{STEP}\) |
The omitted delay/constant defaults above are independent. In particular, TD2 remains TSTEP when TD1 is supplied. Specify both delays and positive time constants explicitly when preparing a delayed rise/fall waveform.
Returns different values for the 3 different time segments.
For \(t < T_{D1}\):
\(f(t)=A_{1}\)
For \(T_{D1}\le t < T_{D2}\):
\(f(t) = A_{1}+(A_{2}-A_{1})(1-e^{-\frac{t - T_{D1}}{\tau_{1}}})\)
For \(T_{D2} \le t\):
\(f(t) = A_{1}+(A_{2}-A_{1})(1-e^{-\frac{t - T_{D1}}{\tau_{1}}})+(A_{1}-A_{2})(1-e^{-\frac{t - T_{D2}}{\tau_{2}}})\)
Piecewise Sinusoidal (PWS)
pws(\(T_{0}\) \(V_{0}\) \(T_{1}\) \(V_{1}\) ... \(T_{N}\) \(V_{N}\) )
A source that generates a smooth, sinusoidally-interpolated waveform through a series of user-defined time/value points, similar to pwl(...) but using a sinusoidal spline between each adjacent pair of points instead of linear interpolation.
Each point is specified as a time/value pair \((T_i, V_i)\). Time values must be strictly increasing.
- For \(t < T_0\), the output is held at \(V_0\).
- For \(t \ge T_N\), the output is held at \(V_N\).
- For \(T_i \le t < T_{i+1}\), the output transitions smoothly from \(V_i\) to \(V_{i+1}\) using a half-cosine (sinusoidal easing) segment.
Let \(u=\dfrac{t-T_i}{T_{i+1}-T_i}\) for the segment \(i\), where \(0 \le u < 1\). The output is:
This interpolation is continuous and has zero slope at each specified point, producing smooth joins at breakpoints.
Notes:
- The final value is held constant after the last timestep \(T_N\).
- Duplicate or non-increasing time values are invalid and may result in errors.
Control Commands
The simulation engine requires control commands to know what to do with the components it has just been provided with.
The most important of these control commands is the transient simulation command as no simulation can be performed without it.
Transient Analysis
.tran \(T_{STEP}\) \(T_{STOP}\) [\(P_{START}\) [\(P_{STEP}\) [\(P_{WINDOW}\)]]] DST
For effective step \(h\), JoSIM computes \(N=\lfloor T_{STOP}/h\rfloor\) samples at \(t_k=kh\), \(k=0,\ldots,N-1\). The stop time itself is not an extra sample. Step and stop time must be finite and positive, with at least one supported sample.
\(P_{START}\) selects the first output sample on or after that time. It must not exceed the last computed sample. \(P_{STEP}\) is the print interval. If it is smaller than the requested simulation step, the CLI reduces the initial step to match it. Keep both settings fixed when comparing numerical or noise runs.
If \(P_{WINDOW}\) is specified and not 0, a Hanning FIR filter with a window width of \(P_{WINDOW}\) seconds is applied to the output data before decimating as a post-processing step. This can be used to low-pass filter the output to prevent aliasing when decimating with \(P_{STEP}\), e. g. to create an IV curve of the whole circuit.
Print targets are \(P_{START}+nP_{STEP}\), selecting the first available internal
sample at or after each target. A few floating-point ulps at an exact grid tie
are treated as equal. Integer step ratios therefore retain a uniform print
grid without accumulated rounding jitter. A fractional ratio generally selects
nonuniform internal samples; use the recorded timestamps for such data.
Verbose mode (-V 1 or higher) reports the effective internal timestep and
computed sample count after any full-run timestep reduction.
The FIR window must be finite and non-negative; widths longer than the run are clamped to its duration. An output window containing no computed samples is an error, including when \(P_{START}<T_{STOP}\) but lies after the last grid point.
DST disables the start-up time. The start-up time is a period calculated internally by the simulator in which components settle. This is equivalent to the few picoseconds from when a circuit initially receives power (power switch flipped).
Subcircuits
Subcircuits allow subdivision and reuse of smaller circuits within a larger design. When wrapped in a subcircuit control devices are allowed to have the same label names as specified elsewhere in the netlist as the subcircuit completely isolates them.
Subcircuits have the following wrapping control syntax
.subckt SubcktName IO Nodes
...
.ends
The SubcktName specifies the name of the subcircuit and IO Nodes specify the which nodes within the subcircuit connects to outside.
A subcircuit can be used in the main netlist or another subcircuit (nesting) using the following syntax
XLabel SubcktName IO Nodes (JSIM mode)
XLabel IO Nodes SubcktName (WRspice (normal SPICE) mode)
Named parameters can be supplied on each instance, with optional defaults in
its .subckt header. PARAMS: is optional. Spaces around = and expressions
in braces are accepted.
.param BASE=10
X1 CELL A 0 RES={BASE*2}
X2 B 0 CELL RES=5
I1 0 A 1
I2 0 B 1
.subckt CELL IN RET PARAMS: RES=10 SCALE=2
.param TOTAL=RES*SCALE
R1 IN RET TOTAL
.ends
The two resistances are 40 ohm and 10 ohm. An instance override is evaluated in
the caller's environment before binding the child; RES={RES*2} uses the
caller's RES. Other assignments on the same instance are not visible while
its override expressions are evaluated. The child's defaults and local .param
expressions then resolve using the bound values. Lookup proceeds from that
instance through its containing instances to global parameters. Local names
shadow inherited names; each instance remains independent. Undefined names and
parameter dependency cycles fail with a parsing diagnostic.
An override can introduce a local name without a header default, as in
X1 CELL A 0 RES=10 with R1 IN RET RES in CELL. Prefer explicit defaults
when a reusable circuit has a useful default value. Numeric local definitions
are evaluated when instantiated or requested by a model IV command. Structural
subcircuit cycles and unknown child types are rejected even in unused definitions.
Legacy component-label overrides also remain available: X1 CELL A 0 R1=5
replaces the value of resistor R1. A nested label uses inside-to-outside order,
such as R1|XCH=5. This applies to R/L/C/K values, E/F/G/H gains, T delay, and
an existing B AREA= or IC= assignment. An explicitly declared parameter of
the same name takes precedence over this legacy shortcut. Duplicate assignments
on one header or instance are errors; a later separate .param declaration
replaces an earlier expression with a warning.
Local JJ models are evaluated separately for each instance. Model lookup checks that instance, then containing instances, then globals. A local model always shadows a global model of the same name. Parameter values are never substituted into node names, filenames or model identifiers.
Noise
As mentioned in the technical discussion, noise can be automatically inserted as current sources in parallel to each resistor. This thermal noise temperature and bandwidth can be specified globally using the following commands:
.temp Temperature in Kelvin
.neb Bandwidth in Hertz
Temperature must be finite and non-negative; bandwidth must be finite and
positive. Local TEMP=/NEB= settings override the globals. TEMP=0 disables
classical thermal noise for that component. The default bandwidth is 1 THz.
Junction thermal noise uses the active resistive slope, with the explicit
local-equilibrium limits described in the noise guide.
Spread
JoSIM allows each value of inductors, resistors, capacitors and JJ (area/Ic) to be spread uniformly within a specified percentage range from the nominal value. Each time the value is used (in matrix creation), a new random value from the uniform distribution is chosen.
This allows for process variation to be simulated.
To set the spread globally, the following control needs to be set:
.spread Normalized percentage [L=Inductor spread] [B=JJ spread] [C=Capacitor spread] [R=Resistor spread]
Each individual component can also be spread by adding the spread= named parameter to the component declaration line.
The order of precedence is taken as local, specific global and then global. This means that if a global spread exists but a global inductor specific spread also exists and the inductor being added has a local spread then the local spread will take precedence.
An example:
If an inductor has a value of 2pH, this is its nominal value. If a local spread of 0.2 is specified this means a random value can be chosen anywhere between 1.6pH and 2.4pH. If global inductor specific spread is specified as 0.3 and the local spread is not defined, the value can be anything within the range 1.4pH - 2.6pH. Similarly if the global spread is defined as 0.5 then the value each time the simulation is run can be anywhere between 1pH and 3pH.
Reproducibility
For both noise and spread a random number generator is seeded upon creation of the input object. This is done to enable non-deterministic noise/spread. However, in some cases the user might wish to produce deterministic noise/spread between runs. To enable this a .option seed= has been added. An integer seed value can be specified to obtain deterministic noise/spread. Additionally, the current auto-seeded run's seed can be obtained using verbose mode (-V 1).
An example:
.option seed=4190754512324517577
IV Curve
JoSIM allows the user to output an IV curve for a specified JJ model within the netlist using the following command:
.iv modelname max_current filepath [STEP=current] [GTJJ=voltage] [TSTEP=time] [TSTOP=time] [TSTART=time]
This command outputs a comma seperated value (CSV) at the filepath specified which contains the IV curve data for the modelname from negative max_current to positive max_current.
Subcircuit models can be output using . or | between the model name and
subcircuit definition name, for example .iv JM.CELL 350u iv.csv STEP=175u.
This evaluates the definition's default parameters with global fallback. It
uses no particular instance's overrides or caller environment; missing required
defaults are errors. This command draws a model IV curve, rather than sweeping
an arbitrary connected circuit.
STEP (alias ISTEP) is the positive current increment, default 2.5 µA.
GTJJ supplies a physical gate voltage. TSTEP selects the initial internal
step (default 0.05 ps), TSTOP the duration (default 500 ps), and TSTART the
averaging start (default half the selected duration). Timing values use seconds
and engineering suffixes. Require TSTEP > 0 and TSTOP > TSTART >= 50 ps,
with at least two actual averaging samples. Every point starts with fresh device
histories and its specified 0/10/50 ps bias ramp. The mean uses unfiltered internal
samples from TSTART; retries may reduce the step. -V 1 reports the effective
grid. These finite transients require model-specific settling and convergence
checks; see model IV versus circuit sweeps.
Output
A simulation is meaningless unless the results are post processed. In order to know which of these results are relevant for storage the simulator needs output control commands.
These output commands can be of either
.print .plot .save
Any of these commands can be followed by either of the following commands
PrintType Device or Node
PType(Device or Node)\(_0\) ... PType(Device or Node)\(_n\)
Where PrintType can be either device voltage (DEVV), device current (DEVI), device phase (PHASE), node voltage (NODEV) or node phase (NODEP).
When specifying a device type store only a single device can be specified, but when a node type store is specified 2 nodes can be specified to store the difference between them.
PType is shorthand for the above and can have multiple per line requests. PType can be either of V, I (or C) or P followed by the device or node in brackets. If more than one device or node is specified by comma seperation (maximum 2) the difference between the two devices or nodes is stored.
An additional save type exists that has the following syntax
@Device[PType]
This stores the PType of the device specified.
Subcircuit parameters can be output using the .(period) or |(vertical bar) as separator between the device label and the subcircuit label name.
i.e. .print v(14.X01) p(B01.X02)
This method follows the path from inside to out when nested subcircuits are used.
Declared pin aliases are supported as well as internal nodes and components.
For example, V(IN.X1) addresses pin IN of instance X1, and
V(IN.X2.X1) addresses its nested instance X2. Ground pins produce a zero
trace when connected to ground. V(0,N) is the negative of V(N).
Unknown devices, nodes, aliases and malformed output requests are errors.
Requested traces are never silently discarded. C(R1) is an alias for
I(R1). Device differences such as V(R1,R3), P(B1,B2) and I(R1,R3)
subtract the two physical traces after applying the same output sampling/filter.
General arithmetic expressions over output vectors remain unsupported.
Subcircuits as mentioned before can also be nested almost indefinitely as they are expanded upon simulation.
If the label is not immediately apparent and required for output, the simulation can be run using the -V 3 cli option to show the expanded main design, allowing the exact label name to be identified.
File
Multi-file output can be achieved by separating output commands with the following command:
.file filepath
This indicates that every output request that follows this command needs to be stored in the file specified by filepath.
I.e.
.file output1.csv
.print p(B1) p(B2) p(B3)
.file output2.dat
.plot i(L01) i(L02) i(L03)
.file output3
.save v(1) v(2) v(3)
This will create 3 output files. The first will be a CSV file containing only the phase outputs. The second file will be a space separated file containing only the currents. Lastly, the third file will be in a SPICE RAW format and contain only the voltages.
The use of this command does not affect the command line option request to output a file. The command line output option, if requested, will output an additional file which contains all of the output requests (phase, current and voltage).
Parameters
The final control command that is of importance in JoSIM is the parameters command with the following syntax
.param VarName=Expression
VarName is the variable name that can be used anywhere else in the circuit and Expression is a mathematical expression that is evaluated using an implementation of Dijkstra's shunting yard algorithm, whereby the expression is converted into reverse polish notation (RPN) and evaluated.
Additionally, expressions can also contain other variables and parameters will be continuously evaluated until all variables are reduced to values. If variables are not defined the program will halt and produce an error.
Numeric literals support decimal/scientific notation (1E-3, 1e-3, 1.E-3)
and case-insensitive SPICE engineering suffixes. M or m means milli;
MEG means mega. The remaining suffixes are T, G, K, U, N, P and
F. ASCII unit labels may follow a suffix, such as 2mV.
Expressions support +, -, *, /, ^, matching (), [] or {},
unary signs, and the documented mathematical functions. Exponentiation is right
associative and precedes a leading unary sign: 2^3^2 is 512, -2^2 is -4,
and 2^-3 is 0.125. Function calls bind before a following power. LOG is the
natural logarithm and LOG10 is base ten. Evaluated expressions must produce
finite real values; missing operands, invalid function arguments and mismatched
brackets produce parsing errors.
Parameter expressions resolve local names first and then global names for every
operand. Undefined names and dependency cycles fail with a diagnostic. Component
and source parsers that accept parameter expressions use the same evaluator;
when an expression contains spaces, define it with .param and use its name so
that component fields remain unambiguous.
Control Block
Any of the above controls can be wrapped inside a control block with the following syntax
.control
...
.endc
Wherein all controls can be specified by omitting the usual prepending .(period) to the command.
This block, though seemingly useless at present, will be used for more advanced functionality in the future.
Include
JoSIM allows the use of a .include control card that uses the following syntax
.include relative_path_to_file
This command reads in the contents of the relevant file pointed to by the relevant path upon parsing of the netlist essentially extending the netlist by the linked file. This is incredibly handy when large subcircuits are involved and reuse of subcircuits across multiple files is required.
This can also be used to house all the models used in simulation allowing a central point of alteration if the model is changed.
Standard Input
JoSIM now allows input from standard input allowing a line-by-line read in of a netlist until the .end card is found or alternatively the EOF character is returned.
Constants
JoSIM has a set of built in constants that when used expand to the corresponding values. Below is a list of these constants and their values. The constants names are case insensitive:
| Constant | Symbol | Value |
|---|---|---|
| PI | \(\pi\) | 3.141592653589793238463 |
| PHI_ZERO | \(\Phi_{0}\) | 2.067833831170082E-15 |
| BOLTZMANN | \(k_{B}\) | 1.38064852E-23 |
| EV | \(e\) | 1.6021766208E-19 |
| HBAR | \(\bar{h}\) | 1.0545718001391127E-34 |
| C | \(c\) | 299792458 |
| MU0 | \(\mu_{0}\) | 12.566370614E-7 |
| EPS0 | \(\epsilon_{0}\) | 8.854187817E-12 |
| SIGMA | \(\sigma\) (short for \(\frac{\Phi_{0}}{2\pi}\)) | 3.291059757E-16 |
Further reading
- I. Salameh, E. G. Friedman and S. Kvatinsky, "Superconductive Logic Using 2ϕ—Josephson Junctions With Half Flux Quantum Pulses," in IEEE Transactions on Circuits and Systems II: Express Briefs, vol. 69, no. 5, pp. 2533-2537, May 2022, doi: 10.1109/TCSII.2022.3162723. -S. V. Bakurskiy et al., "Current-phase relations in SIsFS junctions in the vicinity of 0-\(\pi\) Transition", Phys. Rev. B Condens. Matter, vol. 95, pp. 94522-94528, Mar. 2017.