From 8e5ec7f8b70ab4e5fa98c2a15caebf147c7015d4 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Thu, 25 Sep 2014 23:57:32 +0200 Subject: [PATCH] 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. --- hurricane/src/hurricane/RoutingPad.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/hurricane/src/hurricane/RoutingPad.cpp b/hurricane/src/hurricane/RoutingPad.cpp index 554f1e2f..52b5af88 100644 --- a/hurricane/src/hurricane/RoutingPad.cpp +++ b/hurricane/src/hurricane/RoutingPad.cpp @@ -343,8 +343,20 @@ namespace Hurricane { double bestArea = getArea(bestComponent); if (compArea == bestArea) { - if (icomponent->getId() < bestComponent->getId()) - bestComponent = *icomponent; + 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;