klayout-toolsView on GitHub

klayout-tools

IC layout for AI agents

scaffold — in progress, in the open

Standalone tools that let AI agents parse, check, and edit chip layouts: GDSII and OASIS streams, DRC decks, headless everything, machine-readable JSON everywhere. Built on KLayout's Python API.

It is the kicad-tools playbook one layer down the stack. Over there, agents take a design from schematic to routed PCB to fabrication package, and a gallery of real boards proves it. Here, the same pattern meets silicon.

An agent can take a spec → schematic/generator → sized circuit → layout → DRC/LVS clean → extracted netlist → simulation-verified, on an open PDK, unaided — with every step headless and JSON-contracted. That closed loop is the target.

# the interface contract we are building toward
klt layers design.gds              # enumerate layers, JSON out
klt cells design.gds --top         # cell hierarchy
klt drc design.gds --deck sky130   # DRC, structured violations
klt stats design.gds --per-layer   # densities, bbox, counts

Progress lands in the repo first; worked examples appear here the way boards appear in the kicad-tools gallery. See the roadmap for the build order and the architecture doc for how the pieces fit.

Gallery

Blocks discovered by the build-time layout data loader (src/data/loadLayouts.ts), each rendered from its klt layout-metrics output.

10 blocks · 8 with generated artifacts

Electromagnetics

Real geode-fem field solves, browsable the same way as the layout gallery above. Every mesh, field overlay, and S-parameter/capacitance result here traces to a committed solver run — see each entry’s provenance panel for the exact solver version, geometry, and solve parameters behind it.

Patch antenna — S11 + near field

Probe-fed FR-4 microstrip patch, driven full-wave FEM solve swept 2.0–3.0 GHz. Validated against a Balanis cavity-model oracle for resonant frequency and broadside directivity.

Loading patch antenna solve…

Spiral inductor — L/Q

Port-driven 3.5-turn square spiral inductor, full-wave FEM solve swept 0.1–40 GHz. Validated against the Mohan analytic formula and MoM PEEC oracle comparisons (geode-fem's flagship benchmark).

Loading spiral inductor solve…

On-chip power/ground coupling — a real fleet block

The real VGND/VPWR met1 power-rail pair of a gallery block, extracted straight from its committed GDS — not a hand-drawn shape. A DC multi-conductor electrostatic FEM solve (geode-fem) computes the self- and mutual/coupling capacitance between the two rails, cross-checked against the sky130 open PDK’s own published parasitic-capacitance model. This previews the output the MoM (#701) and FEM (#708) field-solver backend epics intend to produce for any real layout, and the kind of parasitic a future canary’s post-layout simulation (#709) would consume alongside its netlist.

Loading interconnect-coupling solve…