How eason070211/pcb_router works
PCB Router is a Python research and teaching framework for automatic PCB routing. Users can generate demo boards, choose a registered routing algorithm through the CLI or Tkinter GUI, and inspect routing results and quality metrics. Its high-speed workflow adds layer assignment to reduce vias and serpentine length matching for differential pairs and buses. The graph includes the documented Lee, A*, PathFinder, and rip-up/reroute algorithms, plus shared board, cost, and multi-pin routing layers. Some links follow README descriptions or SOURCE INDEX references; unsampled implementation details are not assumed.
Main entry points: board.py Layered board grid · router_base.py Router interface · run_highspeed_demo.py High-speed demo · pathfinder.py PathFinder router
Components 18
User interfaces
- Tkinter GUI
gui.py - Demo CLI
run_demo.py - High-speed demo
run_highspeed_demo.py
Routing algorithms
- Lee router
pcbrouter/algorithms/lee.py - A* router
pcbrouter/algorithms/astar.py - PathFinder router
pcbrouter/algorithms/pathfinder.py - Rip-up reroute
pcbrouter/algorithms/ripup_reroute.py
Routing core
- Board examples
pcbrouter/examples.py - Router interface
pcbrouter/router_base.py - Algorithm registry
pcbrouter/router_base.py - Routing data model
pcbrouter/model.py - Layered board grid
pcbrouter/board.py - Edge costs
pcbrouter/cost.py - Multi-pin helpers
pcbrouter/algorithms/common.py
Refinement and evaluation
- Layer assignment
pcbrouter/algorithms/layer_assignment.py - Serpentine tuner
pcbrouter/algorithms/length_matching.py - Quality metrics
pcbrouter/metrics.py
Other components
- User
Connections 39
- User → Tkinter GUI: opens
README.md - User → Demo CLI: runs
README.md - User → High-speed demo: runs
README.md - Tkinter GUI → Board examples: loads examples
gui.py - Demo CLI → Board examples: loads examples
run_demo.py - High-speed demo → Board examples: loads board
run_highspeed_demo.py - Tkinter GUI → Algorithm registry: selects router
gui.py - Demo CLI → Algorithm registry: selects router
run_demo.py - High-speed demo → Algorithm registry: selects router
run_highspeed_demo.py - Algorithm registry → Router interface: instantiates
pcbrouter/router_base.py - Lee router → Router interface: implements
pcbrouter/algorithms/lee.py - A* router → Router interface: implements
pcbrouter/algorithms/astar.py - PathFinder router → Router interface: implements
pcbrouter/algorithms/pathfinder.py - Rip-up reroute → Router interface: implements
pcbrouter/algorithms/ripup_reroute.py - Board examples → Layered board grid: creates
pcbrouter/examples.py - Board examples → Routing data model: creates nets
pcbrouter/examples.py - Router interface → Layered board grid: routes on
pcbrouter/router_base.py - Router interface → Routing data model: returns results
pcbrouter/router_base.py - Lee router → Layered board grid: searches
pcbrouter/algorithms/lee.py - A* router → Layered board grid: searches
pcbrouter/algorithms/astar.py - A* router → Edge costs: scores edges
pcbrouter/algorithms/astar.py - PathFinder router → Layered board grid: searches
pcbrouter/algorithms/pathfinder.py - PathFinder router → Edge costs: scores edges
pcbrouter/algorithms/pathfinder.py - Rip-up reroute → Layered board grid: reserves paths
pcbrouter/algorithms/ripup_reroute.py - Rip-up reroute → Edge costs: scores edges
pcbrouter/algorithms/ripup_reroute.py - A* router → Multi-pin helpers: decomposes pins
pcbrouter/algorithms/astar.py - Lee router → Multi-pin helpers: decomposes pins
pcbrouter/algorithms/lee.py - PathFinder router → Multi-pin helpers: decomposes pins
pcbrouter/algorithms/pathfinder.py - Rip-up reroute → Multi-pin helpers: decomposes pins
pcbrouter/algorithms/ripup_reroute.py - PathFinder router → Quality metrics: computes metrics
pcbrouter/algorithms/pathfinder.py - Rip-up reroute → Quality metrics: computes metrics
pcbrouter/algorithms/ripup_reroute.py - Tkinter GUI → Quality metrics: displays metrics
gui.py - Demo CLI → Quality metrics: reports metrics
run_demo.py - High-speed demo → Layer assignment: runs refinement
run_highspeed_demo.py - High-speed demo → Serpentine tuner: runs refinement
run_highspeed_demo.py - Layer assignment → Layered board grid: uses grid
pcbrouter/algorithms/layer_assignment.py - Serpentine tuner → Layered board grid: checks space
pcbrouter/algorithms/length_matching.py - Serpentine tuner → Routing data model: updates paths
pcbrouter/algorithms/length_matching.py - High-speed demo → Quality metrics: compares results
run_highspeed_demo.py