From 86341140217cd7e34a8a9424d41e9f123fb7bad5 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 20 Dec 2013 14:54:34 +0000 Subject: [PATCH] * ./katabatic: - In Session::_canonize(): if the canonical segment has never had it's axis sets, put it into *optimal* position instead of simply constraint compliant. Force realignment of the segment sets as rounding errors may introduce slight misalignment on the axis (causing error laters in the various contact topological updates). This also seems to solve the ludicrous problem of negative ratio of expansion wires... (segments *not* at their optimal position at the start). - In LayerAssign, KatabaticEngine::layerAssign(), suppress the triple loop enclosign the desaturation. Now desaturate each layer exactly once and from bottom to top. --- katabatic/src/AutoContactHTee.cpp | 8 +++++--- katabatic/src/AutoSegment.cpp | 15 ++++++++------- katabatic/src/LayerAssign.cpp | 6 +++--- katabatic/src/Session.cpp | 7 ++++--- katabatic/src/katabatic/AutoSegment.h | 4 ++-- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/katabatic/src/AutoContactHTee.cpp b/katabatic/src/AutoContactHTee.cpp index 45ef1b4d..e4b91d62 100644 --- a/katabatic/src/AutoContactHTee.cpp +++ b/katabatic/src/AutoContactHTee.cpp @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2012-2012, All Rights Reserved +// Copyright (c) UPMC 2012-2013, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -194,8 +193,11 @@ namespace Katabatic { else if (verticals [0] == NULL) message = "HTee is missing mandatory vertical segment."; else if (verticals [1] != NULL) message = "HTee has more than one vertical segment."; else if ( (not _horizontal1->isCreated() and not _horizontal2->isCreated()) - and (_horizontal1->getY() != _horizontal2->getY()) ) + and (_horizontal1->getY() != _horizontal2->getY()) ) { message = "HTee has misaligned horizontal segments"; + message += " h1:" + getString(_horizontal1->getY()); + message += " h2:" + getString(_horizontal2->getY()); + } if (not message.empty()) { showTopologyError( message ); setFlags( CntBadTopology ); diff --git a/katabatic/src/AutoSegment.cpp b/katabatic/src/AutoSegment.cpp index 1ea1eb39..69c337a4 100644 --- a/katabatic/src/AutoSegment.cpp +++ b/katabatic/src/AutoSegment.cpp @@ -1,4 +1,3 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. @@ -646,7 +645,7 @@ namespace Katabatic { } - bool AutoSegment::toConstraintAxis () + bool AutoSegment::toConstraintAxis ( unsigned int flags ) { ltrace(200) << "toConstraintAxis() " << this << endl; ltracein(200); @@ -668,13 +667,13 @@ namespace Katabatic { } if (getAxis() < constraintMin) { - setAxis( constraintMin ); + setAxis( constraintMin, flags ); ltraceout(200); return true; } if (getAxis() > constraintMax) { - setAxis( constraintMax ); + setAxis( constraintMax, flags ); ltraceout(200); return true; } @@ -684,7 +683,7 @@ namespace Katabatic { } - bool AutoSegment::toOptimalAxis () + bool AutoSegment::toOptimalAxis ( unsigned int flags ) { ltrace(200) << "toOptimalAxis() " << this << endl; ltracein(200); @@ -700,17 +699,19 @@ namespace Katabatic { DbU::Unit optimalMax = min( max(getOptimalMax(),constraintMin), constraintMax ); if (getAxis() < optimalMin) { - setAxis( optimalMin ); + setAxis( optimalMin, flags ); ltraceout(200); return true; } if (getAxis() > optimalMax) { - setAxis( optimalMax ); + setAxis( optimalMax, flags ); ltraceout(200); return true; } + if (flags & KbRealignate) setAxis( getAxis(), flags ); + ltraceout(200); return false; } diff --git a/katabatic/src/LayerAssign.cpp b/katabatic/src/LayerAssign.cpp index 21152d2d..c4b88983 100644 --- a/katabatic/src/LayerAssign.cpp +++ b/katabatic/src/LayerAssign.cpp @@ -486,7 +486,7 @@ namespace Katabatic { Session::revalidate(); if (getConfiguration()->getAllowedDepth() > 2) { - for ( int i=0 ; i < 3 ; i++ ) { + //for ( int i=0 ; i < 3 ; i++ ) { for ( size_t depth=1 ; depth < getConfiguration()->getAllowedDepth()-2; ++depth ) { _desaturate( depth, globalNets, total, global ); if ( (depth > 1) and ((depth-1)%2 == 1) ) Session::revalidate(); @@ -494,8 +494,8 @@ namespace Katabatic { globalNets.clear (); - if (not _gcellGrid->updateDensity()) break; - } + // if (not _gcellGrid->updateDensity()) break; + //} Session::revalidate(); } diff --git a/katabatic/src/Session.cpp b/katabatic/src/Session.cpp index aec9df14..589e8e05 100644 --- a/katabatic/src/Session.cpp +++ b/katabatic/src/Session.cpp @@ -1,5 +1,4 @@ - -// -*- C++ -*- +// -*- mode: C++; explicit-buffer-name: "Session.cpp" -*- // // This file is part of the Coriolis Software. // Copyright (c) UPMC 2008-2013, All Rights Reserved @@ -189,7 +188,9 @@ namespace Katabatic { ltrace(159) << "Align @" << DbU::getLambda(canonical->getAxis()) << " on " << canonical << endl; - canonical->setAxis( canonical->getAxis(), KbRealignate ); + //canonical->setAxis( canonical->getAxis(), KbRealignate ); + if (canonical->isUnsetAxis()) canonical->toOptimalAxis( KbRealignate|KbPropagate ); + else canonical->setAxis( canonical->getAxis(), KbRealignate|KbPropagate ); aligneds.clear(); ltraceout(110); } diff --git a/katabatic/src/katabatic/AutoSegment.h b/katabatic/src/katabatic/AutoSegment.h index bab26d22..58c673db 100644 --- a/katabatic/src/katabatic/AutoSegment.h +++ b/katabatic/src/katabatic/AutoSegment.h @@ -250,8 +250,8 @@ namespace Katabatic { virtual void invalidate ( unsigned int flags=KbPropagate ); void computeOptimal ( set& processeds ); void setAxis ( DbU::Unit, unsigned int flags=KbNoFlags ); - bool toConstraintAxis (); - bool toOptimalAxis (); + bool toConstraintAxis ( unsigned int flags=KbRealignate ); + bool toOptimalAxis ( unsigned int flags=KbRealignate ); // Collections & Filters. AutoSegments getOnSourceContact ( unsigned int direction ); AutoSegments getOnTargetContact ( unsigned int direction );