mirror of https://codeberg.org/topola/topola.git
fix(autorouter/anterouter): Use correct ratline principal layer instead of layer 0
This commit is contained in:
parent
64a519420f
commit
2f7cee62a6
|
|
@ -25,7 +25,7 @@ use crate::{
|
||||||
},
|
},
|
||||||
geometry::{shape::AccessShape, GenericNode, GetLayer},
|
geometry::{shape::AccessShape, GenericNode, GetLayer},
|
||||||
graph::{GenericIndex, MakeRef},
|
graph::{GenericIndex, MakeRef},
|
||||||
layout::{poly::MakePolygon, via::ViaWeight, LayoutEdit},
|
layout::{poly::MakePolygon, via::ViaWeight},
|
||||||
math::Circle,
|
math::Circle,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ impl Anterouter {
|
||||||
match terminating_scheme {
|
match terminating_scheme {
|
||||||
TerminatingScheme::ExistingFixedDot(terminating_dot) => autorouter
|
TerminatingScheme::ExistingFixedDot(terminating_dot) => autorouter
|
||||||
.ratsnests
|
.ratsnests
|
||||||
.on_principal_layer_mut(0)
|
.on_principal_layer_mut(ratline.principal_layer)
|
||||||
.assign_terminating_dot_to_ratvertex(
|
.assign_terminating_dot_to_ratvertex(
|
||||||
endpoint_indices.0,
|
endpoint_indices.0,
|
||||||
*layer,
|
*layer,
|
||||||
|
|
@ -105,7 +105,7 @@ impl Anterouter {
|
||||||
match terminating_scheme {
|
match terminating_scheme {
|
||||||
TerminatingScheme::ExistingFixedDot(terminating_dot) => autorouter
|
TerminatingScheme::ExistingFixedDot(terminating_dot) => autorouter
|
||||||
.ratsnests
|
.ratsnests
|
||||||
.on_principal_layer_mut(0)
|
.on_principal_layer_mut(ratline.principal_layer)
|
||||||
.assign_terminating_dot_to_ratvertex(
|
.assign_terminating_dot_to_ratvertex(
|
||||||
endpoint_indices.1,
|
endpoint_indices.1,
|
||||||
*layer,
|
*layer,
|
||||||
|
|
@ -166,6 +166,7 @@ impl Anterouter {
|
||||||
autorouter,
|
autorouter,
|
||||||
recorder,
|
recorder,
|
||||||
ratvertex,
|
ratvertex,
|
||||||
|
ratline,
|
||||||
source_dot,
|
source_dot,
|
||||||
small_bbox,
|
small_bbox,
|
||||||
target_layer,
|
target_layer,
|
||||||
|
|
@ -200,6 +201,7 @@ impl Anterouter {
|
||||||
autorouter,
|
autorouter,
|
||||||
recorder,
|
recorder,
|
||||||
ratvertex,
|
ratvertex,
|
||||||
|
ratline,
|
||||||
source_dot,
|
source_dot,
|
||||||
large_bbox,
|
large_bbox,
|
||||||
target_layer,
|
target_layer,
|
||||||
|
|
@ -216,6 +218,7 @@ impl Anterouter {
|
||||||
autorouter,
|
autorouter,
|
||||||
recorder,
|
recorder,
|
||||||
ratvertex,
|
ratvertex,
|
||||||
|
ratline,
|
||||||
source_dot,
|
source_dot,
|
||||||
small_bbox,
|
small_bbox,
|
||||||
target_layer,
|
target_layer,
|
||||||
|
|
@ -232,6 +235,7 @@ impl Anterouter {
|
||||||
autorouter,
|
autorouter,
|
||||||
recorder,
|
recorder,
|
||||||
ratvertex,
|
ratvertex,
|
||||||
|
ratline,
|
||||||
source_dot,
|
source_dot,
|
||||||
large_bbox,
|
large_bbox,
|
||||||
target_layer,
|
target_layer,
|
||||||
|
|
@ -251,6 +255,7 @@ impl Anterouter {
|
||||||
autorouter: &mut Autorouter<impl AccessMesadata>,
|
autorouter: &mut Autorouter<impl AccessMesadata>,
|
||||||
recorder: &mut BoardEdit,
|
recorder: &mut BoardEdit,
|
||||||
ratvertex: NodeIndex<usize>,
|
ratvertex: NodeIndex<usize>,
|
||||||
|
ratline: RatlineUid,
|
||||||
source_dot: FixedDotIndex,
|
source_dot: FixedDotIndex,
|
||||||
bbox: AABB<[f64; 2]>,
|
bbox: AABB<[f64; 2]>,
|
||||||
target_layer: usize,
|
target_layer: usize,
|
||||||
|
|
@ -262,6 +267,7 @@ impl Anterouter {
|
||||||
autorouter,
|
autorouter,
|
||||||
recorder,
|
recorder,
|
||||||
ratvertex,
|
ratvertex,
|
||||||
|
ratline,
|
||||||
source_dot,
|
source_dot,
|
||||||
bbox,
|
bbox,
|
||||||
target_layer,
|
target_layer,
|
||||||
|
|
@ -285,6 +291,7 @@ impl Anterouter {
|
||||||
autorouter,
|
autorouter,
|
||||||
recorder,
|
recorder,
|
||||||
ratvertex,
|
ratvertex,
|
||||||
|
ratline,
|
||||||
source_dot,
|
source_dot,
|
||||||
bbox,
|
bbox,
|
||||||
target_layer,
|
target_layer,
|
||||||
|
|
@ -304,6 +311,7 @@ impl Anterouter {
|
||||||
autorouter,
|
autorouter,
|
||||||
recorder,
|
recorder,
|
||||||
ratvertex,
|
ratvertex,
|
||||||
|
ratline,
|
||||||
source_dot,
|
source_dot,
|
||||||
bbox,
|
bbox,
|
||||||
target_layer,
|
target_layer,
|
||||||
|
|
@ -328,6 +336,7 @@ impl Anterouter {
|
||||||
autorouter: &mut Autorouter<impl AccessMesadata>,
|
autorouter: &mut Autorouter<impl AccessMesadata>,
|
||||||
recorder: &mut BoardEdit,
|
recorder: &mut BoardEdit,
|
||||||
ratvertex: NodeIndex<usize>,
|
ratvertex: NodeIndex<usize>,
|
||||||
|
ratline: RatlineUid,
|
||||||
source_dot: FixedDotIndex,
|
source_dot: FixedDotIndex,
|
||||||
bbox: AABB<[f64; 2]>,
|
bbox: AABB<[f64; 2]>,
|
||||||
target_layer: usize,
|
target_layer: usize,
|
||||||
|
|
@ -338,6 +347,7 @@ impl Anterouter {
|
||||||
autorouter,
|
autorouter,
|
||||||
recorder,
|
recorder,
|
||||||
ratvertex,
|
ratvertex,
|
||||||
|
ratline,
|
||||||
source_dot,
|
source_dot,
|
||||||
bbox,
|
bbox,
|
||||||
target_layer,
|
target_layer,
|
||||||
|
|
@ -385,6 +395,7 @@ impl Anterouter {
|
||||||
autorouter: &mut Autorouter<impl AccessMesadata>,
|
autorouter: &mut Autorouter<impl AccessMesadata>,
|
||||||
recorder: &mut BoardEdit,
|
recorder: &mut BoardEdit,
|
||||||
ratvertex: NodeIndex<usize>,
|
ratvertex: NodeIndex<usize>,
|
||||||
|
ratline: RatlineUid,
|
||||||
source_dot: FixedDotIndex,
|
source_dot: FixedDotIndex,
|
||||||
bbox: AABB<[f64; 2]>,
|
bbox: AABB<[f64; 2]>,
|
||||||
target_layer: usize,
|
target_layer: usize,
|
||||||
|
|
@ -451,7 +462,7 @@ impl Anterouter {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
autorouter
|
autorouter
|
||||||
.ratsnests
|
.ratsnests
|
||||||
.on_principal_layer_mut(0)
|
.on_principal_layer_mut(ratline.principal_layer)
|
||||||
.assign_terminating_dot_to_ratvertex(ratvertex, target_layer, *terminating_dot);
|
.assign_terminating_dot_to_ratvertex(ratvertex, target_layer, *terminating_dot);
|
||||||
Ok((via, dots))
|
Ok((via, dots))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ impl<M: AccessMesadata> Autorouter<M> {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let origin_dot = match self
|
let origin_dot = match self
|
||||||
.ratsnests
|
.ratsnests
|
||||||
.on_principal_layer_mut(0)
|
.on_principal_layer_mut(options.principal_layer)
|
||||||
.graph()
|
.graph()
|
||||||
.node_weight(ratvertex)
|
.node_weight(ratvertex)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,6 @@ impl<R: AccessRules> Layout<R> {
|
||||||
|
|
||||||
#[debug_ensures(ret.is_ok() -> self.drawing.node_count() == old(self.drawing.node_count()) + weight.to_layer - weight.from_layer + 2)]
|
#[debug_ensures(ret.is_ok() -> self.drawing.node_count() == old(self.drawing.node_count()) + weight.to_layer - weight.from_layer + 2)]
|
||||||
#[debug_ensures(ret.is_err() -> self.drawing.node_count() == old(self.drawing.node_count()))]
|
#[debug_ensures(ret.is_err() -> self.drawing.node_count() == old(self.drawing.node_count()))]
|
||||||
/// Insert [`Via`] into the [`Layout`]
|
|
||||||
pub fn add_via(
|
pub fn add_via(
|
||||||
&mut self,
|
&mut self,
|
||||||
recorder: &mut LayoutEdit,
|
recorder: &mut LayoutEdit,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue