mirror of https://codeberg.org/topola/topola.git
refactor(autorouter/planar_autoroute): Don't use layer as one of keys in terminating dot map
This commit is contained in:
parent
d896fe7322
commit
4ad58f1654
|
|
@ -62,7 +62,7 @@ impl Anterouter {
|
||||||
autorouter: &mut Autorouter<impl AccessMesadata>,
|
autorouter: &mut Autorouter<impl AccessMesadata>,
|
||||||
recorder: &mut BoardEdit,
|
recorder: &mut BoardEdit,
|
||||||
options: &AnterouterOptions,
|
options: &AnterouterOptions,
|
||||||
) -> BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex> {
|
) -> BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex> {
|
||||||
let mut terminating_dot_map = BTreeMap::new();
|
let mut terminating_dot_map = BTreeMap::new();
|
||||||
|
|
||||||
// PERF: Unnecessary clone.
|
// PERF: Unnecessary clone.
|
||||||
|
|
@ -70,11 +70,6 @@ impl Anterouter {
|
||||||
let endpoint_indices = ratline.ref_(autorouter).endpoint_indices();
|
let endpoint_indices = ratline.ref_(autorouter).endpoint_indices();
|
||||||
let endpoint_dots = ratline.ref_(autorouter).endpoint_dots();
|
let endpoint_dots = ratline.ref_(autorouter).endpoint_dots();
|
||||||
|
|
||||||
autorouter
|
|
||||||
.ratsnests
|
|
||||||
.on_principal_layer_mut(ratline.principal_layer)
|
|
||||||
.assign_layer_to_ratline(ratline.index, *layer);
|
|
||||||
|
|
||||||
if let Some(terminating_scheme) = self
|
if let Some(terminating_scheme) = self
|
||||||
.plan
|
.plan
|
||||||
.ratline_terminating_schemes
|
.ratline_terminating_schemes
|
||||||
|
|
@ -82,8 +77,7 @@ impl Anterouter {
|
||||||
{
|
{
|
||||||
match terminating_scheme {
|
match terminating_scheme {
|
||||||
TerminatingScheme::ExistingFixedDot(terminating_dot) => {
|
TerminatingScheme::ExistingFixedDot(terminating_dot) => {
|
||||||
terminating_dot_map
|
terminating_dot_map.insert((*ratline, endpoint_dots.0), *terminating_dot);
|
||||||
.insert((*ratline, endpoint_dots.0, *layer), *terminating_dot);
|
|
||||||
}
|
}
|
||||||
TerminatingScheme::Fanout => self.anteroute_fanout(
|
TerminatingScheme::Fanout => self.anteroute_fanout(
|
||||||
autorouter,
|
autorouter,
|
||||||
|
|
@ -105,8 +99,7 @@ impl Anterouter {
|
||||||
{
|
{
|
||||||
match terminating_scheme {
|
match terminating_scheme {
|
||||||
TerminatingScheme::ExistingFixedDot(terminating_dot) => {
|
TerminatingScheme::ExistingFixedDot(terminating_dot) => {
|
||||||
terminating_dot_map
|
terminating_dot_map.insert((*ratline, endpoint_dots.1), *terminating_dot);
|
||||||
.insert((*ratline, endpoint_dots.1, *layer), *terminating_dot);
|
|
||||||
}
|
}
|
||||||
TerminatingScheme::Fanout => self.anteroute_fanout(
|
TerminatingScheme::Fanout => self.anteroute_fanout(
|
||||||
autorouter,
|
autorouter,
|
||||||
|
|
@ -134,7 +127,7 @@ impl Anterouter {
|
||||||
source_dot: FixedDotIndex,
|
source_dot: FixedDotIndex,
|
||||||
target_layer: usize,
|
target_layer: usize,
|
||||||
options: &AnterouterOptions,
|
options: &AnterouterOptions,
|
||||||
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex>,
|
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex>,
|
||||||
) {
|
) {
|
||||||
let mut ratline_delta: Point = ratline.ref_(autorouter).line_segment().delta().into();
|
let mut ratline_delta: Point = ratline.ref_(autorouter).line_segment().delta().into();
|
||||||
|
|
||||||
|
|
@ -266,7 +259,7 @@ impl Anterouter {
|
||||||
target_layer: usize,
|
target_layer: usize,
|
||||||
preferred_compass_direction: impl CompassDirection,
|
preferred_compass_direction: impl CompassDirection,
|
||||||
options: &AnterouterOptions,
|
options: &AnterouterOptions,
|
||||||
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex>,
|
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex>,
|
||||||
) -> Result<(), ()> {
|
) -> Result<(), ()> {
|
||||||
if self
|
if self
|
||||||
.anteroute_fanout_on_bbox_in_direction(
|
.anteroute_fanout_on_bbox_in_direction(
|
||||||
|
|
@ -351,7 +344,7 @@ impl Anterouter {
|
||||||
target_layer: usize,
|
target_layer: usize,
|
||||||
direction: impl Into<Point>,
|
direction: impl Into<Point>,
|
||||||
options: &AnterouterOptions,
|
options: &AnterouterOptions,
|
||||||
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex>,
|
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex>,
|
||||||
) -> Result<(), ()> {
|
) -> Result<(), ()> {
|
||||||
let (via, dots) = self.place_fanout_via_on_bbox_in_direction(
|
let (via, dots) = self.place_fanout_via_on_bbox_in_direction(
|
||||||
autorouter,
|
autorouter,
|
||||||
|
|
@ -412,7 +405,7 @@ impl Anterouter {
|
||||||
target_layer: usize,
|
target_layer: usize,
|
||||||
direction: impl Into<Point>,
|
direction: impl Into<Point>,
|
||||||
options: &AnterouterOptions,
|
options: &AnterouterOptions,
|
||||||
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex>,
|
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex>,
|
||||||
) -> Result<(GenericIndex<ViaWeight>, Vec<FixedDotIndex>), ()> {
|
) -> Result<(GenericIndex<ViaWeight>, Vec<FixedDotIndex>), ()> {
|
||||||
let source_layer = autorouter
|
let source_layer = autorouter
|
||||||
.board()
|
.board()
|
||||||
|
|
@ -472,7 +465,7 @@ impl Anterouter {
|
||||||
.layer()
|
.layer()
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
terminating_dot_map.insert((ratline, source_dot, target_layer), *terminating_dot);
|
terminating_dot_map.insert((ratline, source_dot), *terminating_dot);
|
||||||
Ok((via, dots))
|
Ok((via, dots))
|
||||||
} else {
|
} else {
|
||||||
Err(())
|
Err(())
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use super::{
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct PlanarAutorouteConfiguration {
|
pub struct PlanarAutorouteConfiguration {
|
||||||
pub ratlines: Vec<RatlineUid>,
|
pub ratlines: Vec<RatlineUid>,
|
||||||
pub terminating_dot_map: BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex>,
|
pub terminating_dot_map: BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PlanarAutorouteConfiguration {
|
impl PlanarAutorouteConfiguration {
|
||||||
|
|
@ -43,16 +43,14 @@ impl PlanarAutorouteConfiguration {
|
||||||
) -> (FixedDotIndex, FixedDotIndex) {
|
) -> (FixedDotIndex, FixedDotIndex) {
|
||||||
let ratline = self.ratlines[ratline_index];
|
let ratline = self.ratlines[ratline_index];
|
||||||
let endpoint_dots = ratline.ref_(autorouter).endpoint_dots();
|
let endpoint_dots = ratline.ref_(autorouter).endpoint_dots();
|
||||||
let layer = ratline.ref_(autorouter).layer();
|
|
||||||
|
|
||||||
(
|
(
|
||||||
*self
|
*self
|
||||||
.terminating_dot_map
|
.terminating_dot_map
|
||||||
.get(&(ratline, endpoint_dots.0, layer))
|
.get(&(ratline, endpoint_dots.0))
|
||||||
.unwrap_or(&endpoint_dots.0),
|
.unwrap_or(&endpoint_dots.0),
|
||||||
*self
|
*self
|
||||||
.terminating_dot_map
|
.terminating_dot_map
|
||||||
.get(&(ratline, endpoint_dots.1, layer))
|
.get(&(ratline, endpoint_dots.1))
|
||||||
.unwrap_or(&endpoint_dots.1),
|
.unwrap_or(&endpoint_dots.1),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ use crate::{
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct PlanarAutoroutePreconfigurerInput {
|
pub struct PlanarAutoroutePreconfigurerInput {
|
||||||
pub ratlines: BTreeSet<RatlineUid>,
|
pub ratlines: BTreeSet<RatlineUid>,
|
||||||
pub terminating_dot_map: BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex>,
|
pub terminating_dot_map: BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PresortParams {
|
pub struct PresortParams {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
use std::{collections::BTreeMap, ops::ControlFlow};
|
use std::ops::ControlFlow;
|
||||||
|
|
||||||
use specctra_core::mesadata::AccessMesadata;
|
use specctra_core::mesadata::AccessMesadata;
|
||||||
|
|
||||||
|
|
@ -10,8 +10,8 @@ use crate::{
|
||||||
autorouter::{
|
autorouter::{
|
||||||
invoker::GetDebugOverlayData,
|
invoker::GetDebugOverlayData,
|
||||||
planar_autoroute::{
|
planar_autoroute::{
|
||||||
PlanarAutorouteConfiguration, PlanarAutorouteConfigurationResult,
|
PlanarAutorouteConfigurationResult, PlanarAutorouteContinueStatus,
|
||||||
PlanarAutorouteContinueStatus, PlanarAutorouteExecutionStepper,
|
PlanarAutorouteExecutionStepper,
|
||||||
},
|
},
|
||||||
planar_preconfigurer::{
|
planar_preconfigurer::{
|
||||||
PlanarAutoroutePreconfigurerInput, PreconfigurePlanarAutoroute, PresortParams,
|
PlanarAutoroutePreconfigurerInput, PreconfigurePlanarAutoroute, PresortParams,
|
||||||
|
|
|
||||||
|
|
@ -221,10 +221,6 @@ impl Ratsnest {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn assign_layer_to_ratline(&mut self, ratline_index: EdgeIndex<usize>, layer: usize) {
|
|
||||||
self.graph.edge_weight_mut(ratline_index).unwrap().layer = layer;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn assign_band_termseg_to_ratline(
|
pub fn assign_band_termseg_to_ratline(
|
||||||
&mut self,
|
&mut self,
|
||||||
ratline_index: EdgeIndex<usize>,
|
ratline_index: EdgeIndex<usize>,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue