Skip to main content

Bandgap Simulations

The schematic test suite for the bandgap reference.

The cell under test​

xschem/bandgap_tb.sch uses the core as a single symbol (bandgap_core.sym, with pins VDD, VSS and VREF) and adds only the outside world:

  • VSUP: one supply source that carries DC (vdd, default 1.8 V), AC 1 V for PSRR, and a PWL ramp from 0 V that only the transient start-up test uses.
  • CL: a 1 pF load on VREF.
  • MODELS / CONTROL: the sky130 model library and a quick operating point plus temperature sweep, so Netlist → Simulate in xschem works straight away.

The output is unbuffered: VREF comes straight from the R2 branch, so it can't drive a resistive load. A real system would add a unity-gain buffer or LDO after it.

Results​

Plots from the schematic test suite. The table and notes below describe each test.

VREF vs temperature at five corners

Schematic test suite​

Every test lives in sim/bandgap/. The decks share bench.spice, the same circuit as the testbench schematic. run_all.sh first netlists the schematic with xschem, so the tests always simulate exactly what is drawn.

sim/bandgap/run_all.sh # netlist + all tests (about 1 minute); logs and data in sim/bandgap/out/
python3 sim/bandgap/plot.py # regenerate the plots on this page
ngspice sim/bandgap/temp.spice # or run one deck interactively (after run_all.sh)
#DeckWhat it checksResult (tt, 27 °C)
1op.spiceOperating point, supply current, amplifier offset VA−VBV_A - V_B1.2000 V, 20 µA, 0.04 mV
2temp.spiceDC sweep −40 to 125 °C, box-method TC14.4 mV, 73 ppm/°C
3line.spiceVDD swept 0 to 2.2 V9.9 mV/V; minimum VDD 1.51 V
4psrr.spiceAC from VDD to VREF, 1 Hz to 100 MHz−44 dB to 10 kHz, −40 dB at 1 MHz
5startup.spiceTransient with a 10 µs VDD ramp from 0 Vsettles at 8.4 µs
6loop.spiceLoop gain, injected at Vloop36 dB, 1.1 MHz, PM 89°
7noise.spiceOutput noise density, 1 Hz to 10 MHz1.6 µV/√Hz at 1 kHz; 629 µV rms total
8temp.spice × 5Temperature sweep at tt, ss, ff, sf, fs69 to 76 ppm/°C
9mc.spice200 mismatch samples (tt_mm), each powered up by the VDD rampmean ≈ 1.20 to 1.21 V, σ ≈ 45 to 50 mV
10sat.spiceEvery transistor's ∣VDS∣\lvert V_{DS} \rvert against VDSATV_{DSAT}, at 1.8 and 1.62 V, run at −40, 27 and 125 °Call analog devices saturated; worst margin 0.11 V

Notes on the tests:

  • Models. The decks use the PDK's combined model library, the one xschem's sky130 setup points to. The older libs.tech/ngspice library gives a VREF about 27 mV lower for the same circuit.
  • DC hints. A self-biased circuit has more than one DC solution, and the solver doesn't always find the right one. bench.spice sets .nodeset guesses for VREF, PB, A and B. The temperature sweep runs outward from 27 °C in both directions, because a single −40 to 125 °C sweep jumped to an unstable solution near 1.7 V at three corners. That state isn't real: a transient started from it falls back to 1.2 V. The start-up and Monte Carlo tests run in the time domain without these hints, so they check that the circuit reaches its operating point unaided.
  • sat.spice is generated by make_sat.py from the netlist, so it always covers every transistor in the schematic.
  • Monte Carlo results change slightly between runs, because ngspice draws new random values each time.

The same tests on the extracted layout are on Post-layout simulation.