Skip to the content
4 layers57 × 47.5 mmRp2040 debugger, 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
57 × 47.5 mm
Copper layers
4
Thickness
1.6 mm
Parts
69
Nets
64
Pads
246
Tracks, vias
560, 87
Pours
8
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
9 Mar 2026
Updated
4 Jun 2026

Overview

Rp2040 debugger 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 4-layer board of 57 × 47.5 mm with 69 parts on 64 nets, routed with 560 tracks and 87 vias.

It is built around the RP2040, W25Q16JVSSIQ and TLV1117LV33DCYR, with the LTST-C150KRKT among its other parts. Its parts include 21 capacitors, 17 resistors, 10 connectors, 5 diodes and 4 ICs. It belongs with the interfaces and adapters boards and the RP2040 boards of this library.

Main components

4

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

69
QtyValueFootprintReferences
10100nCapacitor_SMD:C_0603_1608MetricC1, C8, C9, C11, C13, C14, C15, C16, C17, C18
5470Resistor_SMD:R_0603_1608MetricR8, R9, R10, R11, R12
4100Resistor_SMD:R_0603_1608MetricR13, R14, R15, R16
41uCapacitor_SMD:C_0603_1608MetricC2, C10, C12, C19
4Conn_01x01TestPoint:TestPoint_Keystone_5019_MinatureJ7, J8, J9, J10
4MountingHoleRP2040_minimal:MountingHole_3.9mm_Plastite_#6H1, H2, H3, H4
310uCapacitor_SMD:C_0805_2012MetricC3, C7, C20
35.1kResistor_SMD:R_0603_1608MetricR3, R4, R17
21.1kResistor_SMD:R_0603_1608MetricR1, R5
2100uCapacitor_SMD:C_1206_3216MetricC4, C21
220pCapacitor_SMD:C_0603_1608MetricC5, C6
227Resistor_SMD:R_0603_1608MetricR6, R7
2Conn_01x03Connector_JST:JST_SH_SM03B-SRSS-TB_1x03-1MP_P1.00mm_HorizontalJ5, J6
2Conn_01x06Connector_Molex:Molex_KK-254_AE-6410-06A_1x06_P2.54mm_VerticalJ2, J3
2LED_GREENLED_SMD:LED_0805_2012MetricD1, D5
2LED_YELLOWLED_SMD:LED_0805_2012MetricD2, D4
2TLV1117LV33DCYRPackage_TO_SOT_SMD:SOT-223-3_TabPin2U2, U4
1Conn_01x10Connector_PinHeader_2.54mm:PinHeader_1x10_P2.54mm_VerticalJ4
1Crystal_GND24Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
1DNSResistor_SMD:R_0402_1005MetricR2
1LED_REDLED_SMD:LED_0805_2012MetricD3
1LOGOtaylor_footprints:twistedG***
1LOGOtaylor_footprints:twisted_2G***
1LOGOtaylor_footprints:twisted_iconG***
1Q_NMOS_GSDPackage_TO_SOT_SMD:SOT-23Q1
1RP2040RP2040_minimal:RP2040-QFN-56U3
1SW_DIP_x01base_parts:SW-SMD_DSHP01TSGERSW2
1SW_MEC_5Gparts:SW_TS_1101_C_WSW1
1TestPointTestPoint:TestPoint_Keystone_5019_MinatureTP1
1USB_C_Receptacle_USB2.0Connector_USB:USB_C_Receptacle_XKB_U262-16XN-4BVC11J1
1W25Q16JVSSIQPackage_SO:SOIC-8_5.23x5.23mm_P1.27mmU1

More from elcruzo/learned-pcb-placement

3
  • 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 layers25.9 × 17.3 mmSnapvcc, the printed circuit board in 3D

    Snapvcc

    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.

    26 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

  • 4 layers55 × 30 mmStitch candidate, the printed circuit board in 3D

    Stitch candidate

    EthanKahn08/example-pcb

    Design-stage RP2040 USB-C microSD reader: KiCad hardware, verification evidence, UART bring-up firmware, and assembly plan. Unbuilt and untested.

    68 parts
  • 4 layers94.4 × 72.8 mmRP2040 base, the printed circuit board in 3D

    RP2040 base

    Twisted-Fields/rp2040-motor-controller

    A dual channel brushless motor controller based on the RP2040 microcontroller, designed in Kicad.

    325 parts419
  • 6 layers128 × 128 mmEmberone, the printed circuit board in 3D

    Emberone

    256foundation/emberone00-pcb

    KiCAD design files for the emberOne/00 hashboard

    395 parts45CERN-OHL-S-2.0
  • 4 layers39.2 × 26.5 mmSpider, the printed circuit board in 3D

    Spider

    niklasekstrom/spider

    SPIder is an adapter that interfaces SPI devices to the clockport on an Amiga

    38 parts3
  • 6 layers50 × 50 mmFanboy, the printed circuit board in 3D

    Fanboy

    skot/fanboy

    USB fan controller

    61 parts2CERN-OHL-S-2.0
  • 4 layers55.3 × 125.9 mmMicroTAC, the printed circuit board in 3D

    MicroTAC

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    142 parts915
  • 4 layers109 × 155.5 mmSupercap, the printed circuit board in 3D

    Supercap

    Twisted-Fields/acorn-robot-electronics

    PCB hardware designs in KICAD for Acorn, the precision farming rover from Twisted Fields.

    198 parts81

Questions

How big is the Rp2040 debugger PCB?

It measures 57 × 47.5 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Rp2040 debugger use?

69 parts, built around the RP2040, W25Q16JVSSIQ, TLV1117LV33DCYR and LTST-C150KRKT. 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 Rp2040 debugger KiCad files?

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

Can I use the Rp2040 debugger 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).