Showing posts with label cadence design systems. Show all posts
Showing posts with label cadence design systems. Show all posts

Thursday, November 19, 2026

ALIGN's Layout for a NAND Std-Cell is 35x as Large as What the Library Has

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.

Wednesday, November 18, 2026

Saving Arbitrary Terminal Currents in NGSpice - Yes, in Ver-53 (Ours:)

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:d)    =  7.294902e-05
i(x1.x2.m3:g)    =  0.000000e+00
i(x1.x2.m3:s)    = -7.29490e-05
i(x1.x2.m3:b_tj) = -1.91776e-12
i(x1.x2:s)       = -7.29490e-05
i(x1.r1)         =  2.481355e-04
i(x1:o)          = -1.75186e-04

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.

DeviceTerminal 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 elsen1 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
frequency      mag(i(x1.c1))   w*C*|v(out)|    phase (rad)
1.000000e+01   6.270819e-05    6.270819e-05    1.508047e+00
1.000000e+02   5.320180e-04    5.320180e-04    1.009814e+00
1.000000e+03   9.875705e-04    9.875705e-04    1.578312e-01
1.000000e+04   9.998734e-04    9.998734e-04    1.591415e-02
1.000000e+05   9.999987e-04    9.999987e-04    1.591548e-03

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

A 0 V source is inserted between the drain terminal d of x1.x2.m3 and its net; the probe current i(x1.x2.m3:d) flows from the net into the terminal.
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.

Friday, November 13, 2026

GF180MCU Device Cheat Sheet (But Which Flavor?:)

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

#DeviceTypeLmin (µm)Wmin (µm)VDS max (V)VGS max (V)Vth (V)7gm,in (µS)1gm,mir (µS)2AVT (mV·µm)3fT (GHz)4σ ΔI/I mirror (%)5σ Vos pair (mV)6
1nfet_03v33.3 V NMOSNMOS0.280.223.603.600.711617.07.42.035.13.3
2pfet_03v33.3 V PMOSPMOS0.280.223.603.60-0.791103.56.90.992.43.2
3nfet_05v0†5 V NMOS (same model as 06v0)NMOS0.600.305.505.500.711556.519.02.466.37.5
4pfet_05v05 V PMOSPMOS0.500.305.505.50-0.821102.914.11.532.76.5
5nfet_06v0†6 V NMOSNMOS0.700.306.506.500.721446.516.81.976.36.3
6pfet_06v06 V PMOSPMOS0.500.306.506.50-0.821102.914.11.552.76.5
7nfet_06v0_nvt†6 V native NMOSNMOS1.800.806.506.50-0.09175n/an/a2.02n/an/a
8nfet_03v3_dss3.3 V NMOS, drain salicide blockNMOS0.280.223.603.600.711607.07.42.025.13.3
9pfet_03v3_dss3.3 V PMOS, drain salicide blockPMOS0.280.223.603.60-0.791103.56.90.992.43.2
10nfet_06v0_dss†6 V NMOS, drain salicide blockNMOS0.600.306.506.500.711586.519.02.566.37.5
11pfet_06v0_dss6 V PMOS, drain salicide blockPMOS0.500.306.506.50-0.821102.914.11.552.76.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

  1. 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.
  2. 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).
  3. 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.
  4. 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).
  5. 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.
  6. 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.
  7. 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

#ResistorRsh (Ω/sq)aTC (ppm/K)fWmin (µm)Density (kΩ/µm²)bσ ΔR/R, 1×10 µm (%)cAR (%·µm)dRend (Ω)e
1nplus_uN+ diffusion, unsalicided59.613790.800.0931n/an/a3.67
2pplus_uP+ diffusion, unsalicided18714060.800.291n/an/a10.0
3npolyf_uN+ poly, unsalicided311-13270.800.486n/an/a8.03
4ppolyf_uP+ poly, unsalicided352-650.800.550n/an/a12.0
5ppolyf_u_1khigh-res poly 1k1001-8531.001.00n/an/a16.8
6ppolyf_u_2khigh-res poly 2k2002-15441.002.00n/an/a43.9
7ppolyf_u_3khigh-res poly 3k3004-15441.003.00n/an/a62.6
8nwelln-well105126151.200.730n/an/a50.3
9ppolyf_sP+ poly, salicided7.3632370.800.0115n/an/a1.00
10rm1metal 10.090633080.230.0017n/an/a0

Notes

  1. 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.
  2. Resistance per unit body area at the minimum width: Rsh / Wmin² (ends, contacts and spacing not included). Highest = densest.
  3. Mismatch of two identical resistors, W = 1 µm (or Wmin), L = 10 µm, σ of ΔR/R over 30 Monte-Carlo mismatch samples.
  4. Area-normalised matching: the σ of note c times √(W·L), so σ(ΔR/R) ≈ AR/√(W·L) for another size. Lowest = best matching.
  5. End resistance per device from the same two lengths: R(L) ≈ Rsh·L/W + Rend (heads, contacts, salicide transitions).
  6. 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.

Wednesday, November 11, 2026

In Case it Helps - Randomized Results in TT with SKY130nm and ngspice

Why my sky130 bandgap gave a different answer every run

One test in our xschem fork failed two of our last four full regression runs. On its own it always passed, so for weeks it was filed as "the known flaky one". This week we found the cause, and it is not a test problem at all. Every ordinary run of a tt_mm sky130 bench is a fresh Monte Carlo trial.

