Rollback on by default; --no-rollback keeps every rip-up
Over 8 net orders it left 25 to 30 fewer connections unrouted on the dense sense boards and 16 to 18 fewer on two PCBench boards, and was never clearly worse. KiCad DRC on the sense harness: 41 opens to 28.
This commit is contained in:
@@ -162,7 +162,7 @@ class GridRouter:
|
||||
seed: int | None = None,
|
||||
route_first: frozenset | None = None,
|
||||
access_cost: float = 0.0,
|
||||
rollback: bool = False,
|
||||
rollback: bool = True,
|
||||
) -> None:
|
||||
self.board = board
|
||||
# Pin access: while a pin still has connections to route, the cells
|
||||
@@ -174,7 +174,9 @@ class GridRouter:
|
||||
self._pending: dict[int, int] = {}
|
||||
# Rip-up as a transaction: the connections a rip-up route crosses are
|
||||
# rerouted at once, and if fewer connections are routed afterwards
|
||||
# than before, everything goes back as it was.
|
||||
# than before, everything goes back as it was. On by default: over
|
||||
# 8 net orders it left 25 to 30 fewer connections unrouted on dense
|
||||
# boards and was never clearly worse.
|
||||
self.rollback = bool(rollback)
|
||||
# None keeps the deterministic order; a seed shuffles which connection
|
||||
# routes first, to measure how much a result owes to the order
|
||||
@@ -1228,7 +1230,7 @@ def route_board(
|
||||
seed: int | None = None,
|
||||
route_first: frozenset | None = None,
|
||||
access_cost: float = 0.0,
|
||||
rollback: bool = False,
|
||||
rollback: bool = True,
|
||||
) -> RouteResult:
|
||||
"""Convenience wrapper: build a :class:`GridRouter` and route the board."""
|
||||
router = GridRouter(
|
||||
|
||||
Reference in New Issue
Block a user