Tutorials & runnable demos

Tutorials

Where you learn klink, and where the runnable demos live. Start with the chat walkthroughs to feel how the agent turns a sentence into a layout, then follow the step-by-step tutorials by area; each runnable starter card gives the run command and measured numbers, so you can just type it and go.

New here? Read Core Concepts first: geometry-first, Port/Anchor, the user-project model — these tutorials assume that background. Cards with a python … command are wheel-packaged runnable starters (klink init scaffolds them into your project); running a demo needs no MCP — it's an ordinary script talking to KLayout over the plugin port. Use an empty or test session, not your hand-built working tab.

PnR · place & route any device digital/

Place, route and live-LVS any custom device from a netlist — device-agnostic place & route, not "digital logic". This group each needs a live KLayout session.

structdevice · PnR Needs a live KLayout session

Custom device: fit → PCell → P&R → LVS

Fit a parametric edge model from a few exemplar drawings at different sizes, register a real PCell, place 173 instances from a netlist, run FlexDR detailed routing, finish with live LVS match=True.

python example_template/digital/fit_device_pnr_lvs.py --port <port>

routed 94/94 · LVS match=True · 173 devices

Read the tutorial →
structdevice · padframe Needs a live KLayout session

A probe-card-first padframe

The probe card / pad ring exists first and the circuit must meet it: harvest the ring, assign net→pad, place half-in/half-out, split the power grid by region — both the card and --no-card bare-stub modes pass live LVS match=True.

python example_template/digital/padframe_pnr_lvs.py --port <port>

routed 94/94 · LVS match=True · 16 pads connected

Read the tutorial →
structdevice · scale Needs a live KLayout session

Multilayer place & route at scale

A 766-device synthetic netlist (toy 4-bit ALU, 268 gates); a built-in layer-count advisor compares core-area cost on a 3-layer vs a custom 7-layer stack, then a multilayer routing engine wires it. Copy the file, edit PUBLIC_MULTILAYER for your own stack.

python example_template/digital/multilayer_pnr_lvs.py --port <port>

routed 405/405 · LVS match=True · 766 devices · ~17s (run the command; no separate step-by-step page)

structdevice · netlist Needs a live KLayout session

Hand-written netlist → lint → P&R → LVS

A 3-stage ring oscillator hand-written as a netlist, first lint_netlist (fix-it hints before any geometry exists), then place / route / LVS. A netlist is pure data — any topology, no logic synthesizer needed.

python example_template/digital/chat_to_netlist_pnr.py --port <port>

lint 0 err · routed 3/3 · LVS match=True (run the command; no separate step-by-step page)