$npx -y skills add Arcadia-1/gmoverid-skill --skill sky130-pdkSky130A open PDK workflow for ngspice-based analog simulation. Use when an agent needs to install or locate Sky130A via Volare/open_pdks, run process-corner PVT simulations, run process Monte Carlo or mismatch-aware smoke tests, instantiate sky130_fd_pr devices, or validate Sky13
| 1 | # Sky130A PDK Skill |
| 2 | |
| 3 | Use this skill for Sky130A ngspice work with the open-source SkyWater/open_pdks PDK. It covers PDK installation, model-path discovery, process corners, process Monte Carlo, and small smoke examples. |
| 4 | |
| 5 | Do not commit the PDK data itself. The `sky130A/` runtime tree is installed outside the project, usually through Volare. |
| 6 | |
| 7 | ## Quick Start |
| 8 | |
| 9 | Install the PDK with Volare: |
| 10 | |
| 11 | ```bash |
| 12 | python3 -m pip install --user volare |
| 13 | export PATH="$HOME/.local/bin:$PATH" |
| 14 | volare enable --pdk sky130 c6d73a35f524070e85faff4a6a9eef49553ebc2b |
| 15 | ``` |
| 16 | |
| 17 | Run smoke examples from the skill directory: |
| 18 | |
| 19 | ```bash |
| 20 | cd sky130-pdk |
| 21 | python3 assets/run_sky130_mos_iv_pvt_mc.py |
| 22 | python3 assets/run_sky130_ringosc_pvt_mc.py |
| 23 | python3 assets/run_sky130_five_transistor_ota_pvt_mc.py |
| 24 | ``` |
| 25 | |
| 26 | Each script also accepts: |
| 27 | |
| 28 | ```bash |
| 29 | --pdk-root <path-containing-sky130A-or-sky130A-itself> |
| 30 | --workdir <output-directory> |
| 31 | --mc-runs <N> |
| 32 | --jobs <parallel-ngspice-jobs> |
| 33 | ``` |
| 34 | |
| 35 | Run direct ngspice examples: |
| 36 | |
| 37 | ```bash |
| 38 | export PDK_ROOT="$(volare path)/volare/sky130/versions/$(volare output --pdk sky130)" |
| 39 | cd examples/ota-5t |
| 40 | ngspice -b tb.spi |
| 41 | ``` |
| 42 | |
| 43 | ## Model Entry |
| 44 | |
| 45 | Prefer the continuous model library for PVT/Monte Carlo smoke: |
| 46 | |
| 47 | ```text |
| 48 | sky130A/libs.tech/combined/continuous/sky130.lib.spice |
| 49 | ``` |
| 50 | |
| 51 | Use `.lib` sections: |
| 52 | |
| 53 | ```spice |
| 54 | .lib ".../sky130.lib.spice" tt |
| 55 | .lib ".../sky130.lib.spice" ff |
| 56 | .lib ".../sky130.lib.spice" ss |
| 57 | .lib ".../sky130.lib.spice" fs |
| 58 | .lib ".../sky130.lib.spice" sf |
| 59 | .lib ".../sky130.lib.spice" mc |
| 60 | ``` |
| 61 | |
| 62 | Common primitive devices: |
| 63 | |
| 64 | ```spice |
| 65 | Xn d g s b sky130_fd_pr__nfet_01v8 l=0.15 w=1.0 nf=1 |
| 66 | Xp d g s b sky130_fd_pr__pfet_01v8 l=0.15 w=2.0 nf=1 |
| 67 | ``` |
| 68 | |
| 69 | The continuous Sky130 models use micron-valued `l` and `w` parameters in these examples. |
| 70 | |
| 71 | ## Included Smoke Examples |
| 72 | |
| 73 | - `run_sky130_mos_iv_pvt_mc.py`: NMOS Id-Vgs smoke across `tt/ff/ss/fs/sf` plus MC current spread. |
| 74 | - `run_sky130_ringosc_pvt_mc.py`: three-stage CMOS ring oscillator PVT/MC frequency smoke. |
| 75 | - `run_sky130_five_transistor_ota_pvt_mc.py`: five-transistor OTA low-frequency AC gain PVT/MC smoke. |
| 76 | - `examples/`: three circuit folders, each with `circuit.scs/.spi` and a standalone `tb.scs/.spi`. |
| 77 | |
| 78 | The ring oscillator and OTA examples belong in this skill because they are Sky130A PDK smoke/application examples. They are not generic ngspice tutorials and should not be placed in the PTM transistor-model library. |
| 79 | |
| 80 | ## Sky130 SCS To ngspice Sky130 |
| 81 | |
| 82 | ngspice does not parse full Spectre `.scs` syntax. This skill includes a small Sky130-oriented converter for user circuit netlists: |
| 83 | |
| 84 | Use `--fragment` when converting a user circuit/subcircuit file that will be |
| 85 | included by another testbench. Fragment mode suppresses the auto-inserted model |
| 86 | library, control block, and final `.end`: |
| 87 | |
| 88 | ```bash |
| 89 | python3 assets/scs_sky130_to_ngspice_sky130.py examples/ring_oscillator/circuit.scs \ |
| 90 | --fragment -o /tmp/ring_oscillator.spi |
| 91 | ``` |
| 92 | |
| 93 | The converter intentionally supports only a practical subset: `parameters`, `include ... section=`, local `.scs` includes, `options`, `subckt`/`ends`, Sky130 subcircuit instances, `vsource`/`isource`, `vcvs`, R/C/L passives, `save`, `ic`, `measure`/`meas`, simple `tran`/`dc`/`ac`/`noise` analyses, and basic ngspice `.control` pass-through. It does not translate the Sky130 PDK model files themselves; output netlists reference the installed ngspice model library. |
| 94 | |
| 95 | Standalone examples are in `examples/`: |
| 96 | |
| 97 | - `ring_oscillator/circuit.scs` plus `ring_oscillator/tb.scs`. |
| 98 | - `ota-5t/circuit.scs` plus `ota-5t/tb.scs`. |
| 99 | - `amp-2s-miller/circuit.scs` plus `amp-2s-miller/tb.scs`. |
| 100 | |
| 101 | Convert a standalone Spectre-style testbench directly: |
| 102 | |
| 103 | ```bash |
| 104 | python3 assets/scs_sky130_to_ngspice_sky130.py examples/ota-5t/tb.scs -o /tmp/ota-5t_tb.spi |
| 105 | ngspice -b /tmp/ota-5t_tb.spi |
| 106 | ``` |
| 107 | |
| 108 | ## References |
| 109 | |
| 110 | Read these only when needed: |
| 111 | |
| 112 | - `references/installation.md`: installing Volare/Sky130A and locating `PDK_ROOT`. |
| 113 | - `references/ngspice-corners.md`: ngspice `.lib` sections, PVT/MC usage, and troubleshooting. |
| 114 | - `references/five-transistor-ota-testbenches.md`: guidance for extending the included OTA smoke bench. |