From 757451b324beaa8b3d17c51b2d7a4c837fe68f70 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 6 Jan 2018 17:08:38 +0100 Subject: [PATCH] Upgrade of Katana for support of real technologies. * Bug: In Katana::PreProcess::protectCagedTerminals(), the contacts of the fixed segment must be fixed too. * Change: In Katana::RoutingPlane constructor, more accurate computation of the extensionCap (for real technologies). * Bug: In Katana::DataNegociate::update(), the perpandicular free interval must be shrunk of the extensionCap of the perpandicular layer. This problem did show with metal1 "half-offgrid" terminals. * Change: In Katana::runGlobalRouter(), increase the number of ripup passes to ten. Display the overloaded edges and the related nets. --- katana/src/DataNegociate.cpp | 2 +- katana/src/GlobalRoute.cpp | 68 +++++++++++++++++++++----------- katana/src/NegociateWindow.cpp | 2 +- katana/src/PreProcess.cpp | 4 +- katana/src/RoutingPlane.cpp | 13 +++--- katana/src/TrackElement.cpp | 1 + katana/src/TrackSegment.cpp | 1 + katana/src/katana/TrackElement.h | 1 + katana/src/katana/TrackSegment.h | 1 + 9 files changed, 59 insertions(+), 34 deletions(-) diff --git a/katana/src/DataNegociate.cpp b/katana/src/DataNegociate.cpp index 4de6d02c..b3e54ac3 100644 --- a/katana/src/DataNegociate.cpp +++ b/katana/src/DataNegociate.cpp @@ -145,7 +145,7 @@ namespace Katana { Interval trackFree = perpandicular->getFreeInterval(); cdebug_log(159,0) << "Track Perpandicular Free: " << trackFree << endl; - _perpandicularFree.intersection( trackFree ); + _perpandicularFree.intersection( trackFree.inflate(-perpandicular->getExtensionCap()) ); } else { cdebug_log(159,0) << "Not in any track " << perpandicular << endl; } diff --git a/katana/src/GlobalRoute.cpp b/katana/src/GlobalRoute.cpp index daea3414..5fc559bc 100644 --- a/katana/src/GlobalRoute.cpp +++ b/katana/src/GlobalRoute.cpp @@ -27,6 +27,7 @@ namespace { using std::cerr; using std::endl; + using std::dec; using std::setw; using std::setfill; using std::left; @@ -76,17 +77,18 @@ namespace { viaCost += 2.5; } - float distance = (float)source->getDistance() - + (congestionCost + viaCost) * (float)edge->getDistance() - + edge->getHistoricCost(); + float hvDistort = (edge->isHorizontal()) ? 1.0 : 1.0 ; + float distance = (float)source->getDistance() + + (congestionCost + viaCost) * (float)edge->getDistance() * hvDistort + + edge->getHistoricCost(); // Edge* sourceFrom = source->getFrom(); // if (sourceFrom) { // distance += ((sourceFrom->isHorizontal() xor edge->isHorizontal()) ? 3.0 : 0.0) * (float)Edge::unity; // } - cdebug_log(112,0) << "cong:" << congestion - << " ccost:" << congestionCost - << " digitalDistance:" << DbU::getValueString((DbU::Unit)distance) << endl; + // cdebug_log(112,0) << "cong:" << congestion + // << " ccost:" << congestionCost + // << " digitalDistance:" << DbU::getValueString((DbU::Unit)distance) << endl; return (DbU::Unit)distance; } @@ -185,10 +187,11 @@ namespace Katana { float edgeHInc = getConfiguration()->getEdgeHInc(); openSession(); - Dijkstra* dijkstra = new Dijkstra ( this ); - DigitalDistance* distance = + Dijkstra* dijkstra = new Dijkstra ( this ); + DigitalDistance* distance = dijkstra->setDistance( DigitalDistance( getConfiguration()->getEdgeCostH() , getConfiguration()->getEdgeCostK() )); + const vector& ovEdges = getOvEdges(); if (isChannelMode()) dijkstra->setSearchAreaHalo( Session::getSliceHeight()*2 ); @@ -208,29 +211,32 @@ namespace Katana { ++netCount; } cmess2 << left << setw(6) << netCount; - - const vector& ovEdges = getOvEdges(); cmess2 << " ovEdges:" << setw(4) << ovEdges.size(); for ( Edge* edge : ovEdges ) computeNextHCost( edge, edgeHInc ); + // Session::close(); + // Breakpoint::stop( 1, "Before riping up overflowed edges." ); + // openSession(); netCount = 0; - size_t iEdge = 0; - while ( iEdge < ovEdges.size() ) { - Edge* edge = ovEdges[iEdge]; - netCount += edge->ripup(); + if (iteration < 10 - 1) { + size_t iEdge = 0; + while ( iEdge < ovEdges.size() ) { + Edge* edge = ovEdges[iEdge]; + netCount += edge->ripup(); - if (ovEdges.empty()) break; - if (ovEdges[iEdge] == edge) { - cerr << Error( "AnabaticEngine::globalRoute(): Unable to ripup enough segments of edge:\n" + if (ovEdges.empty()) break; + if (ovEdges[iEdge] == edge) { + cerr << Error( "AnabaticEngine::globalRoute(): Unable to ripup enough segments of edge:\n" " %s" - , getString(edge).c_str() - ) << endl; - ++iEdge; + , getString(edge).c_str() + ) << endl; + ++iEdge; + } } - } - dijkstra->setSearchAreaHalo( Session::getSliceHeight()*3 ); + dijkstra->setSearchAreaHalo( Session::getSliceHeight()*3 ); + } cmess2 << " ripup:" << setw(4) << netCount << right; suspendMeasures(); @@ -239,11 +245,27 @@ namespace Katana { resumeMeasures(); ++iteration; - } while ( (netCount > 0) and (iteration < 5) ); + } while ( (netCount > 0) and (iteration < 10) ); stopMeasures(); printMeasures( "Dijkstra" ); + if (not ovEdges.empty()) { + set< const Net*, Net::CompareByName > nets; + + cerr << " o Global routing did not complete, overflowed edges:" << endl; + for ( size_t iEdge = 0 ; iEdgegetSegments() ) + nets.insert( segment->getNet() ); + } + + cerr << " o Conflicting nets:" << endl; + size_t count = 0; + for ( const Net* net : nets ) + cerr << " " << dec << setw(4) << (++count) << "| " << net->getName() << endl; + } + if (getBlock(0)) { getBlock(0)->resizeChannels(); _resizeMatrix(); diff --git a/katana/src/NegociateWindow.cpp b/katana/src/NegociateWindow.cpp index 501a0d69..fd6bc99d 100644 --- a/katana/src/NegociateWindow.cpp +++ b/katana/src/NegociateWindow.cpp @@ -617,7 +617,7 @@ namespace Katana { } Session::revalidate(); _computePriorities(); - + if (not (flags & Flags::PreRoutedStage)) { _katana->preProcess(); Session::revalidate(); diff --git a/katana/src/PreProcess.cpp b/katana/src/PreProcess.cpp index 163bb0e6..9bd9b72f 100644 --- a/katana/src/PreProcess.cpp +++ b/katana/src/PreProcess.cpp @@ -299,7 +299,7 @@ namespace { , rp->getSourcePosition() , DbU::fromLambda(1.0), DbU::fromLambda(1.0) ); - source->setFlags( Anabatic::CntIgnoreAnchor ); + source->setFlags( Anabatic::CntIgnoreAnchor|Anabatic::CntFixed ); Anabatic::AutoContact* target = Anabatic::AutoContactTerminal::create( support->getGCell() @@ -308,7 +308,7 @@ namespace { , rp->getSourcePosition() , DbU::fromLambda(1.0), DbU::fromLambda(1.0) ); - target->setFlags( Anabatic::CntIgnoreAnchor ); + target->setFlags( Anabatic::CntIgnoreAnchor|Anabatic::CntFixed ); AutoSegment* fixedSegment = AutoSegment::create( source, target, Flags::Vertical ); fixedSegment->setFlags( AutoSegment::SegFixed ); diff --git a/katana/src/RoutingPlane.cpp b/katana/src/RoutingPlane.cpp index 53a47905..0605e45e 100644 --- a/katana/src/RoutingPlane.cpp +++ b/katana/src/RoutingPlane.cpp @@ -100,22 +100,21 @@ namespace Katana { uint32_t gaugeDepth = 0; if (Session::getLayerGauge(gaugeDepth)->getType() == Constant::PinOnly) ++gaugeDepth; - bool HV = (Session::getLayerGauge(gaugeDepth)->getDirection() == Constant::Horizontal); - hExtension = Session::getLayerGauge( gaugeDepth + (HV?1:0) )->getPitch() / 2; - vExtension = Session::getLayerGauge( gaugeDepth + (HV?0:1) )->getPitch() / 2; + DbU::Unit extensionCap = ( std::max( Session::getWireWidth(depth), Session::getViaWidth(depth) ) + + Session::getPitch(depth) ) / 2; size_t trackNumber; Box abutmentBox = katana->getCell()->getAbutmentBox(); // HARD CODED. if (plane->getDirection() == Flags::Horizontal) { - plane->_trackMin = abutmentBox.getXMin() - hExtension; - plane->_trackMax = abutmentBox.getXMax() + hExtension; + plane->_trackMin = abutmentBox.getXMin() - extensionCap; + plane->_trackMax = abutmentBox.getXMax() + extensionCap; plane->_axisMin = abutmentBox.getYMin(); plane->_axisMax = abutmentBox.getYMax(); trackNumber = plane->computeTracksSize(); } else { - plane->_trackMin = abutmentBox.getYMin() - vExtension; - plane->_trackMax = abutmentBox.getYMax() + vExtension; + plane->_trackMin = abutmentBox.getYMin() - extensionCap; + plane->_trackMax = abutmentBox.getYMax() + extensionCap; plane->_axisMin = abutmentBox.getXMin(); plane->_axisMax = abutmentBox.getXMax(); trackNumber = plane->computeTracksSize(); diff --git a/katana/src/TrackElement.cpp b/katana/src/TrackElement.cpp index f67f9122..a6b01357 100644 --- a/katana/src/TrackElement.cpp +++ b/katana/src/TrackElement.cpp @@ -161,6 +161,7 @@ namespace Katana { uint32_t TrackElement::getTrackCount () const { return 0; } DbU::Unit TrackElement::getPitch () const { return 0; } DbU::Unit TrackElement::getPPitch () const { return 0; } + DbU::Unit TrackElement::getExtensionCap () const { return 0; } float TrackElement::getMaxUnderDensity ( Flags ) const { return 0.0; }; uint32_t TrackElement::getDoglegLevel () const { return 0; } TrackElement* TrackElement::getParent () const { return NULL; } diff --git a/katana/src/TrackSegment.cpp b/katana/src/TrackSegment.cpp index 8b04d373..940d7e2e 100644 --- a/katana/src/TrackSegment.cpp +++ b/katana/src/TrackSegment.cpp @@ -180,6 +180,7 @@ namespace Katana { const Layer* TrackSegment::getLayer () const { return _base->getLayer(); } DbU::Unit TrackSegment::getPitch () const { return _base->getPitch(); } DbU::Unit TrackSegment::getPPitch () const { return _ppitch; } + DbU::Unit TrackSegment::getExtensionCap () const { return _base->getExtensionCap(); } DbU::Unit TrackSegment::getAxis () const { return _base->getAxis(); } unsigned long TrackSegment::getFreedomDegree () const { return _freedomDegree; } float TrackSegment::getPriority () const { return _priority; } diff --git a/katana/src/katana/TrackElement.h b/katana/src/katana/TrackElement.h index 35a67b1a..ca063725 100644 --- a/katana/src/katana/TrackElement.h +++ b/katana/src/katana/TrackElement.h @@ -150,6 +150,7 @@ namespace Katana { inline Box getBoundingBox () const; virtual TrackElement* getNext () const; virtual TrackElement* getPrevious () const; + virtual DbU::Unit getExtensionCap () const; virtual DbU::Unit getAxis () const = 0; inline DbU::Unit getSymmetricAxis ( DbU::Unit ) const; inline DbU::Unit getSourceU () const; diff --git a/katana/src/katana/TrackSegment.h b/katana/src/katana/TrackSegment.h index bcf0886a..a255eb86 100644 --- a/katana/src/katana/TrackSegment.h +++ b/katana/src/katana/TrackSegment.h @@ -96,6 +96,7 @@ namespace Katana { virtual const Layer* getLayer () const; virtual DbU::Unit getPitch () const; virtual DbU::Unit getPPitch () const; + virtual DbU::Unit getExtensionCap () const; virtual unsigned long getFreedomDegree () const; virtual float getPriority () const; virtual uint32_t getDoglegLevel () const;