What we saw

The symptom

The test simulates the bandgap testbench that ships with the open_pdks sky130 examples. Sometimes ngspice ran for about 13 seconds, exited with code 1, and wrote no results file. The failing check moved from run to run.

It looked like a load problem, because it only failed inside a full test run. It wasn't.

The evidence

We copied the exact deck the test used and ran it with ngspice directly, 24 times. One run failed:

doAnalyses: TRAN:  Timestep too small; time = 1.63211e-07,
  timestep = 5e-20: trouble with node "v4#branch"
tran simulation(s) aborted

The surprise was earlier in the output. ngspice prints its starting solution before the transient begins, and no two runs printed the same one. Most started near 0 V, with noise from 1e-12 down to 1e-53. The failing run started at a non-physical point, with one node at −1.96×108 V.

Same deck, same binary, a different answer every time. Forcing ngspice onto one thread changed nothing, so it wasn't multithreading.

The cause

tt_mm means "typical, with mismatch"

The bench's corner symbol says corner=tt_mm. In the sky130 model library, that section sets MC_MM_SWITCH=1, so every transistor draws a random mismatch offset when the netlist is loaded. Plain tt sets it to 0.

ngspice has no separate Monte Carlo analysis. Monte Carlo in ngspice means "run again with a different seed". These runs set no seed, so ngspice used a different one every time. Every run was a new random sample of the circuit.

Seven of the bundled sky130 example benches use tt_mm, including the two bandgaps, the comparator, lvnand and srlatch.

The proof

Adding one line before the .control block:

.option seed=1

Six concurrent runs then found the same starting solution, and their results files matched byte for byte once ngspice's date line was removed.

Is ngspice broken?

No. ngspice and the sky130 models are doing what they were designed to do. The bundled sky130_mismatch example even calls setseed 12 when it wants a repeatable run.

The bug is the gap between that design and what a Cadence user expects. In Spectre, mismatch only applies inside a Monte Carlo analysis, so an ordinary run gives the same numbers every time. Our ADE-style front end, ASE-L, handed ngspice the deck without pinning a seed. So pressing Run on a tt_mm bench quietly ran one Monte Carlo trial instead of a repeatable simulation. On this bandgap, about one trial in 24 also failed to converge.

What we're changing

Ordinary runs get a fixed seed

ASE-L will pin the random seed for every run that isn't a Monte Carlo run, so a tt_mm bench gives the same answer each time you press Run.

Keep one subtlety in mind. A fixed seed gives you one particular mismatch sample, repeatably. It is not the mismatch-free typical device you get from tt. If you want typical numbers, use tt. If you want to see mismatch, run Monte Carlo.

If you use ngspice with sky130 today

Check your corner

If your corner ends in _mm and you aren't running Monte Carlo, either switch to the plain corner or put .option seed=1 in your deck. Otherwise two runs of the same schematic can disagree, and you'll chase a change you never made.

If you work with Claude Code: prompts that found this

A flaky test hides its cause until someone keeps the evidence. These are the requests that got us from "known flaky" to a root cause:

  • "Don't re-run it again. Find out why the simulator exits with error 1."
  • "Copy the exact deck the test simulates, and run ngspice on it directly, many times, keeping the output of any run that fails."
  • "Compare a failing run's output with a passing one, and tell me where they first differ."
  • "Before fixing anything, give me the background: where did this come from, and is the tool itself broken?"

The third one cracked it. The difference was before the transient even started, and that pointed straight at the models instead of at the test.

Does ngspice STB Work? Is ASE-L Geared to Use it?

HRH Claude Opus:

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.



Why is Xschem Refusing to Annotate OP Info?

I pressed 6 on a sky130 schematic and xschem answered, in the console:

These symbol types have no operating-point values to show: capacitor, high_precision_poly_resistor, nmos, pmos and more.

Read quickly, that says the sky130 FETs cannot show operating-point annotation. My message to Claude was more or less "No kidding?". The IHP cells in the same project annotate fine. Same tool, same build, same simulator. Why would one process be a second-class citizen?

It was not. The feature is table-driven, and the table for sky130 had never been loaded into that xschem session. This post is about how we found that out, what we changed, and the handful of lessons that are worth more than the fix.

How the annotation knows a FET

