Choose eligible radii for constructive routing plans

This commit is contained in:
Jan Petykiewicz 2026-11-30 11:23:55 -08:00
commit 6c5ee351c8

View file

@ -220,17 +220,17 @@ def plan_ordered_bundle(problem: RoutingProblem, search: SearchOptions, *, infer
if not problem.nets:
return problem
_, physical_geometry = resolve_bend_geometry(search)
bend = min(search.bend_radii, default=0.0)
common_radii = {r for r in search.bend_radii if isfinite(r) and r > 0 and r == int(r) and r in search.sbend_radii}
if (
not isfinite(bend) or bend <= 0 or bend != int(bend) or bend not in search.sbend_radii
or physical_geometry != "arc"
not common_radii or physical_geometry != "arc"
or search.has_applicable_sbend_outline(net.width for net in problem.nets)
):
raise ValueError("Bundle routing needs a common integer radius for circular bends and S-bends")
radius = int(bend)
width = problem.nets[0].width
if not bend_fits_width(radius, width):
bend = min((r for r in common_radii if bend_fits_width(r, width)), default=0.0)
if not bend:
raise ValueError("Bundle bend radius must be at least half the net width")
radius = int(bend)
margin = width / 2 + problem.clearance
pitch = ceil(width + problem.clearance) + 1
floor_lane = ceil(problem.bounds[1] + width / 2)