AMS Sim
Analog blocks must be verified across process corners, temperature, voltage, and mismatch. This skill plans the testbench matrix, generates the simulator decks, and triages results.
When to use
- After
/analog-sizing produces a schematic
- After
/analog-layout + extraction (post-layout)
- When mismatching is the suspected failure mode (Monte Carlo)
- Mixed-signal co-simulation with a digital controller (ngspice + Verilog-A, or Spectre APS)
Inputs
- Schematic / netlist (
.sp, .cir, .scs)
- Device models from PDK (
.lib / .scs)
- Specs to verify (gain, BW, PSRR, CMRR, noise, slew, settling, offset)
- Corner definition (FF/SS/TT/FS/SF × temp × supply)
- Monte Carlo N (typical 500–5000 runs)
Analysis matrix
| Analysis |
Purpose |
.op |
DC operating point, bias validation |
.dc |
Sweeps (supply, input, parameter) |
.ac |
Gain, bandwidth, phase margin |
.tran |
Settling, slew, large-signal; sampled converter ENOB/SNR/SNDR via spectrum |
.noise |
Input-referred noise and small-signal analog SNR estimates |
.pss / .pac / .pnoise |
Periodic steady-state (for RF / SC circuits) |
.mc |
Monte Carlo mismatch + process |
The spec → required-analysis-subset mapping in this table is a frozen
lookup, enforced by programs/ams_analysis_select.py — do NOT pick
the analysis set by hand (two agents would otherwise pick different /
incomplete subsets for the same spec list). Run it on the block's
spec.json (or the project dir to scan analog/*/spec.json) and use
the emitted analyses set:
python3 programs/ams_analysis_select.py <block>/spec.json
# -> {"analyses": [".op", ".ac", ".tran", ".noise"], "mapping": [...]}
It always selects .op (bias validation) when ≥1 measurable spec is
present, adds .mc whenever any spec declares a mismatch / σ / yield
concern, and FAILs honestly (exit 1) when a spec carries no recognizable
measurable metric. Agent judgment is only needed to override an
ambiguous / custom spec key the table does not recognize.
ENOB and SINAD require a sampled dynamic measurement; declared converter
SNR/SNDR use transient capture and spectral processing as well. A small-signal
.noise result cannot establish these converter metrics. Separate physical
noise specifications still select .noise. See
Analog Devices MT-003,
pages 1 and 5–6. Stimulus, sampling and capture settings must be recorded with
the result; choosing an engineering measurement setting does not add a new
electrical acceptance requirement to the source specification.
Workflow
- Pick the analysis subset — enforced by
programs/ams_analysis_select.py (see Analysis matrix)
- Build deck with corner + MC sweeps
- Run (ngspice / Xyce / Spectre / HSPICE)
- Extract measurements via
.meas statements — generated by programs/analog_meas_from_spec_gen.py
- Read the native corner-sweep results for every required process, voltage and temperature point. Compare each measured specification with its original bound and report missing corners explicitly.
- Review the native configuration and reports for every required corner and analysis role. Record missing libraries or unexecuted corners as NOT_MEASURED.
- Hand off to re-sizing loop
Output format
sim/<block>.sp (or equivalent) — simulator deck
sim/<block>_results.md:
- Spec table with pass/fail per corner — populated from
corner_yield_vs_spec_check.py (per-corner / per-spec PASS/FAIL re-derived from spec.json limits), not graded by eye
- Read the native corner-sweep results for every required process, voltage and temperature point. Compare each measured specification with its original bound and report missing corners explicitly.
- Sensitivity list (which device / parameter dominates) — agent judgment
- Suggested fixes — agent judgment
Tool prerequisites
Open source: ngspice (https://ngspice.sourceforge.io/), Xyce. Commercial: Cadence Spectre, Synopsys HSPICE, Silvaco SmartSpice.
Technical basis
Pelgrom mismatch model, corner methodology from PDK, Monte Carlo with correlated process parameters. Mixed-signal co-sim per Verilog-AMS / Verilog-A standards.
Handoff
- Failing corners →
/analog-sizing (re-size)
- Layout-driven failures →
/analog-layout
- Model issues → escalate to PDK team
Captured rule
When model qualification has no declared deck, the producer writes one per
PDK device the delivered netlist instantiates, per process corner and
temperature of the analog corner grid: the device, terminal count and geometry
of its first instance, biased at the block's delivered rail value. The IC
expert reviews those decks instead of writing them, and declares only what does
not follow mechanically: a model library whose corner sections carry no
process-corner name (for example worst/best-case passives) gets its sections
named in model_corner_sections, otherwise that device stays at its nominal
section. A device with no declared role or defining library leaves the row
NOT_MEASURED with that reason. Read every simulator measurement; do not fill in
a result or add a performance limit to obtain a model-qualification PASS.
Keep a requested DC measurement point inside the simulator's actual sweep.
A descending decimal sweep can stop just above a nominal zero endpoint;
starting at the requested zero preserves the bias and measurement target.
Repair the project deck and rerun the native measurement, rather than
substituting the nearby trace value. A successful model/device check does not
measure converter accuracy, supply rejection or electrical noise budgets.
1---2name: ams-sim3description: Plan and run analog / mixed-signal simulations — DC op, AC, transient, Monte Carlo, corner sweeps, PSRR/CMRR, noise — using ngspice, Xyce, Spectre, or HSPICE, and triage the results. Use when the user says "SPICE", "ngspice", "Monte Carlo", "corner simulation", "analog sim", "AC analysis", "transient", "PSRR", "CMRR", "noise analysis".4metadata:5 source: https://skillmd.com/skills/vibeic/ams-sim6---78# AMS Sim910Analog blocks must be verified across process corners, temperature, voltage, and mismatch. This skill plans the testbench matrix, generates the simulator decks, and triages results.1112## When to use1314- After `/analog-sizing` produces a schematic15- After `/analog-layout` + extraction (post-layout)16- When mismatching is the suspected failure mode (Monte Carlo)17- Mixed-signal co-simulation with a digital controller (ngspice + Verilog-A, or Spectre APS)1819## Inputs20211. Schematic / netlist (`.sp`, `.cir`, `.scs`)222. Device models from PDK (`.lib` / `.scs`)233. Specs to verify (gain, BW, PSRR, CMRR, noise, slew, settling, offset)244. Corner definition (FF/SS/TT/FS/SF × temp × supply)255. Monte Carlo N (typical 500–5000 runs)2627## Analysis matrix2829| Analysis | Purpose |30|---|---|31| `.op` | DC operating point, bias validation |32| `.dc` | Sweeps (supply, input, parameter) |33| `.ac` | Gain, bandwidth, phase margin |34| `.tran` | Settling, slew, large-signal; sampled converter ENOB/SNR/SNDR via spectrum |35| `.noise` | Input-referred noise and small-signal analog SNR estimates |36| `.pss` / `.pac` / `.pnoise` | Periodic steady-state (for RF / SC circuits) |37| `.mc` | Monte Carlo mismatch + process |3839The spec → required-analysis-subset mapping in this table is a frozen40lookup, **enforced by `programs/ams_analysis_select.py`** — do NOT pick41the analysis set by hand (two agents would otherwise pick different /42incomplete subsets for the same spec list). Run it on the block's43`spec.json` (or the project dir to scan `analog/*/spec.json`) and use44the emitted `analyses` set:4546```bash47python3 programs/ams_analysis_select.py <block>/spec.json48# -> {"analyses": [".op", ".ac", ".tran", ".noise"], "mapping": [...]}49```5051It always selects `.op` (bias validation) when ≥1 measurable spec is52present, adds `.mc` whenever any spec declares a mismatch / σ / yield53concern, and FAILs honestly (exit 1) when a spec carries no recognizable54measurable metric. Agent judgment is only needed to override an55ambiguous / custom spec key the table does not recognize.5657ENOB and SINAD require a sampled dynamic measurement; declared converter58SNR/SNDR use transient capture and spectral processing as well. A small-signal59`.noise` result cannot establish these converter metrics. Separate physical60noise specifications still select `.noise`. See61[Analog Devices MT-003](https://www.analog.com/media/en/training-seminars/tutorials/MT-003.pdf),62pages 1 and 5–6. Stimulus, sampling and capture settings must be recorded with63the result; choosing an engineering measurement setting does not add a new64electrical acceptance requirement to the source specification.6566## Workflow67681. Pick the analysis subset — **enforced by `programs/ams_analysis_select.py`** (see Analysis matrix)692. Build deck with corner + MC sweeps703. Run (ngspice / Xyce / Spectre / HSPICE)714. Extract measurements via `.meas` statements — generated by `programs/analog_meas_from_spec_gen.py`725. Read the native corner-sweep results for every required process, voltage and temperature point. Compare each measured specification with its original bound and report missing corners explicitly.736. Review the native configuration and reports for every required corner and analysis role. Record missing libraries or unexecuted corners as NOT_MEASURED.747. Hand off to re-sizing loop7576## Output format7778- `sim/<block>.sp` (or equivalent) — simulator deck79- `sim/<block>_results.md`:80 - Spec table with pass/fail per corner — populated from `corner_yield_vs_spec_check.py` (per-corner / per-spec PASS/FAIL re-derived from `spec.json` limits), not graded by eye81 - Read the native corner-sweep results for every required process, voltage and temperature point. Compare each measured specification with its original bound and report missing corners explicitly.82 - Sensitivity list (which device / parameter dominates) — agent judgment83 - Suggested fixes — agent judgment8485## Tool prerequisites8687Open source: ngspice (https://ngspice.sourceforge.io/), Xyce. Commercial: Cadence Spectre, Synopsys HSPICE, Silvaco SmartSpice.8889## Technical basis9091Pelgrom mismatch model, corner methodology from PDK, Monte Carlo with correlated process parameters. Mixed-signal co-sim per Verilog-AMS / Verilog-A standards.9293## Handoff9495- Failing corners → `/analog-sizing` (re-size)96- Layout-driven failures → `/analog-layout`97- Model issues → escalate to PDK team9899## Captured rule100101When model qualification has no declared deck, the producer writes one per102PDK device the delivered netlist instantiates, per process corner and103temperature of the analog corner grid: the device, terminal count and geometry104of its first instance, biased at the block's delivered rail value. The IC105expert reviews those decks instead of writing them, and declares only what does106not follow mechanically: a model library whose corner sections carry no107process-corner name (for example worst/best-case passives) gets its sections108named in `model_corner_sections`, otherwise that device stays at its nominal109section. A device with no declared role or defining library leaves the row110NOT_MEASURED with that reason. Read every simulator measurement; do not fill in111a result or add a performance limit to obtain a model-qualification PASS.112113Keep a requested DC measurement point inside the simulator's actual sweep.114A descending decimal sweep can stop just above a nominal zero endpoint;115starting at the requested zero preserves the bias and measurement target.116Repair the project deck and rerun the native measurement, rather than117substituting the nearby trace value. A successful model/device check does not118measure converter accuracy, supply rejection or electrical noise budgets.