From cd9d3fc4b63b87304ad43245edd3c7078d97bbae Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 25 May 2014 15:00:35 +0200 Subject: [PATCH] ExtensionCap support and source/target terminal flags in Katabatic & Kite. Placement management: * Change: In , always disable the hMetis support regardless of it being detected or not as the placer is still unable manage the final bin contents. Routing gauge management: * Bug: In CRL Core, , set the correct pitches and size for the routing layers and the cell gauge. * Change: In Katabatic & Kite, extract the correct extension cap for each routing layer from the layers characteristics (cache then in Katabatic::Configuration). * Change: In Katabatic, , create segment with the wire width defined in the gauge. For AutoSegment created on already existing Segment from the global routing, adjust the width. * Change: In Katabatic, , more accurate information about how a segment is connected to terminal via source and/or target. The flag SegStrongTerminal is splitted into SegSourceTerminal and SegSourceTarget (but still used as a mask). So now we can know by which end an AutoSegment is connected to a terminal. * Change: In Katabatic, ::doRp_Access(), create constraint freeing segments not only when HSmall but also when VSmall (more critical for ). Otherwise we may see AutoSegments with incompatible source/target constraints. * Change: In Kite, BuildPowerRails, do not create blockage on PinOnly layers *but* still create power rails planes. This is a temporary workaround for where the METAL1 blockages overlaps the terminals (it was fine for Nero, but they shouldn't for Kite). * Change: In Kite, , if a TrackSegment is overconstrained, directly bybass it's slackening state to DataNegociate::Slacken. Also rename the flag "_canHandleConstraints" to "_overConstrained", seems clearer to me. Miscellaneous: * Change: In CRL Core, , add a "pass-though" capability on the mstream to temporarily make them print everything. --- crlcore/etc/vsc200/alliance.conf | 16 +++---- crlcore/etc/vsc200/technology.conf | 2 +- crlcore/src/ccore/Utilities.cpp | 2 +- crlcore/src/ccore/crlcore/Utilities.h | 44 +++++++++--------- hurricane/src/hurricane/RegularLayer.cpp | 28 ++++-------- hurricane/src/hurricane/RoutingPad.cpp | 9 +--- .../src/hurricane/hurricane/RegularLayer.h | 28 ++++-------- katabatic/src/AutoContact.cpp | 25 ++++++----- katabatic/src/AutoContactTerminal.cpp | 10 ++++- katabatic/src/AutoHorizontal.cpp | 26 +++++------ katabatic/src/AutoSegment.cpp | 20 ++++++--- katabatic/src/AutoVertical.cpp | 26 +++++------ katabatic/src/Configuration.cpp | 45 +++++++++++++------ katabatic/src/LoadGrByNet.cpp | 25 ++++++++--- katabatic/src/katabatic/AutoContact.h | 2 +- katabatic/src/katabatic/AutoSegment.h | 16 ++++--- katabatic/src/katabatic/Configuration.h | 31 +++++++------ katabatic/src/katabatic/Constants.h | 1 + katabatic/src/katabatic/KatabaticEngine.h | 1 - katabatic/src/katabatic/Session.h | 3 +- kite/src/BuildPowerRails.cpp | 5 +-- kite/src/Configuration.cpp | 8 +++- kite/src/KiteEngine.cpp | 3 ++ kite/src/Manipulator.cpp | 14 +++--- kite/src/NegociateWindow.cpp | 7 ++- kite/src/RoutingEvent.cpp | 18 +++++--- kite/src/kite/Configuration.h | 3 +- kite/src/kite/Manipulator.h | 2 + kite/src/kite/RoutingEvent.h | 6 ++- kite/src/kite/SegmentFsm.h | 2 +- metis/src/MetisEngine.cpp | 2 +- 31 files changed, 238 insertions(+), 192 deletions(-) diff --git a/crlcore/etc/vsc200/alliance.conf b/crlcore/etc/vsc200/alliance.conf index 76d64ad2..15e4863c 100644 --- a/crlcore/etc/vsc200/alliance.conf +++ b/crlcore/etc/vsc200/alliance.conf @@ -33,13 +33,13 @@ allianceConfig = \ routingGaugesTable = {} routingGaugesTable['vsclib'] = \ - ( ( 'METAL1', ( RoutingLayerGauge.Vertical , RoutingLayerGauge.PinOnly, 0, 0.0, 0, 5, 2, 2 ) ) - , ( 'METAL2', ( RoutingLayerGauge.Horizontal, RoutingLayerGauge.Default, 1, 7.0, 0, 5, 2, 2 ) ) - , ( 'METAL3', ( RoutingLayerGauge.Vertical , RoutingLayerGauge.Default, 2, 0.0, 0, 5, 2, 2 ) ) - , ( 'METAL4', ( RoutingLayerGauge.Horizontal, RoutingLayerGauge.Default, 3, 0.0, 0, 5, 2, 2 ) ) - , ( 'METAL5', ( RoutingLayerGauge.Vertical , RoutingLayerGauge.Default, 4, 0.0, 0, 5, 2, 2 ) ) - #, ( 'METAL6', ( RoutingLayerGauge.Horizontal, RoutingLayerGauge.Default, 5, 0.0, 0, 5, 2, 2 ) ) - #, ( 'METAL7', ( RoutingLayerGauge.Vertical , RoutingLayerGauge.Default, 6, 0.0, 0, 5, 2, 2 ) ) + ( ( 'METAL1', ( RoutingLayerGauge.Vertical , RoutingLayerGauge.PinOnly, 0, 0.0, 4, 8, 3, 2 ) ) + , ( 'METAL2', ( RoutingLayerGauge.Horizontal, RoutingLayerGauge.Default, 1, 7.0, 0, 8, 4, 2 ) ) + , ( 'METAL3', ( RoutingLayerGauge.Vertical , RoutingLayerGauge.Default, 2, 0.0, 4, 8, 4, 2 ) ) + , ( 'METAL4', ( RoutingLayerGauge.Horizontal, RoutingLayerGauge.Default, 3, 0.0, 0, 8, 4, 2 ) ) + , ( 'METAL5', ( RoutingLayerGauge.Vertical , RoutingLayerGauge.Default, 4, 0.0, 4, 8, 4, 2 ) ) + #, ( 'METAL6', ( RoutingLayerGauge.Horizontal, RoutingLayerGauge.Default, 5, 0.0, 0, 8, 4, 2 ) ) + #, ( 'METAL7', ( RoutingLayerGauge.Vertical , RoutingLayerGauge.Default, 6, 0.0, 4, 8, 4, 2 ) ) ) @@ -48,5 +48,5 @@ routingGaugesTable['vsclib'] = \ # ( METAL_PIN, xy_common_pitch, slice_height, slice_step ) cellGaugesTable = {} -cellGaugesTable['vsclib'] = ('metal2', 5.0, 50.0, 5.0) +cellGaugesTable['vsclib'] = ('metal2', 8.0, 72.0, 8.0) diff --git a/crlcore/etc/vsc200/technology.conf b/crlcore/etc/vsc200/technology.conf index 96a59197..cb1669ea 100644 --- a/crlcore/etc/vsc200/technology.conf +++ b/crlcore/etc/vsc200/technology.conf @@ -3,7 +3,7 @@ import helpers # The informations here are extracted from the Alliance ".rds" file, -# and must be coherent with it. +# and must be consistent with it. # # Provides standard settings for: # - diff --git a/crlcore/src/ccore/Utilities.cpp b/crlcore/src/ccore/Utilities.cpp index 100f08a2..27b33bfc 100644 --- a/crlcore/src/ccore/Utilities.cpp +++ b/crlcore/src/ccore/Utilities.cpp @@ -118,7 +118,7 @@ namespace { int tty::_width = 80; bool tty::_enabled = true; -unsigned int mstream::_activeMask = mstream::Verbose0; +unsigned int mstream::_activeMask = mstream::PassThrough|mstream::Verbose0; mstream cmess0 ( mstream::Verbose0, std::cout ); mstream cmess1 ( mstream::Verbose1, std::cout ); diff --git a/crlcore/src/ccore/crlcore/Utilities.h b/crlcore/src/ccore/crlcore/Utilities.h index 01441a1c..f1780ea2 100644 --- a/crlcore/src/ccore/crlcore/Utilities.h +++ b/crlcore/src/ccore/crlcore/Utilities.h @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved +// Copyright (c) UPMC 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -257,20 +256,23 @@ inline std::string tty::bgcolor ( unsigned int mask ) class mstream : public std::ostream { public: - enum StreamMasks { Verbose0 = 0x00000001 - , Verbose1 = 0x00000002 - , Verbose2 = 0x00000004 - , Info = 0x00000008 - , Paranoid = 0x00000010 - , Bug = 0x00000020 + enum StreamMasks { PassThrough = 0x00000001 + , Verbose0 = 0x00000002 + , Verbose1 = 0x00000004 + , Verbose2 = 0x00000008 + , Info = 0x00000010 + , Paranoid = 0x00000020 + , Bug = 0x00000040 }; public: - static void enable ( unsigned int mask ); - static void disable ( unsigned int mask ); - inline mstream ( unsigned int mask, std::ostream &s ); - inline unsigned int getStreamMask() const; - static inline unsigned int getActiveMask(); - inline bool enabled () const; + static void enable ( unsigned int mask ); + static void disable ( unsigned int mask ); + inline mstream ( unsigned int mask, std::ostream &s ); + inline bool enabled () const; + inline unsigned int getStreamMask () const; + static inline unsigned int getActiveMask (); + inline void setStreamMask ( unsigned int mask ); + inline void unsetStreamMask ( unsigned int mask ); // Overload for formatted outputs. template inline mstream& operator<< ( T& t ); template inline mstream& operator<< ( T* t ); @@ -287,12 +289,14 @@ inline std::string tty::bgcolor ( unsigned int mask ) }; - inline mstream::mstream ( unsigned int mask, std::ostream& s ): std::ostream(s.rdbuf()) , _streamMask(mask) {} - inline unsigned int mstream::getStreamMask() const { return _streamMask; } - inline unsigned int mstream::getActiveMask() { return _activeMask; } - inline bool mstream::enabled () const { return (_streamMask & _activeMask); } - inline mstream& mstream::flush () { if (enabled()) static_cast(this)->flush(); return *this; } - inline mstream& mstream::operator<< ( std::ostream& (*pf)(std::ostream&) ) { if (enabled()) (*pf)(*this); return *this; } + inline mstream::mstream ( unsigned int mask, std::ostream& s ): std::ostream(s.rdbuf()) , _streamMask(mask) {} + inline bool mstream::enabled () const { return (_streamMask & _activeMask); } + inline unsigned int mstream::getStreamMask () const { return _streamMask; } + inline unsigned int mstream::getActiveMask () { return _activeMask; } + inline void mstream::setStreamMask ( unsigned int mask ) { _streamMask |= mask; } + inline void mstream::unsetStreamMask( unsigned int mask ) { _streamMask &= ~mask; } + inline mstream& mstream::flush () { if (enabled()) static_cast(this)->flush(); return *this; } + inline mstream& mstream::operator<< ( std::ostream& (*pf)(std::ostream&) ) { if (enabled()) (*pf)(*this); return *this; } template inline mstream& mstream::operator<< ( T& t ) diff --git a/hurricane/src/hurricane/RegularLayer.cpp b/hurricane/src/hurricane/RegularLayer.cpp index ddf1277c..2e7a8c18 100644 --- a/hurricane/src/hurricane/RegularLayer.cpp +++ b/hurricane/src/hurricane/RegularLayer.cpp @@ -1,7 +1,6 @@ - // -*- C++ -*- // -// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved +// Copyright (c) BULL S.A. 2000-2014, All Rights Reserved // // This file is part of Hurricane. // @@ -19,12 +18,7 @@ // License along with Hurricane. If not, see // . // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | @@ -32,21 +26,17 @@ // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Module : "./RegularLayer.cpp" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ -# include "hurricane/BasicLayer.h" -# include "hurricane/RegularLayer.h" -# include "hurricane/Technology.h" -# include "hurricane/Error.h" +#include "hurricane/BasicLayer.h" +#include "hurricane/RegularLayer.h" +#include "hurricane/Technology.h" +#include "hurricane/Error.h" namespace { - const char* nullLayer = "RegularLayer::setBasicLayer() [%s]\n" " basicLayer argument mustn't be NULL."; @@ -55,13 +45,11 @@ namespace { "RegularLayer::setBasicLayer() [%s]\n" " Reseting the basic layer is forbidden."; - } namespace Hurricane { - // ------------------------------------------------------------------- // Class : "Hurricane::RegularLayer_RegularLayers". @@ -335,4 +323,4 @@ namespace Hurricane { } -} // End of Hurricane namespace. +} // Hurricane namespace. diff --git a/hurricane/src/hurricane/RoutingPad.cpp b/hurricane/src/hurricane/RoutingPad.cpp index 55fef687..d53c1c07 100644 --- a/hurricane/src/hurricane/RoutingPad.cpp +++ b/hurricane/src/hurricane/RoutingPad.cpp @@ -1,7 +1,6 @@ - // -*- C++ -*- // -// Copyright (c) BULL S.A. 2000-2013, All Rights Reserved +// Copyright (c) BULL S.A. 2000-2014, All Rights Reserved // // This file is part of Hurricane. // @@ -19,10 +18,6 @@ // License along with Hurricane. If not, see // . // -// =================================================================== -// -// $Id$ -// // +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | @@ -30,7 +25,7 @@ // | Authors : Hugo Clement & Marek Sroka | // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | -// | C++ Header : "./RoutingPad.h" | +// | C++ Module : "./RoutingPad.cpp" | // +-----------------------------------------------------------------+ diff --git a/hurricane/src/hurricane/hurricane/RegularLayer.h b/hurricane/src/hurricane/hurricane/RegularLayer.h index 3662e351..49c0ceef 100644 --- a/hurricane/src/hurricane/hurricane/RegularLayer.h +++ b/hurricane/src/hurricane/hurricane/RegularLayer.h @@ -1,7 +1,7 @@ // -*- C++ -*- // -// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved +// Copyright (c) BULL S.A. 2000-2014, All Rights Reserved // // This file is part of Hurricane. // @@ -19,12 +19,7 @@ // License along with Hurricane. If not, see // . // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | @@ -32,17 +27,14 @@ // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Header : "./hurricane/RegularLayer.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ -#ifndef __HURRICANE_REGULAR_LAYER__ -#define __HURRICANE_REGULAR_LAYER__ +#ifndef HURRICANE_REGULAR_LAYER_H +#define HURRICANE_REGULAR_LAYER_H -#include "hurricane/Layer.h" -#include "hurricane/RegularLayers.h" +#include "hurricane/Layer.h" +#include "hurricane/RegularLayers.h" namespace Hurricane { @@ -98,10 +90,8 @@ namespace Hurricane { inline BasicLayer* RegularLayer::getBasicLayer () const { return _basicLayer; } -} // End of Hurricane namespace. - +} // Hurricane namespace. INSPECTOR_P_SUPPORT(Hurricane::RegularLayer); - -# endif +#endif // HURRICANE_REGULAR_LAYER_H diff --git a/katabatic/src/AutoContact.cpp b/katabatic/src/AutoContact.cpp index 89335823..d6a6ae9a 100644 --- a/katabatic/src/AutoContact.cpp +++ b/katabatic/src/AutoContact.cpp @@ -341,34 +341,37 @@ namespace Katabatic { } - void AutoContact::showTopologyError ( const std::string& message ) + void AutoContact::showTopologyError ( const std::string& message, unsigned int flags ) { - Component* anchor = NULL; - Horizontal** horizontals = new Horizontal* [10]; - Vertical** verticals = new Vertical* [10]; + Component* anchor = NULL; + Horizontal** horizontals = new Horizontal* [10]; + Vertical** verticals = new Vertical* [10]; + + if (not (flags & KbCParanoid)) cparanoid.setStreamMask( mstream::PassThrough ); _getTopology ( anchor, horizontals, verticals, 10 ); - cerr << Error("In topology of %s",getString(this).c_str()) << endl; - if (anchor) cerr << " A: " << anchor << endl; + cparanoid << Error("In topology of %s",getString(this).c_str()) << endl; + if (anchor) cparanoid << " A: " << anchor << endl; for ( size_t i=0 ; (i<10) and (horizontals[i] != NULL); ++i ) { AutoSegment* autoSegment = Session::lookup ( horizontals[i] ); if (autoSegment != NULL) - cerr << " " << (autoSegment->isGlobal()?'G':'L') << ": " << autoSegment << endl; + cparanoid << " " << (autoSegment->isGlobal()?'G':'L') << ": " << autoSegment << endl; else - cerr << " ?: " << horizontals[i] << endl; + cparanoid << " ?: " << horizontals[i] << endl; } for ( size_t i=0 ; (i<10) and (verticals[i] != NULL); ++i ) { AutoSegment* autoSegment = Session::lookup ( verticals[i] ); if (autoSegment != NULL) - cerr << " " << (autoSegment->isGlobal()?'G':'L') << ": " << autoSegment << endl; + cparanoid << " " << (autoSegment->isGlobal()?'G':'L') << ": " << autoSegment << endl; else - cerr << " ?: " << verticals[i] << endl; + cparanoid << " ?: " << verticals[i] << endl; } - cerr << " " << message << endl; + cparanoid << " " << message << endl; + if (not (flags & KbCParanoid)) cparanoid.unsetStreamMask( mstream::PassThrough ); delete [] horizontals; delete [] verticals; diff --git a/katabatic/src/AutoContactTerminal.cpp b/katabatic/src/AutoContactTerminal.cpp index 23e4cd0f..95a7293f 100644 --- a/katabatic/src/AutoContactTerminal.cpp +++ b/katabatic/src/AutoContactTerminal.cpp @@ -298,7 +298,10 @@ namespace Katabatic { ltrace(110) << "Cached: " << _segment << endl; message << "Terminal horizontal segment Y " << DbU::getValueString(_segment->getY()) << " axis is outside RoutingPad " << getUConstraints(KbVertical) << "."; - showTopologyError( message.str() ); + + unsigned int flags = 0; + if (_segment->isCreated()) flags |= KbCParanoid; + showTopologyError( message.str(), flags ); } else setY( _segment->getY() ); } else { @@ -306,7 +309,10 @@ namespace Katabatic { ltrace(110) << "Cached: " << _segment << endl; message << "Terminal vertical segment X" << DbU::getValueString(_segment->getX()) << " axis is outside RoutingPad " << getUConstraints(KbHorizontal) << "."; - showTopologyError( message.str() ); + + unsigned int flags = 0; + if (_segment->isCreated()) flags |= KbCParanoid; + showTopologyError( message.str(), flags ); } else setX( _segment->getX() ); } diff --git a/katabatic/src/AutoHorizontal.cpp b/katabatic/src/AutoHorizontal.cpp index a03b6c14..5da2bbd2 100644 --- a/katabatic/src/AutoHorizontal.cpp +++ b/katabatic/src/AutoHorizontal.cpp @@ -417,16 +417,16 @@ namespace Katabatic { void AutoHorizontal::updatePositions () { - _sourcePosition = _horizontal->getSourceX() - Session::getExtensionCap(); - _targetPosition = _horizontal->getTargetX() + Session::getExtensionCap(); + _sourcePosition = _horizontal->getSourceX() - Session::getExtensionCap(getLayer()); + _targetPosition = _horizontal->getTargetX() + Session::getExtensionCap(getLayer()); } bool AutoHorizontal::checkPositions () const { bool coherency = true; - DbU::Unit sourcePosition = _horizontal->getSourceX() - Session::getExtensionCap(); - DbU::Unit targetPosition = _horizontal->getTargetX() + Session::getExtensionCap(); + DbU::Unit sourcePosition = _horizontal->getSourceX() - Session::getExtensionCap(getLayer()); + DbU::Unit targetPosition = _horizontal->getTargetX() + Session::getExtensionCap(getLayer()); if ( _sourcePosition != sourcePosition ) { cerr << Error ( "%s\n Source position incoherency: " @@ -745,16 +745,14 @@ namespace Katabatic { segment2->setFlags( (isSlackened()?SegSlackened:0) ); Session::dogleg( segment2 ); - if (isStrongTerminal()) { - if (autoSource->getAnchor()) { - segment1->setFlags( SegWeakTerminal1 ); - segment2->setFlags( SegWeakTerminal1 ); - } else { - unsetFlags( SegStrongTerminal ); - setFlags( SegWeakTerminal1 ); - segment1->setFlags( SegWeakTerminal1 ); - segment2->setFlags( SegStrongTerminal ); - } + if (isSourceTerminal()) { + segment1->setFlags( SegWeakTerminal1 ); + segment2->setFlags( SegWeakTerminal1 ); + } else if (isTargetTerminal()) { + unsetFlags( SegTargetTerminal ); + setFlags( SegWeakTerminal1 ); + segment1->setFlags( SegWeakTerminal1 ); + segment2->setFlags( SegTargetTerminal ); } else if (isWeakTerminal()) { segment1->setFlags( SegWeakTerminal1 ); segment2->setFlags( SegWeakTerminal1 ); diff --git a/katabatic/src/AutoSegment.cpp b/katabatic/src/AutoSegment.cpp index e654d7ee..79fcc7f7 100644 --- a/katabatic/src/AutoSegment.cpp +++ b/katabatic/src/AutoSegment.cpp @@ -324,8 +324,9 @@ namespace Katabatic { _allocateds++; - if (dynamic_cast(segment)) setFlags( SegHorizontal ); - if (source->isTerminal() or target->isTerminal()) setFlags( SegStrongTerminal ); + if (dynamic_cast(segment)) setFlags( SegHorizontal ); + if (source->isTerminal()) setFlags( SegSourceTerminal ); + if (target->isTerminal()) setFlags( SegTargetTerminal ); _gcell = source->getGCell(); setOptimalMax ( isHorizontal() ? _gcell->getBoundingBox().getYMax() @@ -875,14 +876,19 @@ namespace Katabatic { << " T:" << target->isTerminal() << " " << this << endl; - if (source->isTerminal() or target->isTerminal()) { + if (source->isTerminal()) { unsetFlags( SegWeakTerminal ); - setFlags ( SegStrongTerminal ); + setFlags ( SegSourceTerminal ); + } else if (target->isTerminal()) { + unsetFlags( SegWeakTerminal ); + setFlags ( SegTargetTerminal ); } else { unsigned int terminalFlag = 0; switch ( _getFlags() & SegWeakTerminal ) { case 0: break; - case SegStrongTerminal: terminalFlag = SegWeakTerminal1; break; + case SegSourceTerminal|SegTargetTerminal: + case SegSourceTerminal: + case SegTargetTerminal: terminalFlag = SegWeakTerminal1; break; case SegWeakTerminal1: terminalFlag = SegWeakTerminal1; break; case SegWeakTerminal2: terminalFlag = SegWeakTerminal2; break; default: @@ -1847,7 +1853,9 @@ namespace Katabatic { ) { static const Layer* horizontalLayer = Session::getRoutingLayer( 1 ); + static DbU::Unit horizontalWidth = Session::getWireWidth ( 1 ); static const Layer* verticalLayer = Session::getRoutingLayer( 2 ); + static DbU::Unit verticalWidth = Session::getWireWidth ( 2 ); bool reattachSource = false; bool reattachTarget = false; @@ -1922,6 +1930,7 @@ namespace Katabatic { ,getString(horizontal).c_str() ,getString(horizontalLayer).c_str()) << endl; horizontal->setLayer( horizontalLayer ); + horizontal->setWidth( horizontalWidth ); } horizontal->setY( reference->getY() ); @@ -1934,6 +1943,7 @@ namespace Katabatic { ,getString(vertical).c_str() ,getString(verticalLayer).c_str()) << endl; vertical->setLayer( verticalLayer ); + vertical->setWidth( verticalWidth ); } vertical->setX( reference->getX() ); diff --git a/katabatic/src/AutoVertical.cpp b/katabatic/src/AutoVertical.cpp index ec04170f..d1a20b53 100644 --- a/katabatic/src/AutoVertical.cpp +++ b/katabatic/src/AutoVertical.cpp @@ -360,16 +360,16 @@ namespace Katabatic { void AutoVertical::updatePositions () { - _sourcePosition = _vertical->getSourceY() - Session::getExtensionCap(); - _targetPosition = _vertical->getTargetY() + Session::getExtensionCap(); + _sourcePosition = _vertical->getSourceY() - Session::getExtensionCap(getLayer()); + _targetPosition = _vertical->getTargetY() + Session::getExtensionCap(getLayer()); } bool AutoVertical::checkPositions () const { bool coherency = true; - DbU::Unit sourcePosition = _vertical->getSourceY() - Session::getExtensionCap(); - DbU::Unit targetPosition = _vertical->getTargetY() + Session::getExtensionCap(); + DbU::Unit sourcePosition = _vertical->getSourceY() - Session::getExtensionCap(getLayer()); + DbU::Unit targetPosition = _vertical->getTargetY() + Session::getExtensionCap(getLayer()); if ( _sourcePosition != sourcePosition ) { cerr << Error ( "%s\n Source position incoherency: " @@ -665,16 +665,14 @@ namespace Katabatic { segment2->setFlags( (isSlackened()?SegSlackened:0) ); Session::dogleg( segment2 ); - if (isStrongTerminal()) { - if (autoSource->getAnchor()) { - segment1->setFlags( SegWeakTerminal1 ); - segment2->setFlags( SegWeakTerminal1 ); - } else { - unsetFlags( SegStrongTerminal ); - setFlags( SegWeakTerminal1 ); - segment1->setFlags( SegWeakTerminal1 ); - segment2->setFlags( SegStrongTerminal ); - } + if (isSourceTerminal()) { + segment1->setFlags( SegWeakTerminal1 ); + segment2->setFlags( SegWeakTerminal1 ); + } else if (isTargetTerminal()) { + unsetFlags( SegTargetTerminal ); + setFlags( SegWeakTerminal1 ); + segment1->setFlags( SegWeakTerminal1 ); + segment2->setFlags( SegTargetTerminal ); } else if (isWeakTerminal()) { segment1->setFlags( SegWeakTerminal1 ); segment2->setFlags( SegWeakTerminal1 ); diff --git a/katabatic/src/Configuration.cpp b/katabatic/src/Configuration.cpp index 6e8b6feb..0e7e4d69 100644 --- a/katabatic/src/Configuration.cpp +++ b/katabatic/src/Configuration.cpp @@ -22,6 +22,7 @@ #include "hurricane/Error.h" #include "hurricane/Technology.h" #include "hurricane/DataBase.h" +#include "hurricane/RegularLayer.h" #include "hurricane/Cell.h" #include "crlcore/Utilities.h" #include "crlcore/CellGauge.h" @@ -47,6 +48,7 @@ namespace Katabatic { using Hurricane::Error; using Hurricane::Technology; using Hurricane::DataBase; + using Hurricane::RegularLayer; using CRL::AllianceFramework; using CRL::RoutingGauge; using CRL::RoutingLayerGauge; @@ -68,7 +70,7 @@ namespace Katabatic { : Configuration () , _cg (NULL) , _rg (NULL) - , _extensionCap (DbU::lambda(0.5)) + , _extensionCaps () , _saturateRatio (Cfg::getParamPercentage("katabatic.saturateRatio",80.0)->asDouble()) , _saturateRp (Cfg::getParamInt ("katabatic.saturateRp" ,8 )->asInt()) , _globalThreshold(0) @@ -98,15 +100,26 @@ namespace Katabatic { _globalThreshold = DbU::fromLambda ( (double)Cfg::getParamInt("katabatic.globalLengthThreshold",29*DbU::toLambda(sliceHeight))->asInt() ); - vector::const_iterator ilayerGauge = rg->getLayerGauges().begin(); - for ( ; ilayerGauge != rg->getLayerGauges().end() ; ++ilayerGauge ) { - RoutingLayerGauge* layerGauge = (*ilayerGauge); - if (layerGauge->getType() != Constant::Default) continue; + const vector& layerGauges = rg->getLayerGauges(); + for ( size_t depth=0 ; depth < layerGauges.size() ; ++depth ) { + const RegularLayer* regularLayer = dynamic_cast( layerGauges[depth]->getLayer() ); + if (regularLayer) + _extensionCaps.push_back( regularLayer->getExtentionCap() ); + else { + _extensionCaps.push_back( 0 ); + cerr << Warning( "Routing layer at depth %d is *not* a RegularLayer, cannot guess extension cap.\n" + " (%s)" + , depth + , getString(layerGauges[depth]->getLayer()).c_str() + ) << endl; + } - if (layerGauge->getDirection() == Constant::Horizontal) { - _hEdgeCapacity += layerGauge->getTrackNumber ( 0, sliceHeight ) - 1; - } else if (layerGauge->getDirection() == Constant::Vertical) { - _vEdgeCapacity += layerGauge->getTrackNumber( 0, sliceHeight ) - 1; + if (layerGauges[depth]->getType() != Constant::Default) continue; + + if (layerGauges[depth]->getDirection() == Constant::Horizontal) { + _hEdgeCapacity += layerGauges[depth]->getTrackNumber( 0, sliceHeight ) - 1; + } else if (layerGauges[depth]->getDirection() == Constant::Vertical) { + _vEdgeCapacity += layerGauges[depth]->getTrackNumber( 0, sliceHeight ) - 1; } } } @@ -119,7 +132,7 @@ namespace Katabatic { , _gcontact (other._gcontact) , _cg (NULL) , _rg (NULL) - , _extensionCap (other._extensionCap) + , _extensionCaps (other._extensionCaps) , _saturateRatio (other._saturateRatio) , _globalThreshold (other._globalThreshold) , _allowedDepth (other._allowedDepth) @@ -185,10 +198,6 @@ namespace Katabatic { { return _rg->getContactLayer(depth); } - DbU::Unit ConfigurationConcrete::getExtensionCap () const - { return _extensionCap; } - - DbU::Unit ConfigurationConcrete::getSliceHeight () const { return _cg->getSliceHeight(); } @@ -205,6 +214,10 @@ namespace Katabatic { { return getOffset( getLayerDepth(layer) ); } + DbU::Unit ConfigurationConcrete::getExtensionCap ( const Layer* layer ) const + { return getExtensionCap( getLayerDepth(layer) ); } + + DbU::Unit ConfigurationConcrete::getWireWidth ( const Layer* layer ) const { return getWireWidth( getLayerDepth(layer) ); } @@ -248,6 +261,10 @@ namespace Katabatic { { return _rg->getLayerWireWidth(depth); } + DbU::Unit ConfigurationConcrete::getExtensionCap ( size_t depth ) const + { return _extensionCaps[depth]; } + + unsigned int ConfigurationConcrete::getDirection ( size_t depth ) const { return _rg->getLayerDirection(depth); } diff --git a/katabatic/src/LoadGrByNet.cpp b/katabatic/src/LoadGrByNet.cpp index 1162bc93..0d2ba954 100644 --- a/katabatic/src/LoadGrByNet.cpp +++ b/katabatic/src/LoadGrByNet.cpp @@ -446,11 +446,16 @@ namespace { DbU::Unit height = abs( target.getY() - source.getY() ); unsigned int flags = 0; - // HARDCODED VALUE. flags |= (width < 3*Session::getPitch(anchorDepth)) ? HSmall : 0; flags |= (height < 3*Session::getPitch(anchorDepth)) ? VSmall : 0; flags |= ((width == 0) && (height == 0)) ? Punctual : 0; + ltrace(99) << "::checkRoutingPadSize(): pitch[" << anchorDepth << "]:" + << DbU::toLambda(Session::getPitch(anchorDepth)) << " " + << ((flags & HSmall) ? "HSmall " : " ") + << ((flags & VSmall) ? "VSmall " : " ") + << endl; + return flags; } @@ -1104,10 +1109,20 @@ namespace { doRp_AutoContacts( gcell, rp, rpContactSource, rpContactTarget, flags ); - if ( not (flags & HAccess) and (flags & HSmall) ) { - AutoContact* subContact1 = AutoContactTurn::create( gcell, rp->getNet(), Session::getContactLayer(1) ); - AutoSegment::create( rpContactSource, subContact1, KbHorizontal ); - rpContactSource = subContact1; + if (flags & HAccess) { + if (flags & VSmall) { + AutoContact* subContact1 = AutoContactTurn::create( gcell, rp->getNet(), Session::getContactLayer(1) ); + AutoContact* subContact2 = AutoContactTurn::create( gcell, rp->getNet(), Session::getContactLayer(1) ); + AutoSegment::create( rpContactSource, subContact1, KbHorizontal ); + AutoSegment::create( subContact1, subContact2, KbVertical ); + rpContactSource = subContact2; + } + } else { + if (flags & HSmall) { + AutoContact* subContact1 = AutoContactTurn::create( gcell, rp->getNet(), Session::getContactLayer(1) ); + AutoSegment::create( rpContactSource, subContact1, KbHorizontal ); + rpContactSource = subContact1; + } } ltraceout(99); diff --git a/katabatic/src/katabatic/AutoContact.h b/katabatic/src/katabatic/AutoContact.h index 481e9379..358254d4 100644 --- a/katabatic/src/katabatic/AutoContact.h +++ b/katabatic/src/katabatic/AutoContact.h @@ -144,7 +144,7 @@ namespace Katabatic { virtual void updateCache () = 0; virtual void updateGeometry () = 0; virtual void updateTopology () = 0; - void showTopologyError ( const std::string& ); + void showTopologyError ( const std::string&, unsigned int flags=0 ); virtual void checkTopology (); inline void setFlags ( unsigned int ); inline void unsetFlags ( unsigned int ); diff --git a/katabatic/src/katabatic/AutoSegment.h b/katabatic/src/katabatic/AutoSegment.h index 528b55d7..192d42cc 100644 --- a/katabatic/src/katabatic/AutoSegment.h +++ b/katabatic/src/katabatic/AutoSegment.h @@ -74,11 +74,13 @@ namespace Katabatic { , SegTargetTop = 0x00000400 , SegTargetBottom = 0x00000800 , SegLayerChange = 0x00001000 - , SegStrongTerminal = 0x00002000 // Replace Terminal. - , SegWeakTerminal1 = 0x00004000 // Replace TopologicalEnd. - , SegWeakTerminal2 = 0x00008000 // Replace TopologicalEnd. - , SegNotSourceAligned = 0x00010000 - , SegNotTargetAligned = 0x00020000 + , SegSourceTerminal = 0x00002000 // Replace Terminal. + , SegTargetTerminal = 0x00004000 // Replace Terminal. + , SegStrongTerminal = SegSourceTerminal|SegTargetTerminal + , SegWeakTerminal1 = 0x00008000 // Replace TopologicalEnd. + , SegWeakTerminal2 = 0x00010000 // Replace TopologicalEnd. + , SegNotSourceAligned = 0x00020000 + , SegNotTargetAligned = 0x00040000 , SegUnbound = 0x00100000 , SegHalfSlackened = 0x00200000 , SegSlackened = 0x00400000 @@ -164,6 +166,8 @@ namespace Katabatic { inline bool isNotTargetAligned () const; inline bool isNotAligned () const; bool isStrongTerminal ( unsigned int flags=0 ) const; + inline bool isSourceTerminal () const; + inline bool isTargetTerminal () const; bool isSameLayerDogleg () const; inline bool isLayerChange () const; inline bool isSpinTop () const; @@ -426,6 +430,8 @@ namespace Katabatic { inline bool AutoSegment::isWeakTerminal () const { return _flags & SegWeakTerminal; } inline bool AutoSegment::isWeakTerminal1 () const { return _flags & SegWeakTerminal1; } inline bool AutoSegment::isWeakTerminal2 () const { return _flags & SegWeakTerminal2; } + inline bool AutoSegment::isSourceTerminal () const { return _flags & SegSourceTerminal; } + inline bool AutoSegment::isTargetTerminal () const { return _flags & SegTargetTerminal; } inline bool AutoSegment::isTerminal () const { return _flags & SegStrongTerminal; } inline bool AutoSegment::isNotSourceAligned () const { return _flags & SegNotSourceAligned; } inline bool AutoSegment::isNotTargetAligned () const { return _flags & SegNotTargetAligned; } diff --git a/katabatic/src/katabatic/Configuration.h b/katabatic/src/katabatic/Configuration.h index 3b3573ca..6448e99c 100644 --- a/katabatic/src/katabatic/Configuration.h +++ b/katabatic/src/katabatic/Configuration.h @@ -18,6 +18,7 @@ #define KATABATIC_CONFIGURATION_H #include +#include #include "hurricane/DbU.h" namespace Hurricane { @@ -68,16 +69,17 @@ namespace Katabatic { virtual RoutingLayerGauge* getLayerGauge ( size_t depth ) const = 0; virtual const Layer* getRoutingLayer ( size_t depth ) const = 0; virtual Layer* getContactLayer ( size_t depth ) const = 0; - virtual DbU::Unit getExtensionCap () const = 0; virtual DbU::Unit getSliceHeight () const = 0; virtual DbU::Unit getSliceStep () const = 0; virtual DbU::Unit getPitch ( size_t depth, unsigned int flags ) const = 0; virtual DbU::Unit getOffset ( size_t depth ) const = 0; virtual DbU::Unit getWireWidth ( size_t depth ) const = 0; + virtual DbU::Unit getExtensionCap ( size_t depth ) const = 0; virtual unsigned int getDirection ( size_t depth ) const = 0; virtual DbU::Unit getPitch ( const Layer*, unsigned int flags ) const = 0; virtual DbU::Unit getOffset ( const Layer* ) const = 0; virtual DbU::Unit getWireWidth ( const Layer* ) const = 0; + virtual DbU::Unit getExtensionCap ( const Layer* ) const = 0; virtual unsigned int getDirection ( const Layer* ) const = 0; virtual float getSaturateRatio () const = 0; virtual size_t getSaturateRp () const = 0; @@ -124,16 +126,17 @@ namespace Katabatic { virtual RoutingLayerGauge* getLayerGauge ( size_t depth ) const; virtual const Layer* getRoutingLayer ( size_t depth ) const; virtual Layer* getContactLayer ( size_t depth ) const; - virtual DbU::Unit getExtensionCap () const; virtual DbU::Unit getSliceHeight () const; virtual DbU::Unit getSliceStep () const; virtual DbU::Unit getPitch ( size_t depth, unsigned int flags ) const; virtual DbU::Unit getOffset ( size_t depth ) const; virtual DbU::Unit getWireWidth ( size_t depth ) const; + virtual DbU::Unit getExtensionCap ( size_t depth ) const; virtual unsigned int getDirection ( size_t depth ) const; virtual DbU::Unit getPitch ( const Layer*, unsigned int flags ) const; virtual DbU::Unit getOffset ( const Layer* ) const; virtual DbU::Unit getWireWidth ( const Layer* ) const; + virtual DbU::Unit getExtensionCap ( const Layer* ) const; virtual unsigned int getDirection ( const Layer* ) const; virtual float getSaturateRatio () const; virtual size_t getSaturateRp () const; @@ -150,18 +153,18 @@ namespace Katabatic { virtual string _getTypeName () const; protected: // Attributes. - const Layer* _gmetalh; - const Layer* _gmetalv; - const Layer* _gcontact; - CellGauge* _cg; - RoutingGauge* _rg; - DbU::Unit _extensionCap; - float _saturateRatio; - size_t _saturateRp; - DbU::Unit _globalThreshold; - size_t _allowedDepth; - size_t _hEdgeCapacity; - size_t _vEdgeCapacity; + const Layer* _gmetalh; + const Layer* _gmetalv; + const Layer* _gcontact; + CellGauge* _cg; + RoutingGauge* _rg; + std::vector _extensionCaps; + float _saturateRatio; + size_t _saturateRp; + DbU::Unit _globalThreshold; + size_t _allowedDepth; + size_t _hEdgeCapacity; + size_t _vEdgeCapacity; private: ConfigurationConcrete ( const ConfigurationConcrete& ); ConfigurationConcrete& operator= ( const ConfigurationConcrete& ); diff --git a/katabatic/src/katabatic/Constants.h b/katabatic/src/katabatic/Constants.h index d0afb8e1..b372c41d 100644 --- a/katabatic/src/katabatic/Constants.h +++ b/katabatic/src/katabatic/Constants.h @@ -45,6 +45,7 @@ namespace Katabatic { , KbNoCheckLayer = 0x00400000 , KbHalfSlacken = 0x00800000 , KbNoGCellShrink = 0x01000000 + , KbCParanoid = 0x02000000 , KbDirectionMask = KbHorizontal|KbVertical }; diff --git a/katabatic/src/katabatic/KatabaticEngine.h b/katabatic/src/katabatic/KatabaticEngine.h index 1411bc97..c2d56412 100644 --- a/katabatic/src/katabatic/KatabaticEngine.h +++ b/katabatic/src/katabatic/KatabaticEngine.h @@ -230,7 +230,6 @@ namespace Katabatic { inline DbU::Unit KatabaticEngine::getGlobalThreshold () const { return _configuration->getGlobalThreshold(); } inline float KatabaticEngine::getSaturateRatio () const { return _configuration->getSaturateRatio(); } inline size_t KatabaticEngine::getSaturateRp () const { return _configuration->getSaturateRp(); } - inline DbU::Unit KatabaticEngine::getExtensionCap () const { return _configuration->getExtensionCap(); } inline const AutoContactLut& KatabaticEngine::_getAutoContactLut () const { return _autoContactLut; } inline const AutoSegmentLut& KatabaticEngine::_getAutoSegmentLut () const { return _autoSegmentLut; } inline void KatabaticEngine::setState ( EngineState state ) { _state = state; } diff --git a/katabatic/src/katabatic/Session.h b/katabatic/src/katabatic/Session.h index 528f1ae4..f8592296 100644 --- a/katabatic/src/katabatic/Session.h +++ b/katabatic/src/katabatic/Session.h @@ -103,6 +103,7 @@ namespace Katabatic { static inline DbU::Unit getOffset ( const Layer* ); static inline DbU::Unit getWireWidth ( const Layer* ); static inline DbU::Unit getViaWidth ( const Layer* ); + static inline DbU::Unit getExtensionCap ( const Layer* ); static inline size_t getSegmentStackSize (); static inline size_t getContactStackSize (); static inline const vector& getInvalidateds (); @@ -198,7 +199,6 @@ namespace Katabatic { inline void Session::dogleg ( AutoSegment* autoSegment ) { return get("dogleg(AutoSegment*)")->_dogleg(autoSegment); } inline void Session::destroyRequest ( AutoSegment* autoSegment ) { return get("destroyRequest(AutoSegment*)")->_destroyRequest(autoSegment); } - inline DbU::Unit Session::getExtensionCap () { return getConfiguration()->getExtensionCap(); } inline size_t Session::getAllowedDepth () { return getConfiguration()->getAllowedDepth(); } inline DbU::Unit Session::getSliceHeight () { return getCellGauge()->getSliceHeight(); } @@ -217,6 +217,7 @@ namespace Katabatic { inline DbU::Unit Session::getOffset ( const Layer* layer ) { return getOffset ( getLayerDepth(layer) ); } inline DbU::Unit Session::getWireWidth ( const Layer* layer ) { return getWireWidth( getLayerDepth(layer) ); } inline DbU::Unit Session::getViaWidth ( const Layer* layer ) { return getViaWidth ( getViaDepth(layer) ); } + inline DbU::Unit Session::getExtensionCap ( const Layer* layer ) { return getConfiguration()->getExtensionCap(layer); } inline unsigned int Session::getDirection ( const Layer* layer ) { return getDirection( getLayerDepth(layer) ); } inline void Session::_dogleg ( AutoSegment* segment ) { _doglegs.push_back(segment); } diff --git a/kite/src/BuildPowerRails.cpp b/kite/src/BuildPowerRails.cpp index 51097962..c2f20403 100644 --- a/kite/src/BuildPowerRails.cpp +++ b/kite/src/BuildPowerRails.cpp @@ -871,6 +871,7 @@ namespace { _planes.insert( make_pair(regular->getBasicLayer(),new Plane(regular,rp)) ); + if (lg->getType() == Constant::PinOnly) continue; const BasicLayer* blockageLayer = regular->getBasicLayer()->getBlockageLayer(); if (not blockageLayer) continue; @@ -1014,10 +1015,6 @@ namespace { PowerRailsPlanes::Plane* activePlane = _powerRailsPlanes.getActivePlane(); if (not activePlane) return; - // if (activePlane->getRoutingPlane()->getLayerGauge()->getType() == Constant::PinOnly) { - // cmess1 << " - PowerRails in " << activePlane->getLayer()->getName() << " - Skipped (PinOnly layer)." << endl; - // return; - // } cmess1 << " - PowerRails in " << activePlane->getLayer()->getName() << " ..." << endl; Query::doQuery(); diff --git a/kite/src/Configuration.cpp b/kite/src/Configuration.cpp index 7c9e8647..7cbef5cf 100644 --- a/kite/src/Configuration.cpp +++ b/kite/src/Configuration.cpp @@ -165,6 +165,10 @@ namespace Kite { { return _base->getWireWidth(depth); } + DbU::Unit Configuration::getExtensionCap ( size_t depth ) const + { return _base->getExtensionCap(depth); } + + unsigned int Configuration::getDirection ( size_t depth ) const { return _base->getDirection(depth); } @@ -185,8 +189,8 @@ namespace Kite { { return _base->getDirection(layer); } - DbU::Unit Configuration::getExtensionCap () const - { return _base->getExtensionCap(); } + DbU::Unit Configuration::getExtensionCap ( const Layer* layer ) const + { return _base->getExtensionCap(layer); } float Configuration::getSaturateRatio () const diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index 66ebcf1d..c444ec0b 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -449,6 +449,9 @@ namespace Kite { createGlobalGraph( mode ); + // Test signals from . + //DebugSession::addToTrace( getCell(), "aux34" ); + // Test signals from . //DebugSession::addToTrace( getCell(), "auxsc37" ); // Test signals from . diff --git a/kite/src/Manipulator.cpp b/kite/src/Manipulator.cpp index afff592a..2a52b761 100644 --- a/kite/src/Manipulator.cpp +++ b/kite/src/Manipulator.cpp @@ -271,7 +271,7 @@ namespace Kite { bool Manipulator::relax ( Interval interval, unsigned int flags ) { - interval.inflate( - Session::getExtensionCap() ); + interval.inflate( - Session::getExtensionCap(getLayer()) ); ltrace(200) << "Manipulator::relax() of: " << _segment << " " << interval << endl; if (_segment->isFixed()) return false; @@ -741,7 +741,7 @@ namespace Kite { if ( event3->getTracksFree() == 1 ) { ltrace(200) << "Potential left intrication with other perpandicular." << endl; - if ( isegment3->getAxis() == segment2->getTargetU() - Session::getExtensionCap() ) { + if ( isegment3->getAxis() == segment2->getTargetU() - Session::getExtensionCap(getLayer()) ) { leftIntrication = true; leftAxisHint = isegment3->getAxis(); } @@ -755,7 +755,7 @@ namespace Kite { break; if ( event3->getTracksFree() == 1 ) { ltrace(200) << "Potential right intrication with other perpandicular." << endl; - if ( isegment3->getAxis() == segment2->getSourceU() + Session::getExtensionCap() ) { + if ( isegment3->getAxis() == segment2->getSourceU() + Session::getExtensionCap(getLayer()) ) { rightIntrication = true; rightAxisHint = isegment3->getAxis(); } @@ -861,8 +861,8 @@ namespace Kite { Net* ownerNet = _segment->getNet(); set canonicals; bool success = true; - DbU::Unit leftExtend = _segment->getSourceU() + Session::getExtensionCap(); - DbU::Unit rightExtend = _segment->getSourceU() - Session::getExtensionCap(); + DbU::Unit leftExtend = _segment->getSourceU() + Session::getExtensionCap(getLayer()); + DbU::Unit rightExtend = _segment->getSourceU() - Session::getExtensionCap(getLayer()); ltrace(200) << "Manipulator::shrinkToTrack()" << endl; @@ -1377,10 +1377,10 @@ namespace Kite { // Ugly: ExtensionCap usage. if ( moveLeft ) { - if ( perpandicular->getTargetU()-Session::getExtensionCap() == _event->getAxisHistory() ) + if ( perpandicular->getTargetU()-Session::getExtensionCap(getLayer()) == _event->getAxisHistory() ) _fsm.addAction ( perpandicular, SegmentAction::OtherRipupPerpandAndPacking ); } else { - if ( perpandicular->getSourceU()+Session::getExtensionCap() == _event->getAxisHistory() ) + if ( perpandicular->getSourceU()+Session::getExtensionCap(getLayer()) == _event->getAxisHistory() ) _fsm.addAction ( perpandicular, SegmentAction::OtherRipupPerpandAndPacking ); } } diff --git a/kite/src/NegociateWindow.cpp b/kite/src/NegociateWindow.cpp index 745caadf..7d606eda 100644 --- a/kite/src/NegociateWindow.cpp +++ b/kite/src/NegociateWindow.cpp @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2008-2013, All Rights Reserved +// Copyright (c) UPMC 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -238,7 +237,7 @@ namespace Kite { Interval blockageSpan; autoSegment->getCanonical( fixedSpan ); - fixedSpan.inflate( Session::getExtensionCap()-1 ); + fixedSpan.inflate( Session::getExtensionCap(autoSegment->getLayer())-1 ); track->getOverlapBounds( fixedSpan, begin, end ); for ( ; (begin < end) ; begin++ ) { @@ -249,7 +248,7 @@ namespace Kite { if (not other->isBlockage()) continue; other->getCanonical( blockageSpan ); - blockageSpan.inflate( Session::getExtensionCap() ); + blockageSpan.inflate( Session::getExtensionCap(autoSegment->getLayer()) ); ltrace(200) << " fixed:" << fixedSpan << " vs. blockage:" << blockageSpan << endl; diff --git a/kite/src/RoutingEvent.cpp b/kite/src/RoutingEvent.cpp index 73b1f1d1..963764fa 100644 --- a/kite/src/RoutingEvent.cpp +++ b/kite/src/RoutingEvent.cpp @@ -161,7 +161,7 @@ namespace Kite { : _cloned (false) , _processed (false) , _disabled (false) - , _canHandleConstraints(false) + , _overConstrained (false) , _minimized (false) , _forceToHint (false) , _ripedByLocal (false) @@ -397,7 +397,7 @@ namespace Kite { DebugSession::open( _segment->getNet(), 148 ); - ltrace(500) << "Deter| Event" + ltrace(500) << "Deter| Event " << getProcesseds() << "," << getEventLevel() << "," << setw(6) << getPriority() @@ -468,7 +468,7 @@ namespace Kite { ltrace(200) << "| " << fsm.getCost(itrack) << endl; itrack = 0; - if (Manipulator(_segment,fsm).canRipup()) { + if ( (not isOverConstrained()) and Manipulator(_segment,fsm).canRipup() ) { if (fsm.getCosts().size() and fsm.getCost(itrack).isFree()) { ltrace(200) << "Insert in free space " << this << endl; resetInsertState(); @@ -501,6 +501,10 @@ namespace Kite { } } else { // Ripup limit has been reached. + if (isOverConstrained()) { + ltrace(200) << "Immediate slackening due to overconstraint" << endl; + fsm.getData()->setState( DataNegociate::Slacken ); + } if (not fsm.slackenTopology()) { fsm.setState( SegmentFsm::SelfMaximumSlack ); } @@ -606,7 +610,7 @@ namespace Kite { setAxisHintFromParent(); ltrace(200) << "axisHint:" << DbU::getValueString(getAxisHint()) << endl; - _canHandleConstraints = true; + _overConstrained = false; _segment->base()->getConstraints( _constraints ); _segment->base()->getOptimal ( _optimal ); @@ -644,12 +648,12 @@ namespace Kite { if ( track && (track->getAxis() < _constraints.getVMin()) ) track = track->getNextTrack(); for ( ; track && (track->getAxis() <= _constraints.getVMax()) ; track = track->getNextTrack(), _tracksNb++ ); - - _canHandleConstraints = false; } if (not _tracksNb) { ltrace(200) << "| Pure constraints are too tight." << endl; - _canHandleConstraints = false; + if (_segment->base()) + _overConstrained = _segment->base()->getAutoSource()->isTerminal() + and _segment->base()->getAutoTarget()->isTerminal(); } _priority diff --git a/kite/src/kite/Configuration.h b/kite/src/kite/Configuration.h index 5a30660c..1f8196f7 100644 --- a/kite/src/kite/Configuration.h +++ b/kite/src/kite/Configuration.h @@ -71,12 +71,13 @@ namespace Kite { virtual DbU::Unit getPitch ( size_t depth, unsigned int flags ) const; virtual DbU::Unit getOffset ( size_t depth ) const; virtual DbU::Unit getWireWidth ( size_t depth ) const; + virtual DbU::Unit getExtensionCap ( size_t depth ) const; virtual unsigned int getDirection ( size_t depth ) const; virtual DbU::Unit getPitch ( const Layer*, unsigned int flags ) const; virtual DbU::Unit getOffset ( const Layer* ) const; virtual DbU::Unit getWireWidth ( const Layer* ) const; virtual unsigned int getDirection ( const Layer* ) const; - virtual DbU::Unit getExtensionCap () const; + virtual DbU::Unit getExtensionCap ( const Layer* ) const; virtual float getSaturateRatio () const; virtual size_t getSaturateRp () const; virtual DbU::Unit getGlobalThreshold () const; diff --git a/kite/src/kite/Manipulator.h b/kite/src/kite/Manipulator.h index fef6680e..f5999bea 100644 --- a/kite/src/kite/Manipulator.h +++ b/kite/src/kite/Manipulator.h @@ -56,6 +56,7 @@ namespace Kite { inline TrackElement* getSegment () const; inline DataNegociate* getData () const; inline RoutingEvent* getEvent () const; + inline const Layer* getLayer () const; inline DbU::Unit getPitch () const; inline DbU::Unit getPPitch () const; bool canRipup ( unsigned int flags=0 ) const; @@ -93,6 +94,7 @@ namespace Kite { inline TrackElement* Manipulator::getSegment () const { return _segment; } inline DataNegociate* Manipulator::getData () const { return _data; } inline RoutingEvent* Manipulator::getEvent () const { return _event; } + inline const Layer* Manipulator::getLayer () const { return _segment->getLayer(); } inline DbU::Unit Manipulator::getPitch () const { return _segment->getPitch(); } inline DbU::Unit Manipulator::getPPitch () const { return _segment->getPPitch(); } diff --git a/kite/src/kite/RoutingEvent.h b/kite/src/kite/RoutingEvent.h index b7f1f85f..cc96307b 100644 --- a/kite/src/kite/RoutingEvent.h +++ b/kite/src/kite/RoutingEvent.h @@ -1,7 +1,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2008-2013, All Rights Reserved +// Copyright (c) UPMC 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -113,6 +113,7 @@ namespace Kite { inline bool isForcedToHint () const; inline bool isSheared () const; inline bool isRipedByLocal () const; + inline bool isOverConstrained () const; inline unsigned int getId () const; inline bool getMode () const; inline bool canMinimize () const; @@ -172,7 +173,7 @@ namespace Kite { mutable bool _cloned; bool _processed; bool _disabled; - bool _canHandleConstraints; + bool _overConstrained; bool _minimized; bool _forceToHint; bool _ripedByLocal; @@ -202,6 +203,7 @@ namespace Kite { inline bool RoutingEvent::isDisabled () const { return _disabled; } inline bool RoutingEvent::isForcedToHint () const { return _forceToHint; } inline bool RoutingEvent::isRipedByLocal () const { return _ripedByLocal; } + inline bool RoutingEvent::isOverConstrained () const { return _overConstrained; } inline unsigned int RoutingEvent::getId () const { return _id; } inline bool RoutingEvent::getMode () const { return _mode; } inline bool RoutingEvent::canMinimize () const { return !_minimized; } diff --git a/kite/src/kite/SegmentFsm.h b/kite/src/kite/SegmentFsm.h index 7ca62734..90543477 100644 --- a/kite/src/kite/SegmentFsm.h +++ b/kite/src/kite/SegmentFsm.h @@ -1,7 +1,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2008-2013, All Rights Reserved +// Copyright (c) UPMC 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | diff --git a/metis/src/MetisEngine.cpp b/metis/src/MetisEngine.cpp index ae9821a6..04962097 100644 --- a/metis/src/MetisEngine.cpp +++ b/metis/src/MetisEngine.cpp @@ -119,7 +119,7 @@ namespace Metis { bool MetisEngine::isHMetisCapable () { #ifdef HAVE_HMETIS_LIB - return true; + return false; #else return false; #endif // HAVE_HMETIS_LIB