Preflight component geometry before tessellation
This commit is contained in:
parent
286caa273b
commit
c480871f07
1 changed files with 252 additions and 113 deletions
|
|
@ -39,7 +39,7 @@ from inire.router._routing_policy import (
|
|||
_route_residual,
|
||||
_trial,
|
||||
)
|
||||
from inire.router._seed_materialization import materialize_path_seed
|
||||
from inire.router._seed_materialization import materialize_path_seed, seed_preparation_error
|
||||
from inire.router._stack import route_once
|
||||
from inire.router._topology import constrained_triangulation_available, plan_corridors
|
||||
from inire.router.cost import build_native_cost_evaluator, weighted_path_length
|
||||
|
|
@ -312,7 +312,9 @@ class _AutomaticRun:
|
|||
def footprints(net: NetSpec, seeds: Iterable[PathSeed]) -> list[tuple[PathSeed, BaseGeometry]]:
|
||||
choices = []
|
||||
for seed in seeds:
|
||||
path = materialize_path_seed(seed, start=net.start, net_width=net.width, search=options.search, clearance=problem.clearance)
|
||||
path = materialize_path_seed(
|
||||
seed, start=net.start, net_width=net.width, search=options.search, clearance=problem.clearance, bounds=problem.bounds,
|
||||
)
|
||||
if not path or path[-1].end_port != net.target or not world.verify_path_report(net.net_id, path).is_valid:
|
||||
continue
|
||||
footprint = shapely.union_all([shape for component in path for shape in component.physical_geometry])
|
||||
|
|
@ -694,7 +696,21 @@ class _AutomaticRun:
|
|||
timings=tuple(self.timings),
|
||||
duration_s=perf_counter() - started,
|
||||
)
|
||||
return replace(complete_final_conflict_trace(best.run), metrics=metrics, automatic=report)
|
||||
results = best.run.results_by_net
|
||||
if options.congestion.max_iterations and self.raw_problem.initial_paths:
|
||||
results = dict(results)
|
||||
for net in self.raw_problem.nets:
|
||||
seed = self.raw_problem.initial_paths.get(net.net_id)
|
||||
result = results[net.net_id]
|
||||
if seed is None or result.report.seed_error is not None:
|
||||
continue
|
||||
error = seed_preparation_error(
|
||||
seed, start=net.start, net_width=net.width, search=options.search, clearance=self.raw_problem.clearance,
|
||||
)
|
||||
if error:
|
||||
report_with_error = replace(result.report, seed_error=f"Initial path for {net.net_id!r} {error}")
|
||||
results[net.net_id] = replace(result, report=report_with_error)
|
||||
return replace(complete_final_conflict_trace(replace(best.run, results_by_net=results)), metrics=metrics, automatic=report)
|
||||
|
||||
|
||||
def route_automatic(
|
||||
|
|
|
|||
Loading…
Reference in a new issue