From 4163fc044a98146123841fe3db666e1a81a9a798 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Thu, 15 Dec 2016 19:25:05 +0100 Subject: [PATCH 1/5] In Anabatic, check if there is at least one METAL1 in singleGCell(). * Bug: In Anabatic::singleGCell(), in some analogic design, there may be not a single METAL1 in the GCell. Issue a clean warning instead of going ashtray. * Change: In CRL.etc/technology.cong & CRL.etc/display.conf, add a "metbot_r" as a real layer when "metbot" symbolic layer is distinct from a normal metal. --- anabatic/src/LoadGlobalRouting.cpp | 6 ++++++ crlcore/etc/common/display.conf | 24 ++++++++++++------------ crlcore/etc/common/technology.conf | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/anabatic/src/LoadGlobalRouting.cpp b/anabatic/src/LoadGlobalRouting.cpp index 90fb84ef..53615b9e 100644 --- a/anabatic/src/LoadGlobalRouting.cpp +++ b/anabatic/src/LoadGlobalRouting.cpp @@ -2147,6 +2147,12 @@ namespace { return; } + if (rpM1s.empty()) { + cerr << Error( "No METAL1 in Single GCell for Net \"%s\".", getString(net->getName()).c_str() ) << endl; + cdebug_tabw(145,-1); + return; + } + sort( rpM1s.begin(), rpM1s.end(), SortRpByX(NoFlags) ); // increasing X. GCell* gcell1 = anbt->getGCellUnder( (*rpM1s.begin ())->getCenter() ); diff --git a/crlcore/etc/common/display.conf b/crlcore/etc/common/display.conf index 215131c8..ca855467 100644 --- a/crlcore/etc/common/display.conf +++ b/crlcore/etc/common/display.conf @@ -63,10 +63,10 @@ stylesTable = \ # Group: MIM6. , (Group , 'MIM6') - #, (Drawing, 'topmim6', { 'color':'Blue' , 'pattern':'poids2.8' , 'threshold':0.80*scale }) - , (Drawing, 'metbot' , { 'color':'Aqua' , 'pattern':'light_antihash0.8', 'threshold':0.80*scale }) - , (Drawing, 'cut6' , { 'color':'LightPink', 'pattern':'light_antihash1.8', 'threshold':0.80*scale }) - , (Drawing, 'metal7' , { 'color':'Green' , 'pattern':'light_antihash2.8', 'threshold':0.80*scale }) + #, (Drawing, 'topmim6' , { 'color':'Blue' , 'pattern':'poids2.8' , 'threshold':0.80*scale }) + , (Drawing, 'metbot_r', { 'color':'Aqua' , 'pattern':'light_antihash0.8', 'threshold':0.80*scale }) + , (Drawing, 'cut6' , { 'color':'LightPink', 'pattern':'light_antihash1.8', 'threshold':0.80*scale }) + , (Drawing, 'metal7' , { 'color':'Green' , 'pattern':'light_antihash2.8', 'threshold':0.80*scale }) # Group: Blockages. , (Group , 'Blockages') @@ -168,10 +168,10 @@ stylesTable = \ # MIM6. , (Group , 'MIM6') - #, (Drawing, 'topmim6', { 'color':'Blue' , 'pattern':'poids2.32' , 'threshold':0.80*scale }) - , (Drawing, 'metbot' , { 'color':'Aqua' , 'pattern':'light_antihash0.8' , 'threshold':0.80*scale }) - #, (Drawing, 'padopen', { 'color':'LightPink', 'pattern':'light_antihash1.8' , 'threshold':0.80*scale }) - , (Drawing, 'metal7' , { 'color':'Green' , 'pattern':'light_antihash2.8' , 'threshold':0.80*scale }) + #, (Drawing, 'topmim6' , { 'color':'Blue' , 'pattern':'poids2.32' , 'threshold':0.80*scale }) + , (Drawing, 'metbot_r', { 'color':'Aqua' , 'pattern':'light_antihash0.8' , 'threshold':0.80*scale }) + #, (Drawing, 'padopen' , { 'color':'LightPink', 'pattern':'light_antihash1.8' , 'threshold':0.80*scale }) + , (Drawing, 'metal7' , { 'color':'Green' , 'pattern':'light_antihash2.8' , 'threshold':0.80*scale }) # Blockages. , (Group , 'Blockages') @@ -344,10 +344,10 @@ stylesTable = \ # Group: MIM6. , (Group , 'MIM6') - #, (Drawing, 'topmim6', { 'color':'Blue' , 'pattern':'poids2.8' , 'threshold':0.80*scale }) - , (Drawing, 'metbot' , { 'color':'Aqua' , 'pattern':'light_antihash0.8', 'threshold':0.80*scale }) - , (Drawing, 'cut6' , { 'color':'LightPink', 'pattern':'light_antihash1.8', 'threshold':0.80*scale }) - , (Drawing, 'metal7' , { 'color':'Green' , 'pattern':'light_antihash2.8', 'threshold':0.80*scale }) + #, (Drawing, 'topmim6' , { 'color':'Blue' , 'pattern':'poids2.8' , 'threshold':0.80*scale }) + , (Drawing, 'metbot_r', { 'color':'Aqua' , 'pattern':'light_antihash0.8', 'threshold':0.80*scale }) + , (Drawing, 'cut6' , { 'color':'LightPink', 'pattern':'light_antihash1.8', 'threshold':0.80*scale }) + , (Drawing, 'metal7' , { 'color':'Green' , 'pattern':'light_antihash2.8', 'threshold':0.80*scale }) # Group: Blockages. , (Group , 'Blockages') diff --git a/crlcore/etc/common/technology.conf b/crlcore/etc/common/technology.conf index a122865e..cde97b73 100644 --- a/crlcore/etc/common/technology.conf +++ b/crlcore/etc/common/technology.conf @@ -54,7 +54,7 @@ realLayersTable = \ , ('cut7' , BasicLayer.Material.cut ) , ('metal8' , BasicLayer.Material.metal ) #, ('topmim6' , BasicLayer.Material.other ) # For Capacitances & Pads. - #, ('metbot' , BasicLayer.Material.other ) + , ('metbot_r' , BasicLayer.Material.other ) #, ('padopen' , BasicLayer.Material.other ) #, ('alucap' , BasicLayer.Material.other ) From f8b9957d20aebf081964d229c4327319e48de835 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Mon, 6 Feb 2017 20:58:57 +0100 Subject: [PATCH 2/5] Bug: reduced segments where axis was not set when placed. * Bug: In Kite::RoutingEvent::_processNegociate(), on insertion in free space of a reduced segment (less than one pitch) no insert event was generated, but the axis was not set to the selected track, leaving the segment at it's former place. Now, generate an insert event, but in Kite::Session::_revalidate() filter them so that reduced segments are not inserted in tracks but only have their axis set. Correction also applied on Katana. * Bug: In Kite::wipeoutRouting(), the removal was incomplete. We need to remove anchored Contacts, but in a second stage. This is a fragile workaround as it require that there is only one level of anchoring. --- katana/src/RoutingEvent.cpp | 3 +-- katana/src/Session.cpp | 9 +++++---- kite/src/KiteEngine.cpp | 11 +++++++++-- kite/src/RoutingEvent.cpp | 3 +-- kite/src/Session.cpp | 9 +++++---- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/katana/src/RoutingEvent.cpp b/katana/src/RoutingEvent.cpp index 1f3bbc18..77851505 100644 --- a/katana/src/RoutingEvent.cpp +++ b/katana/src/RoutingEvent.cpp @@ -476,8 +476,7 @@ namespace Katana { _axisHistory = _segment->getAxis(); _eventLevel = 0; cdebug_log(9000,0) << "Deter| addInsertEvent() @" << fsm.getCost(itrack).getTrack() << endl; - if (not _segment->isReduced()) - Session::addInsertEvent( _segment, fsm.getCost(itrack).getTrack() ); + Session::addInsertEvent( _segment, fsm.getCost(itrack).getTrack() ); fsm.setState( SegmentFsm::SelfInserted ); } else { // Do ripup. diff --git a/katana/src/Session.cpp b/katana/src/Session.cpp index 1c912158..051d168c 100644 --- a/katana/src/Session.cpp +++ b/katana/src/Session.cpp @@ -153,11 +153,12 @@ namespace Katana { _doRemovalEvents(); - for ( size_t i=0 ; i<_insertEvents.size() ; ++i ) { - if (_insertEvents[i]._segment) { - _insertEvents[i]._track->insert( _insertEvents[i]._segment ); + for ( const Event& event : _insertEvents ) { + if (event._segment) { + if (event._segment->isReduced()) event._segment->setAxis( event._track->getAxis() ); + else event._track->insert( event._segment ); } - if (_insertEvents[i]._marker) _insertEvents[i]._track->insert( _insertEvents[i]._marker ); + if (event._marker) event._track->insert( event._marker ); } _insertEvents.clear(); diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index d4fc36ef..493ef554 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -218,6 +218,7 @@ namespace Kite { UpdateSession::open(); for ( Net* net : cell->getNets() ) { + if (net->isClock() or net->isSupply()) continue; if (NetRoutingExtension::isManualGlobalRoute(net)) continue; // First pass: destroy the contacts @@ -227,8 +228,14 @@ namespace Kite { if (contact and not contact->getAnchorHook()->isAttached()) contacts.push_back( contact ); } - for ( Contact* contact : contacts ) - contact->destroy(); + for ( Contact* contact : contacts ) contact->destroy(); + + contacts.clear(); + for ( Component* component : net->getComponents() ) { + Contact* contact = dynamic_cast(component); + if (contact) contacts.push_back( contact ); + } + for ( Contact* contact : contacts ) contact->destroy(); // Second pass: destroy unconnected segments added by Knik as blockages std::vector segments; diff --git a/kite/src/RoutingEvent.cpp b/kite/src/RoutingEvent.cpp index a1c4f37c..bbe1dc27 100644 --- a/kite/src/RoutingEvent.cpp +++ b/kite/src/RoutingEvent.cpp @@ -476,8 +476,7 @@ namespace Kite { _axisHistory = _segment->getAxis(); _eventLevel = 0; cdebug_log(9000,0) << "Deter| addInsertEvent() @" << fsm.getCost(itrack).getTrack() << endl; - if (not _segment->isReduced()) - Session::addInsertEvent( _segment, fsm.getCost(itrack).getTrack() ); + Session::addInsertEvent( _segment, fsm.getCost(itrack).getTrack() ); fsm.setState( SegmentFsm::SelfInserted ); } else { // Do ripup. diff --git a/kite/src/Session.cpp b/kite/src/Session.cpp index 978d7616..930d1341 100644 --- a/kite/src/Session.cpp +++ b/kite/src/Session.cpp @@ -155,11 +155,12 @@ namespace Kite { _doRemovalEvents(); - for ( size_t i=0 ; i<_insertEvents.size() ; ++i ) { - if (_insertEvents[i]._segment) { - _insertEvents[i]._track->insert( _insertEvents[i]._segment ); + for ( const Event& event : _insertEvents ) { + if (event._segment) { + if (event._segment->isReduced()) event._segment->setAxis( event._track->getAxis() ); + else event._track->insert( event._segment ); } - if (_insertEvents[i]._marker) _insertEvents[i]._track->insert( _insertEvents[i]._marker ); + if (event._marker) event._track->insert( event._marker ); } _insertEvents.clear(); From 3598c6d8f76a780ef9b96ef5f499b8ca296a5fa6 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Mon, 6 Feb 2017 21:59:15 +0100 Subject: [PATCH 3/5] Disjksta::setDistance() now return a pointer to the copied object. * Change: In Anabatic::Dijkstra the _distanceCb attribute got copied from the setDistance() argument. To be able to access the duplicated distance (and therefore access/modify it) the function now return a pointer to it. Done with the "target()" accessor of std::function<>. * Change: In Katana::GlobalRouting::runGlobalRouter() use the new Disjkstra::setDistance() to be able to call setNet() on the right object. --- anabatic/src/anabatic/Dijkstra.h | 6 ++++-- katana/src/GlobalRoute.cpp | 10 +++++----- katana/src/RoutingEvent.cpp | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/anabatic/src/anabatic/Dijkstra.h b/anabatic/src/anabatic/Dijkstra.h index 35982112..6ffa4224 100644 --- a/anabatic/src/anabatic/Dijkstra.h +++ b/anabatic/src/anabatic/Dijkstra.h @@ -295,7 +295,8 @@ namespace Anabatic { inline bool isSourceVertex ( Vertex* ) const; inline bool isTargetVertex ( Vertex* ) const; inline DbU::Unit getSearchAreaHalo () const; - inline void setDistance ( distance_t ); + template + inline DistanceT* setDistance ( DistanceT ); inline void setSearchAreaHalo ( DbU::Unit ); void load ( Net* ); void run ( Mode mode=Mode::Standart ); @@ -335,9 +336,10 @@ namespace Anabatic { inline bool Dijkstra::isSourceVertex ( Vertex* v ) const { return (_sources.find(v) != _sources.end()); } inline bool Dijkstra::isTargetVertex ( Vertex* v ) const { return (_targets.find(v) != _targets.end()); } inline DbU::Unit Dijkstra::getSearchAreaHalo () const { return _searchAreaHalo; } - inline void Dijkstra::setDistance ( distance_t cb ) { _distanceCb = cb; } inline void Dijkstra::setSearchAreaHalo ( DbU::Unit halo ) { _searchAreaHalo = halo; } + template + inline DistanceT* Dijkstra::setDistance ( DistanceT cb ) { _distanceCb = cb; return _distanceCb.target(); } } // Anabatic namespace. diff --git a/katana/src/GlobalRoute.cpp b/katana/src/GlobalRoute.cpp index 27fc582f..a5758363 100644 --- a/katana/src/GlobalRoute.cpp +++ b/katana/src/GlobalRoute.cpp @@ -154,10 +154,10 @@ namespace Katana { float edgeHInc = getConfiguration()->getEdgeHInc(); openSession(); - Dijkstra* dijkstra = new Dijkstra ( this ); - DigitalDistance distance ( getConfiguration()->getEdgeCostH() - , getConfiguration()->getEdgeCostK() ); - dijkstra->setDistance( distance ); + Dijkstra* dijkstra = new Dijkstra ( this ); + DigitalDistance* distance = + dijkstra->setDistance( DigitalDistance( getConfiguration()->getEdgeCostH() + , getConfiguration()->getEdgeCostK() )); size_t iteration = 0; size_t netCount = 0; @@ -168,7 +168,7 @@ namespace Katana { for ( NetData* netData : getNetOrdering() ) { if (netData->isGlobalRouted()) continue; - distance.setNet( netData->getNet() ); + distance->setNet( netData->getNet() ); dijkstra->load( netData->getNet() ); dijkstra->run(); ++netCount; diff --git a/katana/src/RoutingEvent.cpp b/katana/src/RoutingEvent.cpp index 77851505..79c9dfc4 100644 --- a/katana/src/RoutingEvent.cpp +++ b/katana/src/RoutingEvent.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- +// -*- mode: C++; explicit-buffer-name: "RoutingEvent.cpp" -*- // // This file is part of the Coriolis Software. // Copyright (c) UPMC 2008-2016, All Rights Reserved From aaeeef0097c7cb5393a200ca0066f3a5760513bc Mon Sep 17 00:00:00 2001 From: "Jean-Paul Chaput (acting Coriolis)" Date: Wed, 8 Feb 2017 18:24:13 +0100 Subject: [PATCH 4/5] In 32 bits, do not throw errors when DbU exceed 32 bits. --- hurricane/src/isobar/hurricane/isobar/PyHurricane.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hurricane/src/isobar/hurricane/isobar/PyHurricane.h b/hurricane/src/isobar/hurricane/isobar/PyHurricane.h index e01b91c6..aa1e266c 100644 --- a/hurricane/src/isobar/hurricane/isobar/PyHurricane.h +++ b/hurricane/src/isobar/hurricane/isobar/PyHurricane.h @@ -136,11 +136,11 @@ namespace Isobar { if (PyObject_IsInstance(object,(PyObject*)&PyInt_Type )) value = PyInt_AsLong ( object ); else if (PyObject_IsInstance(object,(PyObject*)&PyLong_Type)) value = PyLong_AsLongLong( object ); - if (value > numeric_limits::max()) { - throw Error( "PyAny_AsLong(): Suspiciously big int %s, db:%li" - , DbU::getValueString(value).c_str(), value - ); - } + //if (value > numeric_limits::max()) { + // throw Error( "PyAny_AsLong(): Suspiciously big int %s, db:%lli" + // , DbU::getValueString(value).c_str(), value + // ); + //} return value; } From 3777c34834cf65fca84384dc982b83483761f1a7 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 8 Feb 2017 18:26:20 +0100 Subject: [PATCH 5/5] Bug: bad managment of the csh case. --- bootstrap/coriolisEnv.py | 52 ++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/bootstrap/coriolisEnv.py b/bootstrap/coriolisEnv.py index b6ba9261..8bfc0f9c 100755 --- a/bootstrap/coriolisEnv.py +++ b/bootstrap/coriolisEnv.py @@ -129,7 +129,27 @@ def guessOs (): libDir = 'lib' return (osType,libDir,useDevtoolset2) - + + +def guessCsh (): + cshBins = [ '/usr/bin/tcsh' + , '/bin/tcsh' + , '/usr/pkg/bin/tcsh' + , '/usr/bin/csh' + , '/bin/csh' + , '/usr/pkg/bin/csh' + ] + for cshBin in cshBins: + if os.path.isfile(cshBin): return cshBin + return None + + +def guessShell (): + if os.environ.has_key('SHELL'): return os.environ['SHELL'] + + # If SHELL is not set, it is likely we are under C-Shell variant. + # Look for standard places where the binaries are expecteds. + return guessCsh() @@ -139,6 +159,7 @@ if __name__ == "__main__": buildType = "Release" linkType = "Shared" rootDir = None + shellBin = guessShell() parser = optparse.OptionParser () # Build relateds. @@ -155,12 +176,17 @@ if __name__ == "__main__": parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" ) ( options, args ) = parser.parse_args () - if options.release: buildType = "Release" - if options.debug: buildType = "Debug" - if options.devel: buildType = "Debug" - if options.static: linkType = "Static" - if options.shared: linkType = "Shared" - if options.rootDir: rootDir = options.rootDir + if options.csh: shellBin = guessCsh() + if options.release: buildType = "Release" + if options.debug: buildType = "Debug" + if options.devel: buildType = "Debug" + if options.static: linkType = "Static" + if options.shared: linkType = "Shared" + if options.rootDir: rootDir = options.rootDir + + if not shellBin: + print 'echo "[ERROR] coriolisEnv.py was not able to guess/find the current shell interpeter."' + sys.exit( 1 ) strippedPath = stripPath ( "PATH" ) strippedLibraryPath = stripPath ( "LD_LIBRARY_PATH" ) @@ -246,11 +272,11 @@ if __name__ == "__main__": if osType == "Darwin": shellScriptSh += 'DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";' \ 'export DYLD_LIBRARY_PATH;' - shellScriptCsh += 'setenv DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";' + shellScriptCsh += 'setenv DYLD_LIBRARY_PATH "%(LD_LIBRARY_PATH)s";' else: shellScriptSh += 'LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";' \ 'export LD_LIBRARY_PATH;' - shellScriptCsh += 'setenv LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";' + shellScriptCsh += 'setenv LD_LIBRARY_PATH "%(LD_LIBRARY_PATH)s";' shellScriptSh += "hash -r;" shellScriptCsh += "rehash;" @@ -258,6 +284,9 @@ if __name__ == "__main__": if options.csh: shellScript = shellScriptCsh else: shellScript = shellScriptSh + if useDevtoolset2: + shellScript += ' scl enable devtoolset-2 %(SHELL)s' + evalScript = shellScript % { "PATH" : strippedPath , "LD_LIBRARY_PATH" : strippedLibraryPath , "PYTHONPATH" : strippedPythonPath @@ -266,10 +295,8 @@ if __name__ == "__main__": , "SYSCONF_DIR" : sysconfDir , "MESSAGE" : shellMessage , "buildDir" : buildDir + , 'SHELL' : shellBin } - if useDevtoolset2: - evalScript = '%s scl enable devtoolset-2 ${SHELL}' % evalScript - if options.queryISysRoot: print '%s/%s' % (rootDir,osType) sys.exit( 0 ) @@ -279,3 +306,4 @@ if __name__ == "__main__": sys.exit( 0 ) print evalScript + sys.exit( 0 )