In RoutingPad::setOnBestComponent() improved selection.

* Change: In Hurricane, in RoutingPad::setOnBestComponent(), in case of
    area equality, do not choose on id but the geometrically lowest one.
    Between two runs of the global router, it is not possible to
    maintain identical ids. This may leading to a change to the selected
    component, and a change of the GCell it in, which cause bad
    topologies when read by Katabatic.
This commit is contained in:
Jean-Paul Chaput 2014-09-25 23:57:32 +02:00
parent 1f9ae36554
commit 8e5ec7f8b7
1 changed files with 14 additions and 2 deletions

View File

@ -343,8 +343,20 @@ namespace Hurricane {
double bestArea = getArea(bestComponent);
if (compArea == bestArea) {
Box compBox = icomponent->getBoundingBox();
Box bestBox = bestComponent->getBoundingBox();
if (compBox.getXMin() == bestBox.getXMin()) {
if (compBox.getYMin() == bestBox.getYMin()) {
if (icomponent->getId() < bestComponent->getId())
bestComponent = *icomponent;
} else
if (compBox.getYMin() < bestBox.getYMin())
bestComponent = *icomponent;
} else {
if (compBox.getXMin() < bestBox.getXMin())
bestComponent = *icomponent;
}
} else {
if (compArea > bestArea)
bestComponent = *icomponent;