freeroute/tests/dsn/fixtures/simple_2net.dsn
Ryan Malloy 89c0481ccc Add MVP grid maze router and DSN->SES routing pipeline
Implements a working autorouter and the Java-free replacement for the
freerouting.jar step: dsn_text -> parse_dsn -> build_board -> route ->
write_ses.

GridRouter is a single-layer A* maze search over a uniform occupancy
grid: a cell is blocked by another net's pad (inflated by clearance +
half trace width) or a keepout; each net's ratsnest is connected pin to
pin; a routed trace then blocks other nets. The cell path becomes a
trace polyline whose endpoints are the exact pin locations. Board-unit
paths are converted back to DSN units for the SES (wire (path ...))
scopes.

This is an MVP, not a port of FreeRouting's expansion-room maze:
free-space rooms, rip-up-and-retry, multi-layer via search, and shove
are deferred (they raise quality/coverage, not the connectivity
milestone). It reaches connectivity on boards whose nets route on one
layer without crossing.

Adds tests/dsn/fixtures/simple_2net.dsn (a guaranteed-routable 2-net
board). Invariant tests: both nets route, the emitted SES parses, every
trace stays on a valid layer and within the board outline, and every
routed net's trace endpoints sit exactly on its two pads. An oracle-gated
test asserts connectivity parity with the reference FreeRouting JAR on
the simple board.
2026-07-12 11:25:03 -06:00

74 lines
1.3 KiB
Plaintext

(pcb "simple_2net.dsn"
(parser
(string_quote ")
(space_in_quoted_tokens on)
(host_cad "freeroute-test")
(host_version "1.0")
)
(resolution um 10)
(unit um)
(structure
(layer Top
(type signal)
(property
(index 0)
)
)
(layer Bottom
(type signal)
(property
(index 1)
)
)
(boundary
(path pcb 0 0 0 200000 0 200000 -80000 0 -80000 0 0)
)
(via "Via[0-1]_600:300_um")
(rule
(width 2000)
(clearance 2000)
)
)
(library
(padstack Rect_Pad
(shape (rect Top -1000 -1000 1000 1000))
(attach off)
)
(padstack "Via[0-1]_600:300_um"
(shape (circle Top 600))
(shape (circle Bottom 600))
(attach off)
)
(image PAD
(pin Rect_Pad 1 0 0)
)
)
(placement
(component PAD
(place A1 20000 -20000 front 0)
(place A2 180000 -20000 front 0)
(place B1 20000 -60000 front 0)
(place B2 180000 -60000 front 0)
)
)
(network
(net NET_A
(pins A1-1 A2-1)
)
(net NET_B
(pins B1-1 B2-1)
)
(class default
(circuit
(use_via "Via[0-1]_600:300_um")
)
(rule
(width 2000)
(clearance 2000)
)
)
)
(wiring
)
)