Loading files…
GNN-guided simulated annealing for PCB component placement. We train a Graph Attention Network on SA rollout data to learn which components to move and where, then use these predictions to bias the SA search. Early results show up to 9.2% HPWL reduction on KiCad designs. Dataset includes production boards up to 681 components (Antmicro Jetson Orin baseboard, HackRF One SDR).
Paper: adekoya2026_gat_pcb_placement.pdf
KiCad .kicad_pcb
│
▼
┌──────────────┐
│ S-expr Parser │ ──→ Components, Nets, Board geometry
└──────┬───────┘
│
▼
┌──────────────┐ ┌──────────────┐
│ Graph Laplacian │ ──→ │ Spectral Init │ (Fiedler vectors)
│ L = D - A │ └──────┬───────┘
└──────────────┘ │
│ ▼
▼ ┌──────────────┐
┌──────────────┐ │ SA Rollouts │ ──→ Training data
│ GAT (2-layer) │◀── │ 10 × short SA │ (accepted moves,
│ 4-head attn │ └──────────────┘ improvements)
│ move + quality │
└──────┬───────┘
│
▼
┌──────────────────────────┐
│ GNN-Guided SA │
│ P(component i) ∝ softmax(q_i / τ) │
│ Δx, Δy = GNN prediction + noise │
│ Accept via Boltzmann: e^{-ΔE/T} │
└──────────────────────────┘
│
▼
Optimized Placement
Evaluated on 12 KiCad PCBs (5 to 94 components) parsed directly from .kicad_pcb files, sourced from open-source hardware on GitHub. Three additional production boards (207 to 681 components) are included in the dataset for GPU/TPU evaluation via Colab.
| Board | Components | Nets | SA HPWL | GNN HPWL | HPWL Δ | SA Cost | GNN Cost |
|---|---|---|---|---|---|---|---|
| stickhub | 94 | 45 | 1125.9 | 1022.1 | -9.2% | 1127.8 | 1757.3 |
| rp2040_debugger | 69 | 55 | 1248.8 | 1375.4 | +10.1% | 1251.1 | 1464.6 |
| motor_controller | 51 | 36 | 883.2 |
| 918.4 |
| +4.0% |
| 883.5 |
| 1116.6 |
| keyboard_rev0 | 37 | 46 | 3086.2 | 4228.8 | +37.0% | 8459.2 | 10468.6 |
| pluto_watch | 37 | 52 | 867.1 | 838.0 | -3.4% | 867.2 | 862.0 |
| kitchen_timer | 35 | 31 | 605.9 | 828.4 | +36.7% | 611.1 | 935.4 |
| rgb_to_hdmi | 32 | 32 | 721.9 | 776.8 | +7.6% | 723.5 | 865.7 |
| snapvcc | 26 | 8 | 136.4 | 106.9 | -21.6% | 136.5 | 118.2 |
| dali_stm32 | 22 | 33 | 572.5 | 721.0 | +25.9% | 572.5 | 760.6 |
| mmdvm_hotspot | 21 | 29 | 839.7 | 1033.5 | +23.1% | 840.0 | 1606.8 |
| tomu | 17 | 17 | 176.5 | 174.1 | -1.4% | 176.5 | 222.7 |
| m2sata | 5 | 17 | 200.1 | 410.9 | +105.3% | 200.1 | 411.7 |
Key findings:
pip install torch numpy matplotlib
python3 learn.py data/stickhub.kicad_pcb # single board, default (80 epochs, 10 rollouts)
python3 graphs.py # generates all plots from results/
Requires Python 3.10+ and PyTorch with CUDA, TPU (via torch_xla), MPS (Apple Silicon), or CPU fallback.
15 KiCad PCB designs from open-source hardware, spanning hobby projects to production carrier boards:
| Board | Components | Nets | Source |
|---|---|---|---|
| jetson_orin_baseboard | 681 | 644 | Antmicro (NVIDIA Jetson carrier) |
| hackrf_one | 437 | 319 | Great Scott Gadgets (production SDR) |
| artix_dc_scm | 207 | 224 | Antmicro (FPGA server mgmt) |
| stickhub | 94 | 45 | USB hub |
| rp2040_debugger | 69 | 55 | Raspberry Pi debug probe |
| motor_controller | 51 | 36 | H-bridge motor driver |
| keyboard_rev0 | 37 | 46 | Mechanical keyboard controller |
| pluto_watch | 37 | 52 | Casio F-91W replacement |
| kitchen_timer | 35 | 31 | MCU countdown timer |
| rgb_to_hdmi | 32 | 32 | Video signal converter |
| snapvcc | 26 | 8 | Compact power supply |
| dali_stm32 | 22 | 33 | DALI lighting interface |
| mmdvm_hotspot | 21 | 29 | Digital voice modem |
| tomu | 17 | 17 | USB-insertable ARM MCU |
| m2sata | 5 | 17 | M.2 to SATA adapter |
| File | Purpose |
|---|---|
learn.py | GAT architecture, training loop, GNN-guided SA, experiment runner |
placer.py | KiCad parser, cost functions, baseline SA, spectral placement |
graphs.py | Publication-quality matplotlib plots |
program.md | Experiment strategy and research plan |
PCB placement is NP-hard. A board with N components and G grid positions has O(G^N) configurations. The optimization landscape includes wirelength, component overlap, board boundary constraints, EMC, thermal, and signal integrity — all interacting across domains.
SA has been the gold standard for 40 years because the Boltzmann acceptance criterion (P = e^{-ΔE/T}) allows escaping local minima. But SA relies on random move proposals. Our insight: a GNN trained on short SA rollouts can learn which components to move and in which direction, replacing random exploration with informed proposals.
All serious placement research targets VLSI/ASIC. PCB placement is wide open.
| Paper | Venue | Contribution |
|---|---|---|
| AlphaChip (Mirhoseini et al.) | Nature 2021 | RL for ASIC floorplanning, deployed in Google TPUs |
| DREAMPlace (Lin et al.) | DAC 2019 | Placement as neural network training, 40x GPU speedup |
| TransPlace (Cheng et al.) | KDD 2025 | Transferable GNN global placement |
| ChipDiffusion (Vint et al.) | ICML 2025 | Diffusion for zero-shot chip placement |
| DiffPlace (Liu et al.) | 2025 | Conditional diffusion for VLSI with constraints |
| Cypress (Lu et al.) | ISPD 2025 | VLSI-inspired PCB placement with GPU acceleration (Best Paper) |
| C3PO (Lu et al.) | ASP-DAC 2026 | Commercial-quality global placement |
| Netlistify (Huang et al.) | MLCAD 2025 | Schematics to netlists with deep learning (Best Artifact) |
| PCB-Bench | ICLR 2026 | First LLM benchmark for PCB tasks |
| Component Centric Placement | arXiv 2026 | PCB-specific graph representations |
| GNN for PCB Schematics | 2025 | Auto-adding decoupling caps via graph prediction |
The cost function today optimizes three things:
These are the standard baseline metrics for placement research (VLSI uses the same starting point). The system does not yet model:
The roadmap is to add these as weighted terms in the cost function (e.g., cost = HPWL + overlap + decoupling_distance + group_separation + EMI_penalty) and encode constraint types as edge features in the GNN graph so the network learns that some connections (power net between cap and IC) matter more than others (signal net between distant connectors).
The GNN learns wirelength optimization but underfits on quality prediction (R² ≈ 0.001–0.079), which is why overlap isn't resolved. The local runs used only 10 rollouts and 80 epochs — not enough signal. The path forward:
Built by Trace — an AI-native PCB design tool. Also mirrored at buildwithtrace/learned-pcb-placement.
MIT
No comments yet. Be the first to ask about this board.