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>,
|
||||
recorder: &mut BoardEdit,
|
||||
options: &AnterouterOptions,
|
||||
) -> BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex> {
|
||||
) -> BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex> {
|
||||
let mut terminating_dot_map = BTreeMap::new();
|
||||
|
||||
// PERF: Unnecessary clone.
|
||||
|
|
@ -70,11 +70,6 @@ impl Anterouter {
|
|||
let endpoint_indices = ratline.ref_(autorouter).endpoint_indices();
|
||||
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
|
||||
.plan
|
||||
.ratline_terminating_schemes
|
||||
|
|
@ -82,8 +77,7 @@ impl Anterouter {
|
|||
{
|
||||
match terminating_scheme {
|
||||
TerminatingScheme::ExistingFixedDot(terminating_dot) => {
|
||||
terminating_dot_map
|
||||
.insert((*ratline, endpoint_dots.0, *layer), *terminating_dot);
|
||||
terminating_dot_map.insert((*ratline, endpoint_dots.0), *terminating_dot);
|
||||
}
|
||||
TerminatingScheme::Fanout => self.anteroute_fanout(
|
||||
autorouter,
|
||||
|
|
@ -105,8 +99,7 @@ impl Anterouter {
|
|||
{
|
||||
match terminating_scheme {
|
||||
TerminatingScheme::ExistingFixedDot(terminating_dot) => {
|
||||
terminating_dot_map
|
||||
.insert((*ratline, endpoint_dots.1, *layer), *terminating_dot);
|
||||
terminating_dot_map.insert((*ratline, endpoint_dots.1), *terminating_dot);
|
||||
}
|
||||
TerminatingScheme::Fanout => self.anteroute_fanout(
|
||||
autorouter,
|
||||
|
|
@ -134,7 +127,7 @@ impl Anterouter {
|
|||
source_dot: FixedDotIndex,
|
||||
target_layer: usize,
|
||||
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();
|
||||
|
||||
|
|
@ -266,7 +259,7 @@ impl Anterouter {
|
|||
target_layer: usize,
|
||||
preferred_compass_direction: impl CompassDirection,
|
||||
options: &AnterouterOptions,
|
||||
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex>,
|
||||
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex>,
|
||||
) -> Result<(), ()> {
|
||||
if self
|
||||
.anteroute_fanout_on_bbox_in_direction(
|
||||
|
|
@ -351,7 +344,7 @@ impl Anterouter {
|
|||
target_layer: usize,
|
||||
direction: impl Into<Point>,
|
||||
options: &AnterouterOptions,
|
||||
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex>,
|
||||
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex>,
|
||||
) -> Result<(), ()> {
|
||||
let (via, dots) = self.place_fanout_via_on_bbox_in_direction(
|
||||
autorouter,
|
||||
|
|
@ -412,7 +405,7 @@ impl Anterouter {
|
|||
target_layer: usize,
|
||||
direction: impl Into<Point>,
|
||||
options: &AnterouterOptions,
|
||||
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex>,
|
||||
terminating_dot_map: &mut BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex>,
|
||||
) -> Result<(GenericIndex<ViaWeight>, Vec<FixedDotIndex>), ()> {
|
||||
let source_layer = autorouter
|
||||
.board()
|
||||
|
|
@ -472,7 +465,7 @@ impl Anterouter {
|
|||
.layer()
|
||||
})
|
||||
.unwrap();
|
||||
terminating_dot_map.insert((ratline, source_dot, target_layer), *terminating_dot);
|
||||
terminating_dot_map.insert((ratline, source_dot), *terminating_dot);
|
||||
Ok((via, dots))
|
||||
} else {
|
||||
Err(())
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ use super::{
|
|||
#[derive(Clone, Debug)]
|
||||
pub struct PlanarAutorouteConfiguration {
|
||||
pub ratlines: Vec<RatlineUid>,
|
||||
pub terminating_dot_map: BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex>,
|
||||
pub terminating_dot_map: BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex>,
|
||||
}
|
||||
|
||||
impl PlanarAutorouteConfiguration {
|
||||
|
|
@ -43,16 +43,14 @@ impl PlanarAutorouteConfiguration {
|
|||
) -> (FixedDotIndex, FixedDotIndex) {
|
||||
let ratline = self.ratlines[ratline_index];
|
||||
let endpoint_dots = ratline.ref_(autorouter).endpoint_dots();
|
||||
let layer = ratline.ref_(autorouter).layer();
|
||||
|
||||
(
|
||||
*self
|
||||
.terminating_dot_map
|
||||
.get(&(ratline, endpoint_dots.0, layer))
|
||||
.get(&(ratline, endpoint_dots.0))
|
||||
.unwrap_or(&endpoint_dots.0),
|
||||
*self
|
||||
.terminating_dot_map
|
||||
.get(&(ratline, endpoint_dots.1, layer))
|
||||
.get(&(ratline, endpoint_dots.1))
|
||||
.unwrap_or(&endpoint_dots.1),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use crate::{
|
|||
#[derive(Clone, Debug)]
|
||||
pub struct PlanarAutoroutePreconfigurerInput {
|
||||
pub ratlines: BTreeSet<RatlineUid>,
|
||||
pub terminating_dot_map: BTreeMap<(RatlineUid, FixedDotIndex, usize), FixedDotIndex>,
|
||||
pub terminating_dot_map: BTreeMap<(RatlineUid, FixedDotIndex), FixedDotIndex>,
|
||||
}
|
||||
|
||||
pub struct PresortParams {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use std::{collections::BTreeMap, ops::ControlFlow};
|
||||
use std::ops::ControlFlow;
|
||||
|
||||
use specctra_core::mesadata::AccessMesadata;
|
||||
|
||||
|
|
@ -10,8 +10,8 @@ use crate::{
|
|||
autorouter::{
|
||||
invoker::GetDebugOverlayData,
|
||||
planar_autoroute::{
|
||||
PlanarAutorouteConfiguration, PlanarAutorouteConfigurationResult,
|
||||
PlanarAutorouteContinueStatus, PlanarAutorouteExecutionStepper,
|
||||
PlanarAutorouteConfigurationResult, PlanarAutorouteContinueStatus,
|
||||
PlanarAutorouteExecutionStepper,
|
||||
},
|
||||
planar_preconfigurer::{
|
||||
PlanarAutoroutePreconfigurerInput, PreconfigurePlanarAutoroute, PresortParams,
|
||||
|
|
|
|||
|
|
@ -221,10 +221,6 @@ impl Ratsnest {
|
|||
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(
|
||||
&mut self,
|
||||
ratline_index: EdgeIndex<usize>,
|
||||
|
|
|
|||
Loading…
Reference in New Issue