ALIGN is an open-source generator that turns a SPICE netlist into a layout. We have been porting it to SkyWater’s sky130 PDK, driven from Xschem. Our port turns a four-transistor NAND2 into a sky130 layout that passes every DRC and LVS check in about seven seconds. The layout is 130 µm², 35 times the 3.75 µm² of the PDK’s own nand2_1. One of its four transistor cells, at 8.76 µm², is larger than the whole standard cell.
This post takes that layout apart and traces each lost micron to the code that costs it, and to the reason that code exists.
In Spectre you have always been able to write save x1.x2.m3:d and get the current into the drain of a transistor buried two levels down. ngspice had no such thing. Our ngspice branch now does: .probe I(x1.x2.m3,d) saves the current into any terminal of any instance, at any depth, in every analysis.
The gap
ngspice had three ways to get at a terminal current, and none of them was the real thing:
.probe I(m1,d) worked for instances at the top level only. Name anything inside a subcircuit and the probe was dropped with a warning.
Device parameters such as @m.x1.x2.m3[id]. Their names change from model to model, and they are operating-point quantities, so an AC analysis gives you the bias current, not the small-signal current. They are also read from the Newton iterate before the last, so they agree with the solution only within the solver's tolerance.
A hand-placed 0 V source inside the subcircuit. It works, but it edits the subcircuit, so every instance of it gets a source. Every probe you move means another edit.
Here is what the previous build said about a deck that asks for four currents inside a hierarchy:
Warning: Node o is not available for device x1,
.probe i(x1,o) will be ignored
Warning: Could not find the instance line for x1.r1,
.probe i(x1.r1) will be ignored
Warning: Could not find the instance line for x1.x2,
.probe i(x1.x2,s) will be ignored
Warning: Could not find the instance line for x1.x2.m3,
.probe i(x1.x2.m3) will be ignored
What it looks like now
The same deck: an amplifier x1 holding a resistor, a second-level instance x2 with one NMOS, and a resistor to ground.
* terminal currents two levels down
vdd vdd 0 dc 2
vg g 0 dc 1.5
x1 vdd g out amp
rl out 0 10k
.subckt amp p in o
r1 p o 1k
x2 in o mid stage
r2 mid 0 2k
.ends
.subckt stage i d s
m3 d i s 0 nmod w=2u l=1u
.ends
.model nmod nmos level=1 vto=0.5 kp=100u
.probe I(x1.x2.m3) I(x1.x2,s) I(x1.r1) I(x1,o)
.control
op
print i(x1.x2.m3:d) i(x1.x2.m3:g) i(x1.x2.m3:s) i(x1.x2.m3:b_tj)
print i(x1.x2:s) i(x1.r1) i(x1:o)
.endc
.end
I(x1.x2.m3) with no terminal gives all four. The four sum to −1.2e-19 A, so KCL closes to rounding. The port x1.x2:s carries exactly the source current, because nothing else is on it. Inside x1, the 248 µA through r1 splits into the 73 µA the drain takes and the 175 µA that leaves through port o into the load.
Writing a probe
.probe I(instance,terminal) * or I(instance:terminal)
.probe I(instance) * every terminal of it
The instance is its hierarchical path, x1.x2.m3, or its name in the flattened circuit, m.x1.x2.m3.
The terminal is a position counted from 1, a device letter (MOS d g s b, BJT c b e s, JFET d g s, diode a and c or k), the name of a subcircuit port, or the terminal name a Verilog-A model gives it.
Two spellings of one terminal are one probe and one vector: I(x1.x2.m3,1) and I(x1.x2.m3:d) are the same thing.
The vector is <path>:<terminal>#branch, which you read as i(x1.x2.m3:d). The terminal part is the name .probe has always used at the top level, so moving a block into a subcircuit only puts the path in front. Nothing in your scripts gets renamed.
Device
Terminal names, in order
MOSFET (M)
d g s b_tj (and tc n6 n7 on models with more nodes)
BJT (Q)
c b e s t
JFET, MESFET (J, Z)
d g s
Diode (D)
a c
Subcircuit instance (X)
the port names of the subcircuit
Verilog-A / OSDI (N)
the terminal names of the model
everything else
n1 n2 …
b_tj looks odd, but it is the name ngspice's .probe has always given the fourth node of an M line, and keeping it means old decks and new ones agree. You can still type b or 4; only the saved name follows the table.
Which way is positive
A probe gives the current into the terminal, flowing from the net into the instance. The four terminals of a MOSFET sum to zero, and a negative port current means current is leaving the instance there.
The one exception is an instance with two terminals and no terminal named, such as I(x1.r1). That gives one vector named after the instance, the current through it from its first terminal to its second, the same convention .probe has always used at the top level. For a subcircuit with two ports and a path to ground inside, the two ports carry different currents. In that case, name the port you mean.
AC and transient too
The probe is an ideal 0 V source in the circuit, so its current is the solution itself, in op, dc, ac and tran. In AC it is the complex small-signal current. Here is a capacitor inside an RC subcircuit, compared with ωC·|v|:
vin in 0 dc 0 ac 1
x1 in out filt
.subckt filt a b
r1 a b 1k
c1 b 0 1u
.ends
.probe I(x1.c1)
.control
ac dec 1 10 100k
print mag(i(x1.c1)) mag(2*pi*frequency*1u*v(out)) vp(i(x1.c1))
.endc
Verilog-A devices loaded through OSDI work the same way, and they use their model's own terminal names. With PSP 103 compiled by OpenVAF, .probe I(n1) gives n1:d, n1:g, n1:s and n1:b, and I(xa.n2,d) reaches one inside a subcircuit.
How it works
The probe as the simulator sees it. The source changes nothing in the circuit; its branch current is the terminal current.
When the reader expands the subcircuits, it puts the probed terminal on a new node and inserts a 0 V source between that node and the net, with the net as the positive side. Ports of subcircuit instances are handled during the expansion itself, and device terminals afterwards, in the flattened netlist. After the circuit is built, the source is renamed after the terminal and its branch current is added to the save list. The new node is kept out of .save all, so your vector list shows the currents and not the nodes they needed.
Because no device code is involved, every built-in or Verilog-A device gets this for free. The probes are written into the stored copy of the deck, so they come back after reset. The machinery is shared with the stb loop-gain analysis, which uses the same kind of terminal probe. When both are on one terminal, they get two sources in series, and the loop gain is unchanged.
How exact
The current is the solution, so KCL holds to rounding: a resistor's probe agrees with (v(a)−v(b))/R to 1e-15 A, and a MOSFET's terminals sum to about 1e-19 A.
Device parameters such as @m.x1.x2.m3[id] are read from the iterate before the last, so they match the probe only within the Newton tolerance. In our tests a BJT's @ic was 0.055 % off the probe current.
A terminal current includes everything the model stamps there. The MOSFET bulk above shows −1.9 pA: that is the gmin of its junctions, not a bug.
Where to get it. This is on our ngspice branch, not in upstream ngspice. The behaviour at the top level is unchanged: existing .probe decks give the same vectors under the same names. Scripts and schematic tools can check for the feature with $?probe_version, which is 1 in a build that has it.
Limits
vd() and p() in .probe (voltage differences and power) still work at the top level only.
.probe alli still covers the top level only; a terminal inside a subcircuit needs its own I(…).
Probes are made when the deck is read. You cannot add one from the command prompt afterwards.
XSPICE code-model instances, couplings (K), and E/G sources with an expression are refused with a one-line reason. For those, place a 0 V source yourself.
Tested in the ngspice executable. The shared-library build (libngspice) has not been exercised yet.
How it was tested
Every behaviour started as a failing test. A new regression suite of 14 decks checks currents against hand-solved circuits: the hierarchy, every spelling of a terminal, the same block at two depths, two-port subcircuits, refusals, reset, what gets saved, sharing a terminal with stb, alli, and the unchanged top level, in op, AC and transient, plus the version variable. Two more decks check the case-sensitive netlist modes. The full ngspice regression and model-QA suite still passes, with one known failure in an unrelated rusage test that predates this work.
In lsbuflv2hv_1, net a_686_151# is the source of both LV inverter NMOS and the ground of the five HV pull-downs of a_1197_107#, and touches nothing else; a_1606_563# is the source of the cross-coupled PMOS that pulls a_504_1221# up, and appears once. So a_504 can only be pulled down and X sits at VGND for any A. In lsbufhv2lv_1, a_30_443# and VPWR each appear once. In ngspice (45.2 and a current build, open_pdks models, tt, LVPWR 1.8 V, VPWR 3.3 V) the upstream netlist gives X = 9 nV for both input levels; your open_pdks netlist gives 0 / 3.3 V with 1.2 ns / 0.7 ns delays. The cell is not mis-matching, it is dead, and it dies quietly: the file is complete, loads with no warning, and in a mixed-signal block it looks like a design bug. We lost most of a day to it.
How we got the bad file: our design environment had no open_pdks sky130 install at the time, so the 69 per-cell .spice files were pulled from the library repository on GitHub and concatenated, on the (checked, 67-of-69-true) assumption that this is what open_pdks installs. Today the same files come from git clone of skywater-pdk-libs-sky130_fd_sc_hvl (main = branch-0.0.3 = 4fd4f858), from git clone --recursive google/skywater-pdk (the latest submodule is pinned to that commit), from the googlesource mirror, and from raw downloads. The library repository is archived, so none of that will change on its own, and #349 is still open with a title that does not say "do not simulate with this file".
The request: you are the person whose word on this carries, and open_pdks is where people who got burned will look. Would any of these be reasonable?
1. A sentence in the open_pdks sky130 README (or the install log) saying that the .spice files shipped in the skywater-pdk library repositories are not the ones open_pdks installs, that the two hvl level shifters are broken upstream, and that the open_pdks-generated libs.ref/sky130_fd_sc_hvl/spice deck is the one to use.
2. A closing comment on #349 and #305 stating the same, so the search result people land on says it plainly. I am happy to post the simulation evidence there myself if that helps (I have it written up).
3. If you know who at Google or SkyWater can still touch the archived repository or skywater-pdk-docs, a README line in cells/lsbuflv2hv and cells/lsbufhv2lv pointing at open_pdks.
If a lint is of any use for the open_pdks install: inside a .subckt, any net that appears on exactly one device terminal, or that is touched only by MOSFET terminals and has no path to a port, flags both cells and nothing else in that library.
Thank you for open_pdks, magic and netgen, and for having had the right answer on this five years ago.
GlobalFoundries 180 nm MCU, variant D (open_pdks gf180mcuD, BSIM4). Corner typical / res_typical; mismatch via sw_stat_mismatch=1 (per-instance ΔVT and Δβ in the fets_mm wrappers). Every number below is simulated from the vendored models with plain ngspice decks, typical corner, 27 °C; the Monte-Carlo columns use the PDK's own per-device mismatch model with 30 samples. Click a column header to sort (first click ascending, second descending); click the # header to restore the original order. Devices marked † could not be simulated at the standard 10/0.5 and 0.5/2 geometries; the geometry used is listed under the table.
FETs
#
Device
Type
Lmin (µm)
Wmin (µm)
VDS max (V)
VGS max (V)
Vth (V)7
gm,in (µS)1
gm,mir (µS)2
AVT (mV·µm)3
fT (GHz)4
σ ΔI/I mirror (%)5
σ Vos pair (mV)6
1
nfet_03v33.3 V NMOS
NMOS
0.28
0.22
3.60
3.60
0.71
161
7.0
7.4
2.03
5.1
3.3
2
pfet_03v33.3 V PMOS
PMOS
0.28
0.22
3.60
3.60
-0.79
110
3.5
6.9
0.99
2.4
3.2
3
nfet_05v0†5 V NMOS (same model as 06v0)
NMOS
0.60
0.30
5.50
5.50
0.71
155
6.5
19.0
2.46
6.3
7.5
4
pfet_05v05 V PMOS
PMOS
0.50
0.30
5.50
5.50
-0.82
110
2.9
14.1
1.53
2.7
6.5
5
nfet_06v0†6 V NMOS
NMOS
0.70
0.30
6.50
6.50
0.72
144
6.5
16.8
1.97
6.3
6.3
6
pfet_06v06 V PMOS
PMOS
0.50
0.30
6.50
6.50
-0.82
110
2.9
14.1
1.55
2.7
6.5
7
nfet_06v0_nvt†6 V native NMOS
NMOS
1.80
0.80
6.50
6.50
-0.09
175
n/a
n/a
2.02
n/a
n/a
8
nfet_03v3_dss3.3 V NMOS, drain salicide block
NMOS
0.28
0.22
3.60
3.60
0.71
160
7.0
7.4
2.02
5.1
3.3
9
pfet_03v3_dss3.3 V PMOS, drain salicide block
PMOS
0.28
0.22
3.60
3.60
-0.79
110
3.5
6.9
0.99
2.4
3.2
10
nfet_06v0_dss†6 V NMOS, drain salicide block
NMOS
0.60
0.30
6.50
6.50
0.71
158
6.5
19.0
2.56
6.3
7.5
11
pfet_06v0_dss6 V PMOS, drain salicide block
PMOS
0.50
0.30
6.50
6.50
-0.82
110
2.9
14.1
1.55
2.7
6.5
† Geometry actually simulated (W/L in µm) where the standard 10/0.5 and 0.5/2 devices are not allowed: nfet_05v0: input-pair device 10/0.6 (Lmin / Wmin); nfet_06v0: input-pair device 10/0.7 (Lmin / Wmin); nfet_06v0_nvt: input-pair device 10/1.8, mirror device 0.8/2 (Lmin / Wmin); nfet_06v0_dss: input-pair device 10/0.6 (Lmin / Wmin).
Notes
gm of one input-pair device, W = 10 µm, L = 0.5 µm (the geometry listed under † where the model does not allow that), ID = 10 µA, VDS = half the nominal supply of the device's gate class (1.65 V, 2.5 V, 3 V), VSB = 0, 27 °C; dID/dVGS from a 1 mV dc sweep.
gm of one current-mirror device, W = 0.5 µm, L = 2 µm (or the † geometry), diode-connected, ID = 1 µA. Blank when the device cannot work as a diode-connected mirror (zero-VT or depletion device: VDS = VGS leaves it in triode).
Pelgrom coefficient for the threshold: σ(ΔVT) of two input-pair devices (geometry of note 1) times √(W·L), from 30 Monte-Carlo mismatch samples (ΔVT read from the model's operating-point vth). With 30 samples a σ carries about ±13 % (1σ) statistical error; the last section compares the samples with the model's own mismatch parameters.
Transit frequency of the input-pair device at the bias of note 1: frequency where |id/ig| = 1 in a small-signal sweep (drain at fixed VDS, source and bulk on the rail).
Current-mirror error: two 0.5/2 devices at 1 µA (the "gm·ΔVGS" of a mirror), master diode-connected, slave at the same VDS; σ of (Islave − Imaster) / Imaster over 30 mismatch samples.
Input offset: σ(ΔVGS) of two input-pair devices at 10 µA each (geometry of note 1), the number a differential pair of this size would show as random offset.
Threshold voltage as the model reports it at the operating point of note 1 (BSIM4 / PSP vth of the 10/0.5 device, VSB = 0, so it includes the model's drain-induced shift at that VDS); PMOS values are given with their negative sign, a negative NMOS value marks a depletion-mode device.
Resistors
#
Resistor
Rsh (Ω/sq)a
TC (ppm/K)f
Wmin (µm)
Density (kΩ/µm²)b
σ ΔR/R, 1×10 µm (%)c
AR (%·µm)d
Rend (Ω)e
1
nplus_uN+ diffusion, unsalicided
59.6
1379
0.80
0.0931
n/a
n/a
3.67
2
pplus_uP+ diffusion, unsalicided
187
1406
0.80
0.291
n/a
n/a
10.0
3
npolyf_uN+ poly, unsalicided
311
-1327
0.80
0.486
n/a
n/a
8.03
4
ppolyf_uP+ poly, unsalicided
352
-65
0.80
0.550
n/a
n/a
12.0
5
ppolyf_u_1khigh-res poly 1k
1001
-853
1.00
1.00
n/a
n/a
16.8
6
ppolyf_u_2khigh-res poly 2k
2002
-1544
1.00
2.00
n/a
n/a
43.9
7
ppolyf_u_3khigh-res poly 3k
3004
-1544
1.00
3.00
n/a
n/a
62.6
8
nwelln-well
1051
2615
1.20
0.730
n/a
n/a
50.3
9
ppolyf_sP+ poly, salicided
7.36
3237
0.80
0.0115
n/a
n/a
1.00
10
rm1metal 1
0.0906
3308
0.23
0.0017
n/a
n/a
0
Notes
Sheet resistance from the model: R at W = 10 µm for L = 20 and 40 µm, Rsh = ΔR·W/ΔL, 27 °C, typical corner. A device at Wmin reads higher by the model's width bias (ΔW), up to +30 % for the n-well resistor.
Resistance per unit body area at the minimum width: Rsh / Wmin² (ends, contacts and spacing not included). Highest = densest.
Mismatch of two identical resistors, W = 1 µm (or Wmin), L = 10 µm, σ of ΔR/R over 30 Monte-Carlo mismatch samples.
Area-normalised matching: the σ of note c times √(W·L), so σ(ΔR/R) ≈ AR/√(W·L) for another size. Lowest = best matching.
End resistance per device from the same two lengths: R(L) ≈ Rsh·L/W + Rend (heads, contacts, salicide transitions).
Span temperature coefficient of the sheet resistance, (Rsh(125 °C) − Rsh(−40 °C)) / (Rsh(27 °C) · 165 K), from the same wide devices; the models carry a quadratic term, so the local slope is lower at the cold end and higher at the hot end.
Ratings, sizes and what is not here
Voltages: nominal 3.3 V and 5 V / 6 V supplies with a 10 % overshoot allowance; the design manual caps the DC gate-to-any-node voltage at 3.63 V for thin oxide and 6.5 V for the thick-gate devices. The table lists nominal + 10 % (3.6 / 5.5 V) and 6.5 V for the 6 V devices.
Lmin/Wmin are the model binning limits (lmin/wmin in the vendored BSIM4 bins): 0.28 / 0.22 µm (3.3 V), 0.6 / 0.3 µm (5 V NMOS), 0.7 / 0.3 µm (6 V NMOS), 0.5 / 0.3 µm (5 V and 6 V PMOS), 1.8 / 0.8 µm (native). nfet_05v0/pfet_05v0 share the 6 V models (Appendix A of the design manual); they differ by the V5_XTOR mark and the shorter allowed L.
_dss = the same FET with a salicide-block (SAB) drain extension (3.78 µm NMOS / 2.78 µm PMOS on the drain, 0.28 µm on the source) for drain-voltage robustness; electrically identical here except the series drain resistance. The 10 V LDMOS (nfet_10v0_asym) has a symbol but no model in the vendored set and is not characterised. The native has no mismatch model, and its mirror cells are blank because a diode-connected depletion device (VT ≈ −0.1 V) sits in triode.
Mismatch parameters: the fets_mm wrappers put σ(VT) = par_vth/√(Leff·Weff) with Leff = L − 0.15 µm (0.4 µm for the 5 V / 6 V FETs) and Weff = W + 0.1 µm (0.5 µm), par_vth 7.1 / 6.7 mV·µm (3.3 V n / p), 11.6 / 10.5 (5 V and 6 V n / p). Normalised to drawn W·L that predicts AVT 8.5 / 7.9 (3.3 V) and 19.5 / 17.2 / 16.3 (5 V n, 6 V n, p); the 30-sample values sit 3–13 % below. The 0.4 µm length offset is why the same 6 V model reads 19.0 at L 0.6 and 16.8 at L 0.7.
Resistor Wmin: PRES.1 / LRES.1 = 0.8 µm (unsalicided P+/N+ poly), HRES.2 = 1.0 µm (1k/2k/3k high-res poly); for the diffusion, n-well, salicided poly and metal resistors no device rule was found and the PDK symbol default (0.8 / 1.2 / 0.8 / 0.23 µm) is used. GF180's vendored models carry no resistor mismatch model (the mis_r hook is never set), only global process σ: that column is empty.
I didn't need any documentation, and native stb in ver_53 works. The ngspice session left a user guide (README.stb), a spec of what it built, three example decks and its review notes in the tree, and I had our own acceptance kit.
- Acceptance kit: accepted, with 323 checks passing, 0 failing and 0 skipped. Older binaries skipped the 32 native checks; on ver_53 all of them now run and pass.
- Your sky130 OTA demo: native gives the same loop gain as ASE-L's current method, to rounding (8e-14). The margins match the walkthrough: UGB 13.20 MHz, phase margin 56.3°, gain margin 44.6 dB at 267 MHz.
- No probe element needed: naming a pin works, which is the extracted-view case you wanted. rm1:1 breaks the loop at the metal resistor's pin, and x1:inn at the OTA's own input; both give the same margins.
- Speed:
- On the demo there is no difference, because loading the sky130 models (about 2.5 s) dominates.
- On a large netlist, with a 20,000-node RC network added to the bench, the stb part takes about 0.2 s natively against about 1.5 s for ASE-L's two-sweep method.
- Monte Carlo: the shipped Monte Carlo example runs 100 samples cleanly, each within 0.002° of the analytic answer.
- Switching from v_52: ver_53 is ver_52 plus the stb work. ASE-L's demo suite prints identical numbers on both, so switching changes no existing ASE-L result.
What native stb doesn't do yet:
- No transistor as the probe: you name one of its pins instead.
- No differential or common-mode loops, the same as ASE-L's stb today.
- Frequency sweeps only: Monte Carlo runs through a loop in the deck.
- Not checked against another simulator: the margins have been checked against textbook closed forms and now ASE-L's own engine, but not against Spectre.
Two other findings:
- ASE-L doesn't use native stb yet. It still runs its own two-sweep method on every binary. Switching is the unbuilt plan in our private notes (CLIENT_NOTES.md §3). It would also let you pick any pin as the loop break, extracted views included.
- ver_53 isn't in your simulator list, which has only v_50 and v_52. Adding it is up to you, in Setup > Simulators.
- Unrelated to ver_53: the demo walkthrough's Monte Carlo table was measured on ver_51. On your v_52, and on ver_53, 3 of its 28 numbers differ in the last digit. The regression suite runs ver_51, so it stays green.
How our Monte Carlo drives ngspice
Which ngspice we use, what it adds to stock ngspice, and how one process runs many samples
Date
2026-11-01
Simulator
ngspice-46+, built from our development fork (branch ver_51)
Context
The Monte Carlo engine behind ASE-Integrator, our open-source take on an ADE-Assembler-style test bench manager on top of xschem
Short answer
Several long-lived ngspice processes in parallel, each looping over a list of seeds it is handed. ngspice never knows it is doing an N-sample Monte Carlo.
Which ngspice
We run an ngspice-46+ build from our own fork, branch ver_51. It reports itself as ngspice-46+. The distribution's ngspice 45.2 can simulate the same decks, but our Monte Carlo refuses to use it. That refusal is on purpose; the next section explains why.
What the fork adds to stock ngspice
A draw log (set rnddraws=<file>). This is the essential one. It records every random number drawn while the netlist is read: which parameter, which device, and what value. That lets us see each sample's per-device mismatch rather than only its outputs. Stock 45.2 has nothing like it. Our Monte Carlo refuses 45.2 with a clear message (mc_ngspice_min: "Monte Carlo needs an ngspice that writes the draw log") rather than run blind.
Seeding fixes:
The startup random stream is seeded from rndseed, not from the process id.
The draw log is closed properly when the circuit is reset.
A warning is printed once when .option seed= silently overrides setseed.
Resistor fixes: the resistor model survives ngspice's internal conversion of a resistor to a B-source. Without this, sky130's high-value resistor loses its temperature coefficient.
Many smaller fixes: case handling of node names, .save name lookup, the exit status of a batch run, an .op card with no netlist, and others. Several have been offered upstream.
One process per sample? No.
We do not launch a new ngspice per sample. One ngspice process, which we call a lane, handles a whole range of samples. Inside its .control block it loops over the seeds it has been given. For each sample:
set rnddraws=<sample dir>/draws * where this sample's draw log goes
setseed <seed> * this sample's own, literal seed
reset * re-read the netlist: mismatch is drawn fresh
set temp=<T>
op * write this sample's raw file and measures
echo ASEMC_DONE s=<seed> ... * tell the supervisor this sample is finished
unset rnddraws
destroy all * drop this sample's results from memory
The order matters, and each step is there because a measurement showed it was needed:
setseed has to come beforereset, because the mismatch values are drawn while the netlist is read.
destroy all keeps memory flat over hundreds of samples.
The ASEMC_DONE line is how the outside world learns that a sample has finished.
Several lanes in parallel
A small Python worker sits between the GUI and ngspice:
It splits the N samples into contiguous ranges across L lanes. L is the smallest of the setup's job limit, the number of CPUs and N.
Lane 1 also runs the nominal sample (sample 0), with mismatch switched off.
For example, 200 samples on a 20-core machine can be 20 ngspice processes of about 10 samples each, all running at once.
The worker supervises the lanes:
It reads each lane's log as it is written, and it records a sample (raw file, measures and draw log) the moment that sample's ASEMC_DONE line appears.
A sample that errors is marked as a simulation failure, and the lane carries on.
A lane that stops making progress is killed. Its stalled sample is marked as timed out, and a fresh lane restarts from the next sample.
The Stop button kills every lane. Unfinished samples are left pending, not half-written.
Does ngspice know it is doing Monte Carlo?
No. ngspice has no "run N Monte Carlo samples" command, and we don't need one. Each lane receives a deck whose seeds are written out as a literal list. There is no arithmetic and no counter inside ngspice. It runs the loop it has been handed, without knowing that it is a Monte Carlo or how big the whole run is.
Everything Monte Carlo-specific lives in the worker:
N, and the seed for each sample.
The split into lanes, and which sample is which.
The nominal run.
Retries, stop and progress.
The results database the GUI reads (yield, histograms, re-evaluation).
Why it is built this way
Speed: the netlist is redrawn inside one long-lived process, so there is no start-up cost per sample.
Reproducibility: every seed is explicit, and every draw is logged. Any single sample can be re-run on its own and give exactly the same numbers.
Robustness: one bad sample costs one sample, not the run. A stalled lane costs one sample, then the work continues on a fresh process.
Simplicity: ngspice does what it is good at, simulating one circuit. The bookkeeping lives in ordinary code that can be tested.
Analog Sim-Plan Finder: High-Speed & AI Hardware is a free search app over simulation plans for analog IC blocks. For every row of a block's Electrical Characteristics table it names the simulation that produces the number, with testbench, stimulus, load, PVT corners or Monte Carlo setup, measurement expression, quantitative pass criteria and the pitfalls that give a wrong number or a false pass. This edition covers the analog and mixed-signal blocks of AI training and inference hardware at a 5 nm-class FinFET profile: 224G PAM4 wireline SerDes (TX driver, CTLE/VGA, ADC-based receiver, CDR, DFE, pad/ESD network), UCIe die-to-die links, HBM4 and GDDR7 memory PHYs, 200G optical front ends (TIA, MZM/EML and micro-ring drivers), a low-jitter LC PLL and clock distribution, on-die power delivery (multiphase buck IVR, switched-capacitor converter, digital LDO, power gates, droop detector), temperature, aging and telemetry monitors, and a compute-in-memory readout. 26 blocks · 751 characteristic rows · 504 simulations · 20 methods pages; simulator-agnostic (ngspice, Spectre, HSPICE).
Simulation plans in this edition
Oscillators & Clocking: Clock Distribution Spine with Duty-Cycle Correction and Quadrature Generation (26.5625 GHz, 8 lanes) · Low-Jitter LC PLL Clock Multiplier (53 GHz LC VCO, 26.5625 GHz quadrature output for a 224G PHY).
High-Speed Wireline: ADC-Based Receiver Sampler Array (32 × 7-bit SAR slices, 106.25 GS/s) · Clock-and-Data Recovery: Phase Interpolator and Baud-Rate Loop · Decision-Feedback Equaliser Summer and Quarter-Rate PAM4 Slicers (106.25 GBd, speculative tap 1, analog taps 2–4, 26.5625 GHz slicers) · Forwarded-Clock Receiver, Duty-Cycle Correction and DLL De-skew (16–32 GHz half-rate clock for die-to-die and memory PHYs) · High-Speed Pad Network: Termination, ESD and T-coil (106.25 GBd PAM4 bump interface, 120 fF pad, ≤ 1 dB at 53 GHz) · PAM4 Transmitter Output Stage with FFE (106.25 GBd, DAC-based / SST, T-coil ESD) · Receiver Analog Front End: CTLE and VGA (56 GHz, 0–12 dB peaking) · UCIe-Class Die-to-Die Lane (single-ended, forwarded clock, 32–64 GT/s).
Memory Interfaces: DQS Strobe Path, Gating and Per-Byte De-skew (HBM4 read-strobe receiver, duty-cycle correction, DLL-referenced delay line, 2 GHz quadrature sampling phases, write-strobe launch) · GDDR7 PAM3 Transceiver (32 Gb/s per pin, 21.33 GBd single-ended, 40 Ω driver with 1-tap FFE, 48/60 Ω ODT, two-threshold receiver with AGC and data-dependent 1-tap DFE) · HBM4 DQ Transceiver (8 Gb/s single-ended NRZ over an unterminated 2–6 mm interposer channel, VDDQ 0.75 V, Vref DAC, offset cancellation, 1-tap DFE) · ZQ Impedance Calibration Engine and On-Die Termination Control (7-bit codes against an external 240 Ω resistor; 40 Ω driver and 60/120 Ω ODT for an HBM4 PHY).
Optical Front Ends: Linear MZM / EML Driver with Bias Control (200G/lane, 2.0 Vppd into 50 Ω, 65 GHz) · Linear PAM4 Transimpedance Amplifier with AGC (200G/lane, 106.25 GBd, 60 GHz) · Micro-Ring Modulator Driver and Thermal Wavelength-Lock Servo (106.25 GBd PAM4, 1.0 Vppd, 10-bit heater DAC).
Power Delivery & Monitors: 2:1 Switched-Capacitor Converter (1.2 V → 0.6 V, 2 A, 8-phase interleaved, 150 nF flying capacitance) · Digital / Hybrid LDO for PHY and Core Domains (0.90 → 0.75 V, 2 A, 1 A in 1 ns) · Multiphase Buck Integrated Voltage Regulator Tile (16 × 25 A, 100 MHz, TSV inductors, 1.8 V → 0.75 V) · On-Die Temperature Sensor (BJT Front End with Zoom ΔΣ ADC, ±1 °C after One-Point Trim at 85 °C, 0.1 °C in 10 µs) · On-Die Voltage Droop Detector with Programmable Thresholds and Hardware Trigger (0.60–0.80 V, 5 mV steps, two flags, T_DET ≤ 2 ns) · Power-Gate Header Network with Staged Wake-up (50 A domain, R_ON ≤ 0.2 mΩ, wake ≤ 1 µs) · Ring-Oscillator Aging and Process Monitor with VT-Shift Readout (BTI / HCI, stressed-versus-reference pair, 0.1 % resolvable degradation) · Telemetry ΔΣ ADC with Current-Sense Front End (12-bit incremental, 16 channels at 1 kS/s, 2 % at 25 A / 5 % at 2.5 A, ±2 mV rails).
Analog Compute (research): Compute-in-Memory Column Readout (SRAM charge-domain 8 × 8-bit MAC, 64-row accumulation, 8-bit column SAR ADC at 100 MS/s).
What each plan contains
Summary, topologies covered and design notes; ports and operating conditions; a datasheet-style table of 20–35 electrical characteristics with conditions, min/typ/max, unit and the producing simulation; and 15–22 simulations (functional, characterisation, robustness, statistical), each with purpose, testbench, stimulus, load, conditions, sweep, measures, pass criteria, pitfalls, runtime and methods references. Any block's table downloads as CSV, and the whole plan as a self-contained HTML datasheet or a PDF print.
How to use it
Click “Open Analog Sim-Plan Finder: High-Speed & AI Hardware ↗”: the finder opens in a new window. It is built from data embedded in this page, so there is nothing to install and no account; it needs a current browser (Chrome, Edge, Firefox or Safari from 2023 on). Type a symbol (PSRR, VOS, TC, PN_1M), a question (startup, settling, mismatch, jitter) or a block name, then narrow with the drop-downs for type, category, block, analysis, kind and priority. Back and Forward work, and every view can be bookmarked.
Source: GitHub repository (the plans as YAML under an MIT licence, the generated site and this finder) · hosted site and finder with the whole library. The companion edition, “Analog Sim-Plan Finder: Core Analog Blocks”, is a separate post and covers the rest of the library.