Fix fabrication verification and routing diagnostics follow-up
This commit is contained in:
parent
1eed75ff5a
commit
cea23ef1b4
1 changed files with 248 additions and 76 deletions
|
|
@ -376,10 +376,21 @@ class RoutingWorld:
|
|||
frozen_net_ids: frozenset[str] = frozenset(),
|
||||
) -> DynamicCongestionDetail:
|
||||
"""Use physical clearance when admitting a move with a hard obstacle."""
|
||||
metrics = self.metrics
|
||||
if metrics is not None:
|
||||
metrics.total_congestion_check_calls += 1
|
||||
hits = set()
|
||||
for polygon in result.physical_geometry:
|
||||
for other_net_id, _index, other in self._physical_candidates(net_id, polygon):
|
||||
if other_net_id in hits or not _violates_net_clearance(polygon, other, self.clearance):
|
||||
candidates = self._physical_candidates(net_id, polygon)
|
||||
if metrics is not None and candidates:
|
||||
metrics.total_congestion_candidate_nets += len({other_net_id for other_net_id, _, _ in candidates})
|
||||
metrics.total_congestion_candidate_ids += len(candidates)
|
||||
for other_net_id, _index, other in candidates:
|
||||
if other_net_id in hits:
|
||||
continue
|
||||
if metrics is not None:
|
||||
metrics.total_congestion_exact_pair_checks += 1
|
||||
if not _violates_net_clearance(polygon, other, self.clearance):
|
||||
continue
|
||||
if other_net_id in frozen_net_ids:
|
||||
return DynamicCongestionDetail(soft_overlap_count=len(hits), hits_frozen_net=True)
|
||||
|
|
@ -681,13 +692,10 @@ class RoutingWorld:
|
|||
grid_net_cache: dict[tuple[str, int, int, int, int], tuple[str, ...]] | None = None,
|
||||
broad_phase_cache: dict[tuple[str, int, int, int, int], dict[str, tuple[int, ...]]] | None = None,
|
||||
) -> DynamicCongestionDetail:
|
||||
if self.metrics is not None:
|
||||
self.metrics.total_congestion_check_calls += 1
|
||||
dynamic_paths = self._dynamic_paths
|
||||
if not dynamic_paths.geometries:
|
||||
return DynamicCongestionDetail()
|
||||
if not self.clearance or frozen_net_ids:
|
||||
return self.check_physical_move_congestion(result, net_id, frozen_net_ids=frozen_net_ids)
|
||||
if self.metrics is not None:
|
||||
self.metrics.total_congestion_check_calls += 1
|
||||
|
||||
candidates_by_net = self._collect_congestion_candidates(
|
||||
result,
|
||||
|
|
@ -696,8 +704,6 @@ class RoutingWorld:
|
|||
grid_net_cache,
|
||||
broad_phase_cache,
|
||||
)
|
||||
if not candidates_by_net:
|
||||
return DynamicCongestionDetail()
|
||||
return self._check_real_congestion(
|
||||
result,
|
||||
candidates_by_net,
|
||||
|
|
|
|||
Loading…
Reference in a new issue