
Audio routed
Bu3nd14/EDA
Scripted analog EDA + PCB automation environment (KiCad 10 + ngspice + SKiDL) for macOS Apple Silicon

Scripted analog EDA + PCB automation environment (KiCad 10 + ngspice + SKiDL) for macOS Apple Silicon
Test board is an open-source printed circuit board by Bu3nd14, from the Bu3nd14/EDA repository on GitHub. It is a 2-layer board of 60 × 50 mm with 2 parts on 2 nets, routed with 1 track and 1 via.
Its parts include 1 capacitor and 1 resistor.
A scripted, non-interactive toolchain for taking an analog circuit from code-first topology definition through SPICE simulation, KiCad schematic generation, PCB layout, autorouting, DRC/ERC, and fabrication export — on macOS / Apple Silicon.
This README documents only what has been verified by actually running
commands in this environment. See docs/limitations.md for the full
limitations list and docs/smoke-test.md for the end-to-end pipeline
evidence.
| Tool | Version | Path | Notes |
|---|---|---|---|
| ngspice | 47 | /opt/homebrew/bin/ngspice | Native arm64 (file → "Mach-O 64-bit executable arm64", non-fat). Installed via brew install ngspice. |
| KiCad | 10.0.6 | App: /Users/roberto/Applications/KiCad.app; CLI: /Users/roberto/Applications/KiCad.app/Contents/MacOS/kicad-cli | Universal binary (x86_64 + arm64), runs natively on Apple Silicon. Installed from the official CERN-hosted dmg into ~/Applications, without sudo. |
| Python (project) | 3.13.15 | /opt/homebrew/bin/python3.13 | Native arm64. Project venv at /Users/roberto/EDA/env/venv. |
| SKiDL | 2.3.0 | installed in env/venv | Code-first circuit definition layer. |
| Python (KiCad bundled) | 3.9.13 | /Users/roberto/Applications/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9/bin/python3.9 | The only interpreter where import pcbnew works. pcbnew is not pip-installable. |
| kinet2pcb | (per bundled install) | installed into the bundled python3.9 via --user pip install | Not installed in the venv. |
| Freerouting | 2.4.1 | /Users/roberto/EDA/scripts/tools/freerouting.jar | External autorouter. Needs a JRE (brew install openjdk). |
poppler (pdftotext) | 26.09.0 | /opt/homebrew/bin/pdftotext | Native arm64 (file → "Mach-O 64-bit executable arm64"). Installed via brew install poppler in L6. Reads vendor datasheet PDFs past page 1, which sips/qlmanage cannot. No script requires it, so verify_env.sh does not check for it: scripts/pdf_glyphs.py is the stdlib-only fallback. |
brew install ngspice.~/Applications without sudo.
brew install --cask kicad)
FAILS during install because its bundled demos artifact needs sudo to
write to /Library/Application Support/kicad. Use the no-sudo dmg route
instead — do not retry the brew cask expecting a different result.python3.13 -m venv /Users/roberto/EDA/env/venv, then
pip install skidl (→ SKiDL 2.3.0) inside that venv./Users/roberto/Applications/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -m pip install --user kinet2pcbfreerouting.jar placed at scripts/tools/freerouting.jar.
Requires a JRE: brew install openjdk, then invoke with
PATH="/opt/homebrew/opt/openjdk/bin:$PATH" java -jar scripts/tools/freerouting.jar ....brew install poppler (added in L6). Only needed to read
vendor datasheet PDFs beyond the first page — macOS ships sips and
qlmanage, which render page 1 only. No script in this repo depends on
it; scripts/pdf_glyphs.py covers the text case with the stdlib alone.Selected: KiCad 10 + ngspice, with SKiDL as the code-first circuit definition layer and Freerouting as an external autorouter.
| Alternative | Rejected because |
|---|---|
| LibrePCB | No SPICE export at all — structurally incompatible with a simulate-then-layout workflow. SKiDL also has no LibrePCB output path. |
| Qucs-S | No headless/CLI mode found. Usable only as an optional human-facing GUI visualization layer, not automation. |
| gEDA/gaf | Effectively dead (~1-2 commits/year, last stable release 2020). |
| Xyce | Kept only as a possible alternate SPICE backend. ngspice is the reference engine KiCad targets and has a faster release cadence. |
A hybrid model with a hard boundary:
circuits/*.py (version-controlled,
no GUI state). TODO: unverified — a circuits/ directory does not yet
exist in this repo; the only SKiDL topology definition currently present is
the smoke-test fixture at smoke/rc_circuit.py..kicad_pcb file, because layout cannot be expressed in SKiDL..kicad_pcb as a topology source.kicad-cli sch export netlist --format spice, not from SKiDL's native
SPICE generator. SKiDL's native SPICE path does not work with
KiCad-library parts — see Limitations #2.EDA/
models/ curated, canonical SPICE models (.include-able), each with a
<file>.provenance.json sidecar. See models/README.md,
models/PROVENANCE_CONVENTION.md.
vendor/ read-only vendor originals (mode 0444, sha256 + PROVENANCE.json
per part). Never hand-edited. See vendor/README.md.
scripts/ automation entry points (setup, validation, simulation, ERC/DRC,
fab export) and support tools (freerouting.jar). Owned/maintained
separately — see "Scripts" below.
testbenches/ standalone ngspice .cir testbenches (01_op .. 08_vendor_model)
used to exercise/validate analysis types and the model library.
smoke/ scratch: the trivial RC-lowpass smoke-test fixture and its
full pipeline output (schematic, netlists, sim results, PCB,
routing, DRC/ERC reports, gerbers).
pcb/ scratch: PCB-automation-engineer's capability tests
(board creation, DSN/SES routing round-trip, DRC, fab export).
results/ scratch: simulation outputs (raw + normalized CSV/JSON) and
model-validation testbenches/results.
docs/ this documentation set (architecture, limitations, smoke-test
report).
env/venv/ project Python 3.13 virtualenv (SKiDL).
.claude/agents/ subagent role definitions (see AGENTS.md).circuits/ (canonical topology home per the source-of-truth strategy) does
not exist yet — TODO: unverified, flagged rather than assumed.
smoke/ and results/ are scratch, not canonical; models/, vendor/ are
canonical (see AGENTS.md operating rules).
All ngspice runs are non-interactive (ngspice -b). Verified analysis types,
with existing testbenches under testbenches/:
| Testbench | Analysis |
|---|---|
01_op.cir | .op |
02_dc.cir | .dc sweep |
03_ac.cir | .ac |
04_tran.cir | .tran |
05_noise.cir | .noise |
06_paramsweep.cir | parameter sweep (via .control/alterparam, not native .step — see Limitations #10) |
07_temp.cir | temperature sweep |
08_vendor_model.cir | vendor-model .include |
Run directly, e.g.:
/opt/homebrew/bin/ngspice -b /Users/roberto/EDA/testbenches/04_tran.cirResults are written via wrdata/.print/.write and normalized to
CSV/JSON with scripts/normalize_wrdata.py (present under results/*.normalized.{csv,json}).
Accuracy: verified against closed-form theory (RC -3dB point, RC time constant, thermal noise floor) to well under 1% error. Example from the smoke-test RC fixture (R=1k, C=100n): theoretical fc = 1591.55 Hz, simulated fc = 1587.62 Hz, error 0.25%.
Model library: models/ contains curated device models (resistor,
capacitor, inductor, diode, BJT NPN/PNP, MOSFET N/P, JFET, opamp macro-model,
generic transformer subckt), each validated by
scripts/validate_models.py against a real ngspice testbench (38/38 checks
passing at last verification). The R/C/L/transformer/opamp checks are exact
analytic cross-checks; the BJT/MOSFET/JFET checks are order-of-magnitude
sanity checks only, not exact — see Limitations #11. The validator was
proven to catch both a bad model parameter and a tampered vendor file
(exit 1 in both cases).
Vendor model provenance: vendor/ holds read-only (mode 0444) originals with
sha256 + PROVENANCE.json; models/ holds curated/derived copies, each with
a .provenance.json sidecar recording origin and any changes. See
models/PROVENANCE_CONVENTION.md.
Verified capabilities, driven through the pcbnew Python API (bundled
python3.9) and kicad-cli:
kicad-cli sch erc --format json --exit-code-violations — real
JSON output, correct exit codes.kicad-cli pcb drc --format json --exit-code-violations — real
JSON, exit 5 on violations / 0 when clean. Verified semantically correct:
flagged genuine unconnected items before routing, clean after.kicad-cli pcb export gerbers and
kicad-cli pcb export drill — verified by inspecting file contents (valid
RS-274X and Excellon data), not just exit codes.pcbnew.ExportSpecctraDSN → Freerouting CLI → pcbnew.ImportSpecctraSES →
DRC clean (0 violations), verified end-to-end. Note kicad-cli does not
offer DSN export — only the pcbnew Python API does.Example Freerouting invocation (from smoke/run_pipeline.sh):
PATH="/opt/homebrew/opt/openjdk/bin:$PATH" java -jar /Users/roberto/EDA/scripts/tools/freerouting.jar \
-de rc_circuit.dsn -do rc_circuit.ses -mp 1 -l enGUI-only KiCad features (e.g. the interactive router) were not tested and must not be assumed scriptable (Limitations #12).
SKiDL runs on the project venv, Python 3.13
(/Users/roberto/EDA/env/venv/bin/python3). pcbnew and kinet2pcb run
only on KiCad's bundled Python 3.9
(/Users/roberto/Applications/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9/bin/python3.9).
Any script that touches both must bridge explicitly with absolute
interpreter paths — invoking each stage with its own interpreter, e.g. from
smoke/run_pipeline.sh:
SKIDL_PY=/Users/roberto/EDA/env/venv/bin/python3
KICAD_PY=/Users/roberto/Applications/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9/bin/python3.9venv/bin/python -c "import pcbnew" fails with ModuleNotFoundError —
this is not a configuration bug, it is the expected split. Never assume one
interpreter can do both halves of the pipeline.
Scripts live under scripts/ (owned/maintained by a separate workflow —
see AGENTS.md). Confirmed present at time of writing:
scripts/validate_models.py, scripts/freeze_vendor.sh,
scripts/normalize_wrdata.py, scripts/pcbnew_test.py,
scripts/specctra_roundtrip_test.py, scripts/tools/freerouting.jar.
The following entry points are documented interface (purpose/invocation as specified) — they were being written/verified concurrently with this documentation, so their internals are not described here beyond intent:
| Script | Purpose |
|---|---|
scripts/setup.sh | One-shot environment setup. |
scripts/verify_env.sh | Verify installed tool versions/paths match what's documented. |
scripts/run_simulation.sh <netlist.cir> [outdir] | Run an ngspice batch simulation and extract results. |
scripts/run_tests.sh | Run the project's test/validation suite. |
scripts/validate_models.py | Validate every model in models/ against a real ngspice testbench; also checks provenance (--check-provenance). |
scripts/run_erc.sh <sch> [outjson] | Run kicad-cli sch erc and emit JSON. |
scripts/run_drc.sh <pcb> [outjson] | Run kicad-cli pcb drc and emit JSON. |
scripts/export_fab.sh <pcb> [outdir] | Export gerbers/drill; refuses to export if DRC fails. |
scripts/check_schematic.py <manifest.json> <netlist.cir> | Verify a hand-laid-out schematic drawing against the netlist, in both directions. Exit 1 on any mismatch. |
scripts/pdf_glyphs.py <file.pdf> [--offset N|--scan|--raw] | Extract text from a PDF with the stdlib only (zlib + the text operators). The mechanical half of the two-independent-readings rule ADR-013 imposes on hand-transcribed vendor models. Not a general-purpose extractor — see its header. |
scripts/freeze_vendor.sh | Set every file under vendor/ to mode 0444. Idempotent. |
TODO: unverified — confirm the final invocation syntax/flags of the above
against the actual script contents once they land; this table reflects the
interface as specified to this documentation task, not a read of the scripts
themselves (except validate_models.py, which already exists and is
described above from models/README.md).
Readable analog schematics cannot be auto-placed — researched and tested
against ASG, lcapy and netlistsvg, none of which work for this (see
docs/limitations.md #16). Every tool that does automatic placement targets
digital netlists, where dataflow dictates layout; analog readability lives in
conventions that encode designer intent and are absent from the netlist.
Drawings are therefore laid out by hand, in code, with schemdraw — a text
source that versions and diffs. The resulting risk, a drawing drifting silently
from the circuit, is mechanised away: each drawing emits a connectivity manifest
next to its SVG, and scripts/check_schematic.py compares it to the netlist in
both directions (nothing invented, nothing omitted). scripts/run_tests.sh
discovers every manifest under docs/*/schematic/ automatically.
The checker was proven to catch an invented device, an omitted device and a miswired pin — it passes a correct manifest and fails a deliberately broken one.
A human-reviewable schematic is a precondition for gates G1 and G2. See
docs/architecture.md for the convention and AGENTS.md for the gate rule.
Full detail in docs/limitations.md. Summary (none of these are soft-pedaled):
kicad-cli sch export netlist --format spice path is used instead.Sim.Type/Sim.Device when caching symbols into the generated .kicad_sch — silent invalid SPICE line unless set manually.power_pin_not_driven on GND + 3 lib_symbol_mismatch warnings).KICAD10_SYMBOL_DIR/KICAD10_FOOTPRINT_DIR for SKiDL 2.3.0); wrong version → confusing FileNotFoundError.item.GetLayerName() in pcbnew is unreliable — use board.GetLayerName(item.GetLayer()) or IsOnLayer().ImportSpecctraSES gives no error message on failure — only True/False..step (use .control/alterparam); multi-value .temp silently falls back to 27°C with only a warning (use dc TEMP start stop step inside .control); .lib <file> fails for plain model files (use .include); C/L need C=/inductance=, not a positional value; the first line of any .cir is always a title/comment.validate_models.py are order-of-magnitude sanity checks, not exact analytic cross-checks like R/C/L/transformer/opamp.Trivial RC low-pass fixture (R=1k, C=100n), driven through the full pipeline
by smoke/run_pipeline.sh. 11 stages PASSED, 3 PARTIAL, 0 FAILED.
| Stage | Verdict |
|---|---|
| Circuit definition | PASSED |
| Simulation | PASSED |
| Result extraction | PASSED |
| KiCad netlist generation | PASSED |
| PCB creation | PASSED |
| Footprint assignment | PASSED |
| Placement | PASSED |
| Routing | PASSED |
| DRC | PASSED |
| Gerber export | PASSED |
| Drill export | PASSED |
| Schematic generation | PARTIAL |
| SPICE netlist generation | PARTIAL |
| ERC | PARTIAL |
See docs/smoke-test.md for per-stage evidence (exact JSON/CSV values).
# Model library validation (38/38 checks)
/usr/bin/python3 /Users/roberto/EDA/scripts/validate_models.py
# Individual SPICE testbenches
/opt/homebrew/bin/ngspice -b /Users/roberto/EDA/testbenches/01_op.cir
/opt/homebrew/bin/ngspice -b /Users/roberto/EDA/testbenches/04_tran.cir
# ... etc. for 02..08
# Full smoke-test pipeline (schematic -> sim -> PCB -> routing -> DRC -> gerbers)
zsh /Users/roberto/EDA/smoke/run_pipeline.sh
# Vendor freeze re-enforcement (idempotent)
/Users/roberto/EDA/scripts/freeze_vendor.shdocs/architecture.md — architecture decision detail (selected stack,
rejected alternatives, source-of-truth contract).docs/limitations.md — full limitations list with detail.docs/smoke-test.md — per-stage smoke-test evidence.AGENTS.md — subagent roster and delegation/operating rules.models/README.md, models/PROVENANCE_CONVENTION.md, vendor/README.md —
model library and provenance conventions (owned by the scaffolding agent,
read here for reference).| Qty | Value | Footprint | References |
|---|---|---|---|
| 1 | 100nF | C_0805_2012Metric | C1 |
| 1 | 10k | R_0805_2012Metric | R1 |

