mirror of https://codeberg.org/topola/topola.git
fix(autorouter/autorouter): Skip translayer ratlines in planar autorouting
This prevents planar autorouting from crashing.
This commit is contained in:
parent
8f59319902
commit
3d55d1a81e
|
|
@ -18,7 +18,8 @@ use crate::{
|
|||
ratsnests::Ratsnests,
|
||||
},
|
||||
board::{AccessMesadata, Board},
|
||||
drawing::band::BandTermsegIndex,
|
||||
drawing::{band::BandTermsegIndex, graph::MakePrimitiveRef},
|
||||
geometry::GetLayer,
|
||||
graph::MakeRef,
|
||||
layout::{via::ViaWeight, LayoutEdit, LayoutException},
|
||||
router::{navmesh::NavmeshError, ng, thetastar::ThetastarError, RouterOptions},
|
||||
|
|
@ -139,7 +140,7 @@ impl<M: AccessMesadata> Autorouter<M> {
|
|||
) -> Result<PlanarAutorouteExecutionPermutator, AutorouterError> {
|
||||
PlanarAutorouteExecutionPermutator::new(
|
||||
self,
|
||||
self.selected_ratlines(selection, options.principal_layer),
|
||||
self.selected_planar_ratlines(selection, options.principal_layer),
|
||||
options,
|
||||
)
|
||||
}
|
||||
|
|
@ -348,6 +349,24 @@ impl<M: AccessMesadata> Autorouter<M> {
|
|||
.collect()
|
||||
}
|
||||
|
||||
fn selected_planar_ratlines(&self, selection: &PinSelection, layer: usize) -> Vec<RatlineUid> {
|
||||
self.selected_ratlines(selection, layer)
|
||||
.into_iter()
|
||||
.filter(|ratline| {
|
||||
let (endpoint_dot1, endpoint_dot2) = ratline.ref_(self).endpoint_dots();
|
||||
|
||||
endpoint_dot1
|
||||
.primitive_ref(self.board().layout().drawing())
|
||||
.layer()
|
||||
== layer
|
||||
&& endpoint_dot2
|
||||
.primitive_ref(self.board().layout().drawing())
|
||||
.layer()
|
||||
== layer
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn find_selected_ratvertex(
|
||||
&self,
|
||||
selection: &PinSelection,
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ impl PlanarAutorouteExecutionPermutator {
|
|||
intersector_count_weight: 1.0,
|
||||
length_weight: 0.001,
|
||||
},
|
||||
&options,
|
||||
);
|
||||
let initially_sorted_ratlines = presorter.presort_ratlines(autorouter, &ratlines);
|
||||
/*let permuter = RatlinesPermuter::SccPermutations(SccPermutationsRatlinePermuter::new(
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use enum_dispatch::enum_dispatch;
|
|||
use petgraph::algo::tarjan_scc;
|
||||
use specctra_core::mesadata::AccessMesadata;
|
||||
|
||||
use crate::autorouter::{ratline::RatlineUid, scc::Scc, Autorouter};
|
||||
use crate::autorouter::{ratline::RatlineUid, scc::Scc, Autorouter, PlanarAutorouteOptions};
|
||||
|
||||
pub struct PresortParams {
|
||||
pub intersector_count_weight: f64,
|
||||
|
|
@ -38,11 +38,12 @@ impl SccIntersectionsAndLengthPresorter {
|
|||
autorouter: &mut Autorouter<impl AccessMesadata>,
|
||||
ratlines: &[RatlineUid],
|
||||
params: &PresortParams,
|
||||
options: &PlanarAutorouteOptions,
|
||||
) -> Self {
|
||||
// FIXME: Unnecessary copy.
|
||||
let mut filtered_ratsnest = autorouter
|
||||
.ratsnests()
|
||||
.on_principal_layer(ratlines[0].principal_layer)
|
||||
.on_principal_layer(options.principal_layer)
|
||||
.graph()
|
||||
.clone();
|
||||
filtered_ratsnest.retain_edges(|_g, i| ratlines.iter().any(|ratline| ratline.index == i));
|
||||
|
|
|
|||
Loading…
Reference in New Issue