To put gm or vth next to a transistor, the tool has to know two things that are different for every process: how the simulator spells that device in the results (for a sky130 wrapper it is @m.x1.xm1.msky130_fd_pr__nfet_g5v0d10v5, for IHP's PSP model it is @n.x1.xm1.nsg13_hv_nmos), and which quantities to ask for. Each PDK workarea ships a small descriptor that answers both, keyed by the symbol type (nmos, pmos), and registers it when the workarea's rc file is sourced. The same descriptor is what puts the device requests into the simulation deck, so without it a run saves nothing per device either.

Two details made the symptom confusing. First, the key is the symbol type, and both PDKs use nmos. So the registry holds one descriptor per type, and registering a second PDK replaces the first. The tool's own spec calls this out as "one interpreter per PDK", and it degrades to blank rather than to wrong numbers, which is the right failure. Second, a descriptor only claims cells whose name matches its PDK's library glob. Our project's startup script sourced the IHP workarea rc and nothing from sky130. The IHP descriptor looked at a sky130_fd_pr cell, declined it, and the annotator reported the type as one with nothing to show. Which, in that session, was true.

The tool had said so already. The run log in the console carried this line, printed at netlist time, before anyone pressed a key:

ASE: no device below this cell produced an OP save card — no registered op_annot PDK descriptor matched, or nothing below it is annotatable. The deck asks for no device parameters.

Nobody read it. Two sentences in a console pane, between a hundred others.

The fix I did not want

Claude's first proposal was an environment variable, with the PDK inferred from the schematic path when the variable was absent: a cell under lib/hdo_sky130/ would get a sky130 session, anything else IHP. Reasonable on paper. I turned it down. A setting that decides what a whole session can do should not be inferred from where a file happens to live, and a wrong guess here fails silently: the editor works, the simulation works, and the FETs quietly stop annotating. We already had the right model in the xschem repo: a small Tk launcher where you pick a PDK and press Launch. So:

Make it a minimal GUI like the pdk_launcher.sh thing in the Xschem repo. I'll pick the PDK when I run the launcher.
The project launcher. The Command field is a rendering of the list the dialog executes, so what you read is what runs, and it pastes into a terminal unchanged.

The dialog is about a hundred lines of Tcl. It exports the choice as two environment variables, the project's rc file resolves the matching workarea and switches the fresh-state simulation defaults with it, and the startup script sources that workarea's rc instead of a hard-coded one. One session, one PDK, chosen on purpose and visible in the command line.

Proving it, and the proxies that lied

The first three attempts to verify the fix all drew the six-row block with every value blank. Each attempt was a shortcut: run the bench headless, then load the cell and call the annotation. The deck and results were right. The shortcut was wrong twice over. The annotator finds its results file through the simulation session that owns the sheet, and a run started outside such a session left it looking for a file the simulator never writes. And the annotation has to be issued in the design window the simulation environment opens, not after a bare load into the main one. Only the user's own path proved anything: open the state in the simulation environment, Netlist and Run, open the design window, descend into the cell, press 6.

Before: a shortcut run. The block is drawn, every value is blank.
After: the real flow in a sky130 session. M1 at 5.2 µA has gm 100.6 µS and gds 245.6 nS; the tail switch drops 21.5 mV.
The whole cell. The console sentence now names only the capacitor, the resistor and the probe, which is what it should say.

One more thing the verification turned up, and it would have fooled a deck-grepping check forever: on this ngspice build the device numbers never appear as .save cards in the deck at all. The simulation environment measures that the simulator can dump every device's operating point in one go, asks for that instead, and the values land in a small .opinfo file beside the raw. The deck looked empty of device requests and was fine.

What three reviewers found

Before calling it done we ran three independent reviews: one on the launcher code, one on the tool-side assumptions against the xschem source, one on the write-up against the evidence. None of the three found the fix wrong. All three found something the author's tests could not:

  • The launcher did not change into the project directory before starting xschem, so the project's own operating-point parameter lists, which the tool reads from ./.xschem, were silently skipped unless you happened to start from the project root.
  • Return with the keyboard focus on Quit launched xschem instead of quitting. Inherited from the launcher we copied.
  • The project's parameter-list settings carried rows spelled for IHP's model, unscoped, so a sky130 session would have asked BSIM4 for quantities it does not publish. One section header fixed it.

The lessons

  1. A "cannot" from a tool is usually a "was not told". Before concluding that a feature does not support something, find who was supposed to register, configure or load it, and check whether that happened in this session.
  2. Read the console at run time. The cause was printed before the question was asked. A notice you do not read is a notice the tool did not print.
  3. Session-wide settings get an explicit choice, not an inference. One click in a dialog, with the resulting command visible, beats a clever rule whose failure mode is silence.
  4. Verify through the user's path, not a proxy. Three shortcuts produced blank values and looked exactly like a broken feature. The feature was fine; the probes were not the user.
  5. A table-driven feature has a scope. Here the scope is one xschem process, one registry, one PDK. Know the scope before you ask why something is missing from it.
  6. Independent review earns its cost on infrastructure. A launcher that every session goes through is worth three readers. A two-component schematic edit is not.

Total time, from the question to the memory note: about ninety minutes, then the review. The fix itself was a day's worth of understanding compressed into a dialog with two radio buttons.

Open Source Design Opps

https://www.smacd-conference.org/authors/open-source-design-challenge

https://opencircuitdesign.com/chipalooza



Tuesday, November 10, 2026

Since the Waveform Viewer - in Xschem Free


The waveform viewer arrived on 21 July 2026. Six of these landed in the last few days; four are the big ones since July.

New this week

1. DC sweep of a design variable

ngspice cannot do this on its own. Its .dc sweeps only a source, a resistor or temperature, and a parameter is fixed once the circuit is loaded.

ASE-L now does it for you. Choose Design variable in the DC form, pick the variable, and give the range. ASE-L re-runs the operating point at each value and returns one DC curve with the variable on the X axis.

Why it helps: you can plot output voltage against a bias current, a W/L or any other design variable, the same way you would in ADE-L, without hand-writing a sweep loop.

2. Check and Save

Press Shift+X, or pick it from the File menu. It checks the schematic, saves it, and lists what it found:

  • pins that don't match the cell's own symbol (missing, extra, or wrong direction);
  • unconnected device pins;
  • nets with only one connection, and labels that touch nothing;
  • shorted labels and missing symbols.

Click a line in the report to jump to the problem.

Why it helps: mistakes that used to surface as a confusing simulation result are caught at save time. On its first real run it found an unconnected PMOS gate in my buffer.

3. q edits one, Alt-Shift-Q edits all

With the Cadence profile loaded, q always opens Edit Properties on Only Current. Alt-Shift-Q always opens it on All Selected.

Before, the form remembered the last scope you used. A q after an all-selected edit could quietly change every selected device.

Why it helps: the key you press decides the scope, so you never change twenty devices when you meant to change one.

4. AC plots that read like a Bode plot

AC results now open on a log frequency axis. Y values are labelled in dB or degrees, depending on the expression plotted.

Right-click any axis's numbers to switch that axis between linear and log.

Why it helps: no more squinting at a linear 0–1 GHz axis, or opening a dialog just to change the scale.

5. Dragging a label off a pin keeps it connected

In a connected drag, a net label sitting directly on a device pin now pulls a wire behind it, back to the pin.

Why it helps: tidying a schematic no longer silently disconnects a net.

6. sky130 5 V standard cells

The 69 sky130_fd_sc_hvl cells are now a library of their own, with their SPICE models in the repository.

Why it helps: 5 V logic is placed and simulated like any other cell, with nothing extra to install.

Tip: VNB is the NMOS body (tie it to ground) and VPB is the PMOS body (tie it to the supply).

The big ones since July

7. A Calculator that measures

Rise time, delay, duty cycle, frequency, phase margin, gain margin and bandwidth. Pick nets straight off the schematic.

8. A ViVA-style waveform viewer

Subwindows, markers, drag-and-drop strips, and a Signal Browser linked to the schematic.

9. ASE-L grows up

Eleven analyses instead of four. Outputs are computed after the run, and results are saved by name.

10. Operating points on the schematic

gm, vdsat and region next to each device after an OP run.

Sunday, November 8, 2026

Can You Sweep a Variable in NGspice Like You Can In Spectre?

Sweeping a design variable in ngspice, without changing ngspice How our trim test sweeps a 5-bit trim code, and keeps the same silicon at every code
Date
2026-11-08
Simulator
ngspice-46+, built from our development fork (branch ver_51). The sweep itself uses only stock ngspice commands.
Context
Trim-and-sim in ASE-Integrator, our ADE-Assembler-style test bench manager built on xschem
Short answer
ngspice's DC sweep can't step a parameter, so we don't ask it to. The simulation script steps the parameter itself: change the value, reload the circuit, solve. Then it hands the results back as an ordinary DC sweep.

The problem

Trim-and-sim on a bandgap works like this:

  • For each Monte Carlo sample, a trim test finds the 5-bit code that puts the output voltage, Vbg, nearest its target.
  • Stress tests then run that same sample at that code, over temperature and supply.

In an ADE-Assembler-style flow the trim test is an ordinary test: a DC sweep of the design variable CODE from 0 to 31, with an output that picks the code.

ngspice's .dc sweeps a voltage source, a current source, a resistor or the temperature. It can't sweep a parameter: asked to sweep CODE, it stops with named "code" is not in the circuit.

A parameter is evaluated once, when the netlist is read. In our bandgap, CODE sets the length of a trim resistor, so its value is fixed when the circuit loads. No source sweep can stand in for it.

Step the parameter from the script

ngspice's control language can change a parameter and reload the circuit, so the simulation script runs the sweep itself. Here it is simplified, for a 32-point sweep of CODE:

let const.code = vector(32)
let const.vbg = vector(32)
foreach i 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  alterparam CODE=$i
  setseed 1
  reset
  op
  let const.code[$i] = $i
  let const.vbg[$i] = v(vbg)
  destroy all
end
setplot new
let code = const.code
let vbg = const.vbg
settype voltage vbg
setscale code
setcs curplotname = "DC transfer characteristic"
write trim.raw

What each step is for:

  • alterparam and reset. alterparam sets the new value, and reset re-reads the netlist so it takes effect. The trim resistor is rebuilt at its new length.
  • setseed comes before reset. Mismatch values are drawn while the netlist is read, so re-seeding first gives the same draws at every code. Without it, every code gets different silicon, and the sweep no longer describes one chip. In Monte Carlo the seed is that sample's own seed.
  • What reset forgets. A reset also drops whatever the script set after the netlist was read: a temperature, an option, an alter. We measured all three. If your script sets any of these, set them again after each reset.
  • op solves the operating point at this code. In the real script it is followed by a check that stops the sweep if the point failed.
  • The let const.… lines keep this point's numbers in the constants plot, which destroy all leaves alone. destroy all keeps memory flat over many points.

The real script spells out every vector the outputs need, not just vbg.

Hand it back as a real DC sweep

After the loop, the script builds one new plot from the kept points:

  • setscale makes CODE the X axis;
  • settype gives each vector its unit;
  • curplotname gives the plot the name ngspice gives a real DC sweep.

Raw-file readers, xschem's included, use that name to decide what kind of analysis a plot is. So the result reads back as an ordinary DC sweep with CODE on the X axis. Everything downstream works unchanged: plotting, the Calculator, and measurements such as cross and value.

The trim test's output is then one line:

TRIM = round(cross(vs(vbg), VAR("BG_TARGET")))
  • cross finds where Vbg crosses the target, as a fractional code.
  • round takes the nearest whole code. On a curve that rises from code to code, that is exactly the code whose Vbg is nearest the target in volts; the only exception is an exact tie.
  • BG_TARGET is a global variable (0.97 V), so the target isn't a number repeated in every output.

Each stress test sets CODE = testVal("trim","TRIM"), our analogue of Cadence's calcVal. Sample k of a stress test runs at the code that sample k of the trim test chose.

Monte Carlo: the same silicon at every code

In Monte Carlo, each sample re-seeds with its own seed before every reset. So all 32 codes of sample k see sample k's mismatch, and so do the stress tests.

We check this rather than assume it:

  • Our ngspice build logs every random draw made while the netlist is read.
  • A sample's log therefore holds 33 sets of draws: the first load, then one per code.
  • The engine compares them. If any set differs, the sample is marked failed instead of being used.

On our bandgap demo, all 33 sets were identical in every sample.

What it costs

Every point is a full reload of the circuit. On our sky130 bandgap that is about 16 ms per point, after ngspice's 3 s start-up.

Our trim-and-sim demo has 100 samples, a trim test and three stress tests. It now runs 404 simulations instead of 3535, because each sample's 32 codes run inside one simulation.

Wall time hardly moved, 2 min 46 s against 2 min 51 s, because ngspice still loads the circuit 32 times per sample. The answers didn't move at all:

  • the same 100 codes;
  • the same trimmed spread, σ 1.06 mV, against 12.25 mV untrimmed.

Limits, for now

  • One swept variable per analysis, and at most 1024 points.
  • The built sweep holds top-level nets and source currents. An output that reads a node inside a subcircuit, or a device parameter, is flagged before the run, and its result says why after it.
  • One failed point fails the whole sweep, as with ngspice's own DC sweep. Under Monte Carlo it fails that sample.
  • If a sample's Vbg never reaches the target between code 0 and code 31, cross has no answer, so TRIM has no value. That sample's stress runs are then blocked and shown as such. Cadence behaves the same way: its cross returns nil and the calcVal fails.

Did we patch ngspice?

No. alterparam, reset, setseed, setplot, setscale, settype and the plot-name variable are all stock ngspice.

Our fork is needed for Monte Carlo's draw log, which is how we check the same-silicon claim. The sweep itself doesn't need it. So far we have only run the sweep on our fork builds.

Friday, November 6, 2026

Predicting Worst Case Based on a User-Specified Sigma Level, from Small Sample Monte Carlo

Worst-Case Points, checked against 470,016 Monte Carlo samples What a 3σ answer is worth before you go to volume, and how we proved ours
Date
2026-11-06
Feature
Worst-Case Points, in ASE-Integrator
Test case
A sky130 bandgap reference: device mismatch at the typical corner (91 random variables), six outputs from a 0–70 °C sweep
Short answer
In about six minutes, Worst-Case Points found the 3σ and 3.5σ worst cases of all six outputs, in both directions. A brute-force run of 470,016 samples, 3.6 hours of simulation, confirmed 22 of those 24 answers. The tool had already flagged the other two.

The question before volume

A design that passes at nominal and across a few hundred Monte Carlo samples is not yet ready for volume. In volume, rare events happen every day. If a spec limit sits exactly three standard deviations (3σ) from the mean, about 1,350 parts in every million miss it on that side. Ship a million units, and that one spec alone gives you more than a thousand rejects or returns.

So the questions that decide a volume tape-out are about the tails of the distribution:

  • How far is each spec limit from the edge, in sigma?
  • Which combination of device variations takes the circuit there?
  • Will that margin survive the next design change?

Customers ask the same questions in their own terms. Many, automotive customers in particular, ask for a process capability (Cpk) of 1.33 or 1.67: four or five standard deviations between the mean and the nearest spec limit.

Why the tails are hard

A few hundred samples show the middle, not the edge

A Monte Carlo run of a few hundred samples gives you a good mean and a good standard deviation. It holds few samples beyond 3σ, often none: on a given side you expect one in every 740 samples.

"None of my samples failed" says less than it sounds

Zero failures in 1,000 samples shows, with 95% confidence, only that the failure rate is below 0.3%. That is about 2.75σ. Showing a 4σ margin by zero failures takes about 95,000 samples; 5σ takes about 10.5 million.

The bell-curve shortcut

The usual shortcut is the mean plus or minus k standard deviations. That works when the output is bell-shaped. Many outputs are not: anything bounded, folded or built as a ratio. There the shortcut can be wrong in either direction, including the dangerous one. There is an example below.

Brute force gets expensive fast

You can always run more samples. But every extra half sigma multiplies the cost by roughly four to ten (table below).

A failing sample is not a design corner

When a big run does produce failures, each one is a random draw of every variable at once. It tells you that the circuit can fail. It does not tell you the most likely way it fails, and it makes a poor corner to design against or to re-check after a fix.

What Worst-Case Points gives you

Worst-Case Points works from the Monte Carlo run you already have. For every output, in each direction a spec can fail, it finds the most likely combination of device variations that takes the output to the sigma level you choose. Then it simulates the circuit there.

  • A real circuit, not an extrapolation. The worst-case value is a SPICE simulation of one concrete set of device values.
  • Open it and look. Open the point as an ordinary simulation and probe it like any other run: waveforms, operating points, everything.
  • See why. The point shows which devices moved, and how far. Variation Contribution shows which ones dominate the spread. Double-click a device in either, and it lights up in your schematic in its own colour.
  • Keep it. Export the point to a file, so other test benches can run at it: a transient, a stress test or a trim run at the 3.5σ worst case. Re-run it after every design change.
  • Honest when it can't. When it can't pin a point down, it says "not converged" instead of handing you a number.

How we checked it

Our test case is a bandgap reference in SkyWater's open-source 130 nm PDK (sky130), with device mismatch at the typical process corner: 91 independent random variables. A temperature sweep from 0 to 70 °C gives six outputs:

  • the output voltage at 27 °C;
  • the amplifier's offset;
  • three temperature coefficients: end-point, box method, and the slope at 27 °C that a trim would null;
  • the turnover temperature, where the slope is zero.

Worst-Case Points started from an ordinary 500-sample Monte Carlo run. It found the worst case of every output in both directions, at 3σ and at 3.5σ: 24 worst-case points.

Monte Carlo samples, number per binWorst-case values found at 3σ and 3.5σ, each side
Output voltage at 27 °C (V)
2040608000.932 to 0.936 V: 2 samples0.936 to 0.940 V: 2 samples0.940 to 0.944 V: 6 samples0.944 to 0.948 V: 6 samples0.948 to 0.952 V: 11 samples0.952 to 0.956 V: 33 samples0.956 to 0.960 V: 36 samples0.960 to 0.964 V: 70 samples0.964 to 0.968 V: 57 samples0.968 to 0.972 V: 65 samples0.972 to 0.976 V: 59 samples0.976 to 0.980 V: 36 samples0.980 to 0.984 V: 42 samples0.984 to 0.988 V: 30 samples0.988 to 0.992 V: 25 samples0.992 to 0.996 V: 11 samples0.996 to 1.000 V: 6 samples1.000 to 1.004 V: 1 sample1.004 to 1.008 V: 2 samples0.920.940.960.981.001.02Worst case at 3.5σ, low side: 0.92660 VWorst case at 3σ, low side: 0.93275 VWorst case at 3σ, high side: 1.00730 VWorst case at 3.5σ, high side: 1.01359 V3.5σ3σ3σ3.5σ
Amplifier offset (mV)
204060800−5.0 to −4.5 mV: 2 samples−4.5 to −4.0 mV: 3 samples−4.0 to −3.5 mV: 4 samples−3.5 to −3.0 mV: 5 samples−3.0 to −2.5 mV: 9 samples−2.5 to −2.0 mV: 22 samples−2.0 to −1.5 mV: 38 samples−1.5 to −1.0 mV: 49 samples−1.0 to −0.5 mV: 62 samples−0.5 to 0.0 mV: 52 samples0.0 to 0.5 mV: 69 samples0.5 to 1.0 mV: 69 samples1.0 to 1.5 mV: 52 samples1.5 to 2.0 mV: 27 samples2.0 to 2.5 mV: 19 samples2.5 to 3.0 mV: 10 samples3.0 to 3.5 mV: 2 samples3.5 to 4.0 mV: 5 samples4.0 to 4.5 mV: 1 sample−6−4−20246Worst case at 3.5σ, low side: −5.460 mVWorst case at 3σ, low side: −4.692 mVWorst case at 3σ, high side: 4.536 mVWorst case at 3.5σ, high side: 5.306 mV3.5σ3σ3σ3.5σ
Tempco, end-point (ppm/°C)
204060800−20 to −15 ppm/°C: 2 samples−15 to −10 ppm/°C: 4 samples−10 to −5 ppm/°C: 5 samples−5 to 0 ppm/°C: 10 samples0 to 5 ppm/°C: 20 samples5 to 10 ppm/°C: 29 samples10 to 15 ppm/°C: 30 samples15 to 20 ppm/°C: 49 samples20 to 25 ppm/°C: 67 samples25 to 30 ppm/°C: 65 samples30 to 35 ppm/°C: 68 samples35 to 40 ppm/°C: 55 samples40 to 45 ppm/°C: 38 samples45 to 50 ppm/°C: 21 samples50 to 55 ppm/°C: 20 samples55 to 60 ppm/°C: 7 samples60 to 65 ppm/°C: 3 samples65 to 70 ppm/°C: 3 samples70 to 75 ppm/°C: 2 samples75 to 80 ppm/°C: 1 sample85 to 90 ppm/°C: 1 sample−40−20020406080Worst case at 3.5σ, low side: −29.13 ppm/°CWorst case at 3σ, low side: −21.07 ppm/°CWorst case at 3σ, high side: 77.07 ppm/°CWorst case at 3.5σ, high side: 85.41 ppm/°C3.5σ3σ3σ3.5σ
Tempco, box method (ppm/°C) · low side: not converged
2040608000 to 5 ppm/°C: 26 samples5 to 10 ppm/°C: 38 samples10 to 15 ppm/°C: 34 samples15 to 20 ppm/°C: 51 samples20 to 25 ppm/°C: 67 samples25 to 30 ppm/°C: 65 samples30 to 35 ppm/°C: 68 samples35 to 40 ppm/°C: 55 samples40 to 45 ppm/°C: 38 samples45 to 50 ppm/°C: 21 samples50 to 55 ppm/°C: 20 samples55 to 60 ppm/°C: 7 samples60 to 65 ppm/°C: 3 samples65 to 70 ppm/°C: 3 samples70 to 75 ppm/°C: 2 samples75 to 80 ppm/°C: 1 sample85 to 90 ppm/°C: 1 sample−40−20020406080Worst case at 3σ, high side: 76.90 ppm/°CWorst case at 3.5σ, high side: 85.22 ppm/°C3σ3.5σ
Tempco, slope at 27 °C (ppm/°C)
204060800−25 to −20 ppm/°C: 2 samples−20 to −15 ppm/°C: 1 sample−15 to −10 ppm/°C: 5 samples−10 to −5 ppm/°C: 7 samples−5 to 0 ppm/°C: 14 samples0 to 5 ppm/°C: 25 samples5 to 10 ppm/°C: 30 samples10 to 15 ppm/°C: 35 samples15 to 20 ppm/°C: 62 samples20 to 25 ppm/°C: 72 samples25 to 30 ppm/°C: 66 samples30 to 35 ppm/°C: 58 samples35 to 40 ppm/°C: 45 samples40 to 45 ppm/°C: 36 samples45 to 50 ppm/°C: 17 samples50 to 55 ppm/°C: 11 samples55 to 60 ppm/°C: 7 samples60 to 65 ppm/°C: 3 samples70 to 75 ppm/°C: 3 samples80 to 85 ppm/°C: 1 sample−40−20020406080Worst case at 3.5σ, low side: −31.77 ppm/°CWorst case at 3σ, low side: −23.72 ppm/°CWorst case at 3σ, high side: 74.45 ppm/°CWorst case at 3.5σ, high side: 82.80 ppm/°C3.5σ3σ3σ3.5σ
Turnover temperature (°C) · 1 sample off chart, at −1,764
501001502000−650 to −600 °C: 1 sample−350 to −300 °C: 3 samples−300 to −250 °C: 5 samples−250 to −200 °C: 11 samples−200 to −150 °C: 34 samples−150 to −100 °C: 76 samples−100 to −50 °C: 149 samples−50 to 0 °C: 143 samples0 to 50 °C: 66 samples50 to 100 °C: 10 samples100 to 150 °C: 1 sample−1,000−750−500−2500Worst case at 3.5σ, low side: −973 °CWorst case at 3σ, low side: −543 °CWorst case at 3σ, high side: 101.3 °CWorst case at 3.5σ, high side: 129.9 °C3.5σ3σ3σ3.5σ
The ordinary 500-sample Monte Carlo run that Worst-Case Points started from, one histogram per output. The orange lines are the 3σ and 3.5σ worst-case values it found on each side, and the brute-force check described below confirmed every one of them. Only four of the 500 samples reach past a 3σ line on any output, and just one reaches past a 3.5σ line (on four outputs at once). A few samples that far out show that the tail is there. They can’t show where the 3σ value is.
The numbers behind the figure
OutputMeanσLowest sampleHighest sampleWorst case at 3σ: low / highAt 3.5σ: low / high
Output voltage at 27 °C (V)0.970200.012450.932141.006110.93275 / 1.007300.92660 / 1.01359
Amplifier offset (mV)−0.0661.475−4.5604.084−4.692 / 4.536−5.460 / 5.306
Tempco, end-point (ppm/°C)27.3715.69−19.7686.12−21.07 / 77.07−29.13 / 85.41
Tempco, box method (ppm/°C)28.0414.472.3986.12not converged / 76.90not converged / 85.22
Tempco, slope at 27 °C (ppm/°C)24.7515.68−22.2783.53−23.72 / 74.45−31.77 / 82.80
Turnover temperature (°C)−69.9105.1−1,764113.3−543 / 101.3−973 / 129.9
OutputPast the 3σ line: low / highPast the 3.5σ line: low / high
Output voltage at 27 °C2 / 00 / 0
Amplifier offset0 / 00 / 0
Tempco, end-point0 / 10 / 1
Tempco, box method– / 1– / 1
Tempco, slope at 27 °C0 / 10 / 1
Turnover temperature2 / 11 / 0

Over all six outputs, four different samples are past a 3σ line, and one is past a 3.5σ line.

OutputBinsSamples per bin, left to right
Output voltage at 27 °C0.920 to 1.020 V, 25 bins0, 0, 0, 2, 2, 6, 6, 11, 33, 36, 70, 57, 65, 59, 36, 42, 30, 25, 11, 6, 1, 2, 0, 0, 0
Amplifier offset−6.5 to 6.5 mV, 26 bins0, 0, 0, 2, 3, 4, 5, 9, 22, 38, 49, 62, 52, 69, 69, 52, 27, 19, 10, 2, 5, 1, 0, 0, 0, 0
Tempco, end-point−40 to 95 ppm/°C, 27 bins0, 0, 0, 0, 2, 4, 5, 10, 20, 29, 30, 49, 67, 65, 68, 55, 38, 21, 20, 7, 3, 3, 2, 1, 0, 1, 0
Tempco, box method−40 to 95 ppm/°C, 27 bins0, 0, 0, 0, 0, 0, 0, 0, 26, 38, 34, 51, 67, 65, 68, 55, 38, 21, 20, 7, 3, 3, 2, 1, 0, 1, 0
Tempco, slope at 27 °C−40 to 95 ppm/°C, 27 bins0, 0, 0, 2, 1, 5, 7, 14, 25, 30, 35, 62, 72, 66, 58, 45, 36, 17, 11, 7, 3, 0, 3, 0, 1, 0, 0
Turnover temperature−1,100 to 150 °C, 25 bins0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3, 5, 11, 34, 76, 149, 143, 66, 10, 1; plus 1 below the chart (−1,764)

Then we ran the brute force: 470,016 Monte Carlo samples, in 24 batches with separate seeds. That is enough to pin the true 3.5σ value of each output to about ±0.05σ. It took 3.6 hours of simulation on 16 parallel simulators.

  • Not one of the 470,016 simulations failed.
  • The 24 batches agreed with each other statistically.
  • Both runs used the PDK's recommended simulator settings and tight solver tolerances.

For each of the 24 points we compared two things:

  • the brute force's value at that sigma level, with its 95% confidence band;
  • the value Worst-Case Points reported, and how many of the 470,016 samples lie beyond it. That count gives the value's real sigma level.

The result: 22 of 24

Output3σ high3σ low3.5σ high3.5σ low
Output voltage✓✓✓✓
Amplifier offset✓✓✓✓
Tempco, end-point✓✓✓✓
Tempco, box method✓flagged✓flagged
Tempco, slope at 27 °C✓✓✓✓
Turnover temperature✓✓✓✓

✓: the value Worst-Case Points reported is inside the brute force's 95% band. Flagged: the tool marked the point "not converged".

At 22 of the 24 points, the reported value is inside the band. Measured against all 470,016 samples, the real sigma levels of those 22 values are 2.98 to 3.02 where we asked for 3, and 3.46 to 3.54 where we asked for 3.5.

The other two are the low side of the box-method tempco. That measure can never be negative, and nobody sets a lower limit on it. Its true 3σ value is 2.15 ppm/°C, just above zero. Worst-Case Points marked both points "not converged" rather than pass off a guess.

The numbers at 3.5σ:

OutputSideBrute force: 3.5σ value [95% band]Worst-Case PointsIts real sigma level
Output voltage (V)high1.01325 [1.01269, 1.01390]1.013593.54
low0.92638 [0.92578, 0.92709]0.926603.49
Amplifier offset (mV)high5.341 [5.253, 5.417]5.3063.48
low−5.411 [−5.487, −5.343]−5.4603.54
Tempco, end-point (ppm/°C)high85.18 [84.39, 86.06]85.413.52
low−29.39 [−30.35, −28.64]−29.133.49
Tempco, box method (ppm/°C)high85.18 [84.39, 86.06]85.223.50
low1.65 [1.57, 1.69]not converged–
Tempco, slope at 27 °C (ppm/°C)high82.43 [81.81, 83.28]82.803.52
low−31.84 [−33.04, −31.09]−31.773.49
Turnover temperature (°C)high132.2 [128.9, 137.0]129.93.46
low−961 [−1,028, −896]−9733.51

Where the shortcut goes wrong

Here is the bell-curve shortcut against the same brute force, at 3.5σ. We gave the shortcut its best chance: its mean and standard deviation come from all 470,016 samples, not from a few hundred.

OutputSideShortcut: mean ± 3.5σBrute force [95% band]Worst-Case Points
Output voltage (V)high1.013371.01325 [1.01269, 1.01390]1.01359
Tempco, box method (ppm/°C)high81.585.2 [84.4, 86.1]85.2
Turnover temperature (°C)high432132 [129, 137]130
Turnover temperature (°C)low−573−961 [−1,028, −896]−973
  • Output voltage is bell-shaped, and the shortcut is right.
  • The box-method tempco folds at zero, and the shortcut is optimistic: 81.5 ppm/°C against a real 85.2. A spec of 83 ppm/°C would look safe at 3.5σ, and it isn't.
  • The turnover temperature has long, lopsided tails. The shortcut is about 300 °C too pessimistic on one side and about 390 °C too optimistic on the other.

Worst-Case Points lands inside the band on all four.

The turnover temperature is a ratio, and its denominator is the curve's curvature. On a nearly straight curve it runs far outside the 0–70 °C range, and that is what gives it such long tails.

You can see both shapes in the histograms above: the box-method tempco stops at zero, and the turnover temperature trails far off to the left.

Six minutes against 3.6 hours

Worst-Case Points answered all 24 questions in about six minutes, the 500-sample Monte Carlo run included: 4,337 simulations in all. The brute force needed 470,016 simulations and 3.6 hours, 34 times as long.

And brute force only gets worse as the sigma level rises. This is what a check like ours would take on this bench, at 27.6 ms a sample with 16 simulators in parallel:

Sigma levelParts per million beyond it (one side)Samples to pin the value to ±0.05σTime on this bench
3σ1,350105,00048 minutes
3.5σ233469,0003.6 hours
4σ322.7 million21 hours
4.5σ3.420 million7 days
5σ0.29200 million2 months
6σ0.00141 billion36 years

We stopped at 3.5σ because that is where a brute-force check stops being affordable. And this bench is a fast one: a 71-point DC sweep. A transient test bench can take seconds per sample, not milliseconds.

What this means on the way to volume

  • Sign off at the corners your design actually has. A worst-case point belongs to your circuit and your spec, not to a generic process corner.
  • Know each margin in sigma. Pass or fail over a few hundred samples says little about the tails. A sigma level for each spec says a lot.
  • Fix the cause, then re-run the same point. See which devices drive the failure, change the design, and re-simulate exactly the same point in a single simulation.
  • Carry the point into your other tests. Trim, stress and transient tests can all run at the worst case you found.
  • Spend compute where it counts. Minutes per sigma level, on every design iteration, instead of hours or months of brute force.

Worst-Case Points is part of ASE-Integrator, alongside its Monte Carlo runs and Variation Contribution.

Getting a Useful VcXsrv Crash Dump

Winner of the first Nobel Prize in Physics ❯ tell me how to do the VcXsrv shortcut that I currently have in my Startup folder so that we get...