Skip to the content
2 layers25.9 × 17.3 mmSnapvcc, the printed circuit board in 3D

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.

Size
25.9 × 17.3 mm
Copper layers
2
Thickness
0.8 mm
Parts
26
Nets
10
Pads
44
Tracks, vias
54, 12
Pours
8
Routed
Yes
KiCad
KiCad 4
Created
9 Mar 2026
Updated
4 Jun 2026

Overview

Snapvcc is an open-source printed circuit board by elcruzo, from the elcruzo/learned-pcb-placement repository on GitHub, published under the MIT licence. It is a 2-layer board of 25.9 × 17.3 mm with 26 parts on 10 nets, routed with 54 tracks and 12 vias.

It is built around the TPS560200DBV and IRLML9301TRPBF. Its parts include 4 capacitors, 4 resistors, 2 connectors, 1 IC and 1 diode.

Main components

2

README

README.md

learned-pcb-placement

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

Architecture

text
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 / τ)  │

Results

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.

BoardComponentsNetsSA HPWLGNN HPWLHPWL ΔSA CostGNN Cost
stickhub94451125.91022.1-9.2%1127.81757.3
rp2040_debugger69551248.81375.4+10.1%1251.11464.6
motor_controller5136883.2918.4+4.0%883.51116.6
keyboard_rev037463086.24228.8+37.0%8459.210468.6
pluto_watch3752867.1838.0-3.4%867.2862.0
kitchen_timer3531605.9828.4+36.7%611.1935.4
rgb_to_hdmi3232721.9776.8+7.6%723.5865.7
snapvcc268136.4106.9-21.6%136.5118.2
dali_stm322233572.5721.0+25.9%572.5760.6
mmdvm_hotspot2129839.71033.5+23.1%840.01606.8
tomu1717176.5174.1-1.4%176.5222.7
m2sata517200.1410.9+105.3%200.1411.7

Key findings:

  • GNN achieves lower HPWL on 4 out of 12 boards (stickhub -9.2%, snapvcc -21.6%, pluto_watch -3.4%, tomu -1.4%)
  • On snapvcc (26 components), GNN also wins on total cost (118.2 vs 136.5), with overlap penalty of only 1.13
  • Overlap remains the primary bottleneck — the quality prediction head R² is low across all boards
  • GNN acceptance rates are consistently higher (80-99%) vs baseline SA (50-93%), confirming the network proposes structurally meaningful moves
  • Per-board training with just 10 SA rollouts (~3-20s) — no pre-training, no large dataset

Cross-board comparison Convergence (stickhub) Training (stickhub)

Quick Start

bash
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/

Or run scaled experiments on Google Colab (50 rollouts, 200 epochs, GPU/TPU): Open In Colab

Requires Python 3.10+ and PyTorch with CUDA, TPU (via torch_xla), MPS (Apple Silicon), or CPU fallback.

Data

15 KiCad PCB designs from open-source hardware, spanning hobby projects to production carrier boards:

BoardComponentsNetsSource
jetson_orin_baseboard681644Antmicro (NVIDIA Jetson carrier)
hackrf_one437319Great Scott Gadgets (production SDR)
artix_dc_scm207224Antmicro (FPGA server mgmt)
stickhub9445USB hub
rp2040_debugger6955Raspberry Pi debug probe
motor_controller5136H-bridge motor driver
keyboard_rev03746Mechanical keyboard controller
pluto_watch3752Casio F-91W replacement
kitchen_timer3531MCU countdown timer
rgb_to_hdmi3232Video signal converter
snapvcc268Compact power supply
dali_stm322233DALI lighting interface
mmdvm_hotspot2129Digital voice modem
tomu1717USB-insertable ARM MCU
m2sata517M.2 to SATA adapter

Files

FilePurpose
learn.pyGAT architecture, training loop, GNN-guided SA, experiment runner
placer.pyKiCad parser, cost functions, baseline SA, spectral placement
graphs.pyPublication-quality matplotlib plots
program.mdExperiment strategy and research plan

Why PCB Placement is Hard

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.

Related Work

All serious placement research targets VLSI/ASIC. PCB placement is wide open.

PaperVenueContribution
AlphaChip (Mirhoseini et al.)Nature 2021RL for ASIC floorplanning, deployed in Google TPUs
DREAMPlace (Lin et al.)DAC 2019Placement as neural network training, 40x GPU speedup
TransPlace (Cheng et al.)KDD 2025Transferable GNN global placement
ChipDiffusion (Vint et al.)ICML 2025Diffusion for zero-shot chip placement
DiffPlace (Liu et al.)2025Conditional diffusion for VLSI with constraints
Cypress (Lu et al.)ISPD 2025VLSI-inspired PCB placement with GPU acceleration (Best Paper)
C3PO (Lu et al.)ASP-DAC 2026Commercial-quality global placement
Netlistify (Huang et al.)MLCAD 2025Schematics to netlists with deep learning (Best Artifact)
PCB-BenchICLR 2026First LLM benchmark for PCB tasks
Component Centric PlacementarXiv 2026PCB-specific graph representations
GNN for PCB Schematics2025Auto-adding decoupling caps via graph prediction

Current Scope

The cost function today optimizes three things:

  • HPWL (wirelength) — total half-perimeter wirelength across all nets. Shorter wires mean easier routing, lower resistance, and less parasitic inductance.
  • Overlap penalty — components must not physically intersect. Penalized quadratically.
  • Boundary penalty — all components must stay within the board outline.

