Showing posts with label sky130. Show all posts
Showing posts with label sky130. 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.

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

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.

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...