In RoutingPad, prefer Segment over Pad at constant area.

This case may arise with cells created from GDS+LEF.
This commit is contained in:
Jean-Paul Chaput 2023-07-24 14:25:01 +02:00
parent c5827877f6
commit a8d0371990
1 changed files with 16 additions and 12 deletions

View File

@ -377,19 +377,23 @@ namespace Hurricane {
double bestArea = getArea(bestComponent);
if (compArea == bestArea) {
Box compBox = component->getBoundingBox();
Box bestBox = bestComponent->getBoundingBox();
if (compBox.getXMin() == bestBox.getXMin()) {
if (compBox.getYMin() == bestBox.getYMin()) {
if (component->getId() < bestComponent->getId())
bestComponent = component;
} else
if (compBox.getYMin() < bestBox.getYMin())
bestComponent = component;
if (dynamic_cast<Segment*>(component) and dynamic_cast<Pad*>(bestComponent)) {
bestComponent = component;
} else {
if (compBox.getXMin() < bestBox.getXMin())
bestComponent = component;
Box compBox = component->getBoundingBox();
Box bestBox = bestComponent->getBoundingBox();
if (compBox.getXMin() == bestBox.getXMin()) {
if (compBox.getYMin() == bestBox.getYMin()) {
if (component->getId() < bestComponent->getId())
bestComponent = component;
} else
if (compBox.getYMin() < bestBox.getYMin())
bestComponent = component;
} else {
if (compBox.getXMin() < bestBox.getXMin())
bestComponent = component;
}
}
} else {
if (compArea > bestArea)