These are the standard baseline metrics for placement research (VLSI uses the same starting point). The system does not yet model:

  • Decoupling capacitor proximity — bypass caps must sit within a few mm of their IC's power pins. The netlist already encodes this relationship (cap and IC share a power net), so the GNN graph contains the signal — it just isn't weighted yet.
  • Functional group clustering — power regulation, analog front-end, digital core, and I/O should form coherent groups. Today the placer treats all components equally.
  • EMI/EMC separation — noisy switching regulators should be far from sensitive analog inputs. High-speed clock traces should be short and shielded. Not modeled.
  • Signal integrity — matched-length differential pairs, controlled impedance, return path continuity. Not modeled.
  • Thermal constraints — power components need spacing and copper pour area for heat dissipation. Not modeled.
  • Mechanical constraints — keep-out zones, mounting holes, connector edge placement. Not modeled.

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).

What's Next

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:

  1. Scale training on Colab — 50 rollouts, 200 epochs on GPU/TPU. 5x more data should address underfitting on the quality head.
  2. Overlap-aware loss — penalize overlap in the GNN training objective, not just in the SA cost function.
  3. Cross-board pre-training — train a single model on all 12 boards jointly, evaluate transfer to unseen designs.
  4. Constraint-aware cost function — add decoupling cap proximity, functional group clustering, and EMI separation penalties. Encode net types (power, signal, clock) as edge features so the GNN learns constraint priorities.
  5. Longer rollouts — current rollouts are short (T: 10→2). Longer annealing gives the GNN better examples of overlap resolution.
  6. Diffusion hybrid — use a diffusion model for initial placement, then GNN-guided SA for refinement.

Authors

Built by Trace — an AI-native PCB design tool. Also mirrored at buildwithtrace/learned-pcb-placement.

License

MIT

Parts

26
QtyValueFootprintReferences
9VAL**snapVCC_lib:viavia, via, via, via, via, via, via, via, via
310uFsnapVCC_lib:0603-CAPC1, C3, C4
10.1uFsnapVCC_lib:0603-CAPC2
110uHsnapVCC_lib:L-4mmL1
120ksnapVCC_lib:0603-RESR3
1330RsnapVCC_lib:0603-RESR4
143ksnapVCC_lib:0603-RESR2
162ksnapVCC_lib:0603-RESR1
1Battery HoldersnapVCC_lib:KEY967_modifiedBT1
1CONN_01X02snapVCC_lib:H2-2.54P2
1CONN_01X03snapVCC_lib:switchP1
1IRLML9301TRPbFsnapVCC_lib:SOT23Q1
1LEDLEDs:LED_0603D1
1LOGOsnapVCC_lib:electronutLabs-logoG***
1TESTsnapVCC_lib:0RTP1
1TPS560200snapVCC_lib:SOT-23-5U1

More from elcruzo/learned-pcb-placement

3
  • 4 layers57 × 47.5 mmRp2040 debugger, the printed circuit board in 3D

    Rp2040 debugger

    elcruzo/learned-pcb-placement

    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.

    69 parts2MIT
  • 2 layers120 × 27.3 mmKeyboard rev0, the printed circuit board in 3D

    Keyboard rev0

    elcruzo/learned-pcb-placement

    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.

    37 parts2MIT
  • 2 layers87.6 × 30.5 mmMmdvm hotspot, the printed circuit board in 3D

    Mmdvm hotspot

    elcruzo/learned-pcb-placement

    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.

    21 parts2MIT

Similar boards

  • 2 layers25.9 × 17.3 mmSnapVCC, the printed circuit board in 3D

    SnapVCC

    electronut/ElectronutLabs-snapVCC

    A tiny 3.3 V / 5 V voltage regulator that snaps right on top of a 9 volt battery.

    25 parts77
  • 2 layers70 × 70 mmFwrtss, the printed circuit board in 3D

    Fwrtss

    ynsta/fwrtss

    Open source hardware and software project of a regulated soldering station for RT soldering tips

    103 parts7
  • 2 layers160 × 100 mmMarine gps, the printed circuit board in 3D

    Marine gps

    mbouyer/marine_chartplotter

    Hardware and software for an opencpn-based chartplotter

    115 parts6BSD-2-Clause
  • 2 layers86.5 × 42 mmFinal pcb, the printed circuit board in 3D

    Final pcb

    aguscsc/Bidirectional-Buck-DC-DC-converter

    This repository contains the development steps for the making of a Bidirectional Buck DC-DC converter

    42 parts5MIT
  • 2 layers100 × 72 mmPicow-1k, the printed circuit board in 3D

    Picow-1k

    Agilack/eCow-logic

    164 parts1
  • 4 layers80.6 × 60.6 mmLorawan sensor node v2, the printed circuit board in 3D

    Lorawan sensor node v2

    ElektorLabs/lorawan-sensor-node-v2

    Solar Powered LoRaWAN Sensor Node V2

    84 parts1GPL-3.0
  • 2 layers108 × 75 mmESP32 C3 Zigbee Temp, the printed circuit board in 3D

    ESP32 C3 Zigbee Temp

    Cath272/ESP32-Low-Power-Temp-Monitor

    In the project files you may find ESP32-C3 instead of ESP32-C6. I named it wrong when i created the project. The issue is just the file names, the footprints are correct and use a C6.

    75 partsGPL-3.0

Questions

How big is the Snapvcc PCB?

It measures 25.9 × 17.3 mm and has 2 copper layers, 0.8 mm thick.

What parts does the Snapvcc use?

26 parts, built around the TPS560200DBV and IRLML9301TRPBF. 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.

Where can I download the Snapvcc KiCad files?

From the elcruzo/learned-pcb-placement repository on GitHub, at the commit this page was made from: the board is data/snapvcc.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Snapvcc design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).