Bu3nd14/EDA
Scripted analog EDA + PCB automation environment (KiCad 10 + ngspice + SKiDL) for macOS Apple Silicon

Bu3nd14/EDA
Scripted analog EDA + PCB automation environment (KiCad 10 + ngspice + SKiDL) for macOS Apple Silicon

Bu3nd14/EDA
Scripted analog EDA + PCB automation environment (KiCad 10 + ngspice + SKiDL) for macOS Apple Silicon

Bu3nd14/EDA
Scripted analog EDA + PCB automation environment (KiCad 10 + ngspice + SKiDL) for macOS Apple Silicon

Bu3nd14/EDA
Scripted analog EDA + PCB automation environment (KiCad 10 + ngspice + SKiDL) for macOS Apple Silicon

Bu3nd14/EDA
Scripted analog EDA + PCB automation environment (KiCad 10 + ngspice + SKiDL) for macOS Apple Silicon

hzeller/rpi-rgb-led-matrix
Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO


adamws/kicad-kbplacer
KiCad plugin for automatic keyboard's key placement and routing

Luos-io/luos_engine
Open-source and real-time orchestrator for cyber-physical-systems, to easily design, test and deploy embedded applications and digital twins.

NVNTLabs/switch2-SDEX2M2
Micro SD Express to M.2 NVME Adapter for Nintendo Switch 2

BlueSCSI/BlueSCSI-v2
BlueSCSI v2/Ultra - an open source, open hardware, SCSI emulator using the Pi Pico PR2040 and Pico 2 RP2350

ohmtech-rdi/eurorack-blocks
Software to Hardware Prototyping for Eurorack using C++, Max/Gen~ or Faust

It measures 60 × 50 mm and has 2 copper layers, 1.6 mm thick.
2 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the Bu3nd14/EDA repository on GitHub, at the commit this page was made from: the board is pcb/test_board.kicad_pcb and its schematic smoke/rc_circuit.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask Bu3nd14 before reusing the design.