From 2dd36b96246712723e01f263f45eea3aa331ca94 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Mon, 19 May 2014 17:58:38 +0200 Subject: [PATCH] Support of RoutingGauge, part 2. In Katabatic & Kite, remove all hard-coded values related to track pitches. * New: In , add more convenience function to access RoutingGauge characteristics. * New: In , , add support for the "depth spin", that is, if the source/target contacts are going "top" or "down". Used to compute the perpandicular pitch. Need a small modification of the revalidation mechanism. The observers of are notified when the spin changes. * New: In , the getPPitch() method allow to compute the "perpandicular pitch". For now it is simply the greatest from the source perpandicular pitch and the target perpandicular pitch. Make uses of the "depth spin". * New: In , , cache the perpandicular pitch. Updated through the notification from the observable. --- crlcore/src/ccore/crlcore/CellGauge.h | 1 - katabatic/doc/AutoSegment.dox | 12 ++ katabatic/doc/Constants.dox | 10 +- katabatic/doc/SoC.css | 2 +- katabatic/src/AutoContact.cpp | 55 +++--- katabatic/src/AutoContactHTee.cpp | 4 +- katabatic/src/AutoContactTerminal.cpp | 6 +- katabatic/src/AutoContactTurn.cpp | 3 +- katabatic/src/AutoContactVTee.cpp | 4 +- katabatic/src/AutoHorizontal.cpp | 27 +-- katabatic/src/AutoSegment.cpp | 176 +++++++++++++++--- katabatic/src/AutoSegments.cpp | 7 +- katabatic/src/AutoVertical.cpp | 25 +-- katabatic/src/ChipTools.cpp | 49 ++--- katabatic/src/Configuration.cpp | 62 ++++-- katabatic/src/GCell.cpp | 15 +- katabatic/src/KatabaticEngine.cpp | 4 +- katabatic/src/LayerAssign.cpp | 2 +- katabatic/src/LoadGrByNet.cpp | 2 +- katabatic/src/Session.cpp | 5 +- katabatic/src/katabatic/AutoContact.h | 3 +- katabatic/src/katabatic/AutoContactTerminal.h | 3 +- katabatic/src/katabatic/AutoSegment.h | 79 +++++--- katabatic/src/katabatic/AutoSegments.h | 3 +- katabatic/src/katabatic/ChipTools.h | 3 + katabatic/src/katabatic/Configuration.h | 13 +- katabatic/src/katabatic/Constants.h | 9 +- katabatic/src/katabatic/GridBox.h | 11 +- katabatic/src/katabatic/KatabaticEngine.h | 2 + katabatic/src/katabatic/Observer.h | 2 +- katabatic/src/katabatic/Session.h | 8 + kite/src/BuildPowerRails.cpp | 67 ++++++- kite/src/Configuration.cpp | 12 ++ kite/src/DataNegociate.cpp | 2 +- kite/src/GraphicKiteEngine.cpp | 2 - kite/src/KiteEngine.cpp | 17 +- kite/src/KiteMain.cpp | 3 +- kite/src/Manipulator.cpp | 35 ++-- kite/src/PreProcess.cpp | 24 +-- kite/src/ProtectRoutingPads.cpp | 5 +- kite/src/RoutingEvent.cpp | 10 +- kite/src/RoutingPlane.cpp | 20 +- kite/src/SegmentFsm.cpp | 12 +- kite/src/Session.cpp | 6 +- kite/src/Track.cpp | 3 +- kite/src/TrackCost.cpp | 14 +- kite/src/TrackElement.cpp | 35 ++-- kite/src/TrackMarker.cpp | 10 +- kite/src/TrackSegment.cpp | 24 ++- kite/src/TrackSegmentCost.cpp | 3 +- kite/src/kite/Configuration.h | 4 + kite/src/kite/Constants.h | 6 +- kite/src/kite/Manipulator.h | 6 +- kite/src/kite/Session.h | 2 +- kite/src/kite/TrackElement.h | 6 +- kite/src/kite/TrackSegment.h | 17 +- mauka/src/Configuration.cpp | 15 +- 57 files changed, 659 insertions(+), 308 deletions(-) diff --git a/crlcore/src/ccore/crlcore/CellGauge.h b/crlcore/src/ccore/crlcore/CellGauge.h index 1ab2b9b2..fd63b606 100644 --- a/crlcore/src/ccore/crlcore/CellGauge.h +++ b/crlcore/src/ccore/crlcore/CellGauge.h @@ -1,4 +1,3 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. diff --git a/katabatic/doc/AutoSegment.dox b/katabatic/doc/AutoSegment.dox index e0177f1e..3e6daeaa 100644 --- a/katabatic/doc/AutoSegment.dox +++ b/katabatic/doc/AutoSegment.dox @@ -185,6 +185,18 @@ //! This AutoSegment has been created to to reconnect parts of an AutoSegment //! after slackening. + //! \var AutoSegmentFlag::SegSourceTop + //! The source contact of this segment is connected to the top layer. + + //! \var AutoSegmentFlag::SegSourceBottom + //! The source contact of this segment is connected to the bottom layer. + + //! \var AutoSegmentFlag::SegTargetTop + //! The target contact of this segment is connected to the top layer. + + //! \var AutoSegmentFlag::SegTargetBottom + //! The target contact of this segment is connected to the bottom layer. + //! \var AutoSegmentFlag::SegLayerChange //! This AutoSegment has been created to to reconnect parts of an AutoSegment //! after a layer change. diff --git a/katabatic/doc/Constants.dox b/katabatic/doc/Constants.dox index 30235646..ae66a706 100644 --- a/katabatic/doc/Constants.dox +++ b/katabatic/doc/Constants.dox @@ -31,11 +31,13 @@ //! \var KbWithPerpands //! Request that AutoSegments in perpandicular direction should be includeds. - //! \var KbBySource - //! Request AutoSegments anchored by their source anchor. + //! \var KbSource + //! Request AutoSegments anchored by their source anchor or that some + //! operation has to be performed on the source. - //! \var KbByTarget - //! Request AutoSegments anchored by their target anchor. + //! \var KbTarget + //! Request AutoSegments anchored by their target anchor or that some + //! operation has to be performed on the target. //! \var KbWarnOnError //! Display a warning if something has gone wrong. diff --git a/katabatic/doc/SoC.css b/katabatic/doc/SoC.css index fccd7194..98351ca2 100644 --- a/katabatic/doc/SoC.css +++ b/katabatic/doc/SoC.css @@ -286,7 +286,7 @@ border: 2px solid black; } - div.center { + div.center, div.image { text-align: center; } diff --git a/katabatic/src/AutoContact.cpp b/katabatic/src/AutoContact.cpp index 79b91d71..89335823 100644 --- a/katabatic/src/AutoContact.cpp +++ b/katabatic/src/AutoContact.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 | @@ -30,7 +29,6 @@ #include "hurricane/RoutingPad.h" #include "hurricane/Vertical.h" #include "hurricane/Horizontal.h" -#include "hurricane/UpdateSession.h" #include "hurricane/DebugSession.h" #include "crlcore/RoutingGauge.h" #include "katabatic/AutoContact.h" @@ -90,10 +88,10 @@ namespace Katabatic { restoreNativeConstraintBox(); ltrace(90) << "Native CBox: " << this - << " <" << DbU::getLambda(getCBXMin()) - << " " << DbU::getLambda(getCBYMin()) - << " " << DbU::getLambda(getCBXMax()) - << " " << DbU::getLambda(getCBYMax()) << ">" << endl; + << " <" << DbU::toLambda(getCBXMin()) + << " " << DbU::toLambda(getCBYMin()) + << " " << DbU::toLambda(getCBXMax()) + << " " << DbU::toLambda(getCBYMax()) << ">" << endl; Session::link( this ); invalidate( KbTopology ); @@ -212,6 +210,9 @@ namespace Katabatic { void AutoContact::getLengths ( DbU::Unit* lengths, AutoSegment::DepthLengthSet& processeds ) { + DbU::Unit hSideLength = getGCell()->getSide( KbHorizontal ).getSize(); + DbU::Unit vSideLength = getGCell()->getSide( KbVertical ).getSize(); + forEach ( AutoSegment*, isegment, getAutoSegments() ) { bool isSourceHook = (isegment->getAutoSource() == this); @@ -223,9 +224,11 @@ namespace Katabatic { if (isegment->isLocal()) { length = isegment->getLength(); lengths[depth] += length; - if ( not isegment->isUnbound() and (abs(length) > DbU::lambda(50.0)) ) + + DbU::Unit sideLength = (isegment->isHorizontal()) ? hSideLength : vSideLength; + if ( not isegment->isUnbound() and (abs(length) > sideLength) ) cerr << Error("Suspicious length:%.2f of %s." - ,DbU::getLambda(length),getString(*isegment).c_str()) << endl; + ,DbU::toLambda(length),getString(*isegment).c_str()) << endl; } else { if ( isegment->isHorizontal() ) { if ( isSourceHook ) @@ -249,20 +252,28 @@ namespace Katabatic { Interval AutoContact::getNativeUConstraints ( unsigned int direction ) const { - Box nativeConstraints = getNativeConstraintBox(); + Box nativeConstraints = getNativeConstraintBox(); + Interval constraint; if (direction & KbHorizontal) { - return Interval( nativeConstraints.getXMin(), nativeConstraints.getXMax() ); + constraint = Interval( nativeConstraints.getXMin(), nativeConstraints.getXMax() ); + } else { + constraint = Interval( nativeConstraints.getYMin(), nativeConstraints.getYMax() ); } - return Interval( nativeConstraints.getYMin(), nativeConstraints.getYMax() ); + if (direction & KbNoGCellShrink) constraint.inflate( 0, GCell::getTopRightShrink() ); + return constraint; } Interval AutoContact::getUConstraints ( unsigned int direction ) const { + Interval constraint; if (direction & KbHorizontal) { - return Interval( getCBXMin(), getCBXMax() ); + constraint = Interval( getCBXMin(), getCBXMax() ); + } else { + constraint = Interval( getCBYMin(), getCBYMax() ); } - return Interval( getCBYMin(), getCBYMax() ); + if (direction & KbNoGCellShrink) constraint.inflate( 0, GCell::getTopRightShrink() ); + return constraint; } @@ -429,13 +440,13 @@ namespace Katabatic { cerr << Error ( "Incompatible DY restriction on %s", _getString().c_str() ) << endl; if ( constraintMin > getCBYMax() ) cerr << Error ( "(constraintMin > CBYMax : %.2lf > %.2lf)" - , DbU::getLambda(constraintMin) - , DbU::getLambda(getCBYMax()) ) + , DbU::toLambda(constraintMin) + , DbU::toLambda(getCBYMax()) ) << endl; if ( constraintMax < getCBYMin() ) cerr << Error ( "(constraintMax < CBYMin : %.2lf < %.2lf)" - , DbU::getLambda(constraintMax) - , DbU::getLambda(getCBYMin()) ) + , DbU::toLambda(constraintMax) + , DbU::toLambda(getCBYMin()) ) << endl; return false; } @@ -448,13 +459,13 @@ namespace Katabatic { cerr << Error ( "Incompatible DX restriction on %s", _getString().c_str() ) << endl; if ( constraintMin > getCBXMax() ) cerr << Error ( "(constraintMin > CBXMax : %.2lf > %.2lf)" - , DbU::getLambda(constraintMin) - , DbU::getLambda(getCBXMax()) ) + , DbU::toLambda(constraintMin) + , DbU::toLambda(getCBXMax()) ) << endl; if ( constraintMax < getCBXMin() ) cerr << Error ( "(constraintMax < CBXMin : %.2lf < %.2lf)" - , DbU::getLambda(constraintMax) - , DbU::getLambda(getCBXMin()) ) + , DbU::toLambda(constraintMax) + , DbU::toLambda(getCBXMin()) ) << endl; return false; } diff --git a/katabatic/src/AutoContactHTee.cpp b/katabatic/src/AutoContactHTee.cpp index 9dc62ebd..687ae475 100644 --- a/katabatic/src/AutoContactHTee.cpp +++ b/katabatic/src/AutoContactHTee.cpp @@ -28,7 +28,6 @@ #include "hurricane/Plug.h" #include "hurricane/Vertical.h" #include "hurricane/Horizontal.h" -#include "hurricane/UpdateSession.h" #include "hurricane/DebugSession.h" #include "crlcore/RoutingGauge.h" #include "katabatic/AutoContactHTee.h" @@ -304,6 +303,9 @@ namespace Katabatic { } } } + _horizontal1->invalidate( this ); + _horizontal2->invalidate( this ); + _vertical1 ->invalidate( this ); ltraceout(110); DebugSession::close(); diff --git a/katabatic/src/AutoContactTerminal.cpp b/katabatic/src/AutoContactTerminal.cpp index ac251e26..23e4cd0f 100644 --- a/katabatic/src/AutoContactTerminal.cpp +++ b/katabatic/src/AutoContactTerminal.cpp @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2012-2013, All Rights Reserved +// Copyright (c) UPMC 2012-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -30,7 +29,6 @@ #include "hurricane/RoutingPad.h" #include "hurricane/Vertical.h" #include "hurricane/Horizontal.h" -#include "hurricane/UpdateSession.h" #include "hurricane/DebugSession.h" #include "crlcore/RoutingGauge.h" #include "katabatic/AutoContactTerminal.h" @@ -265,7 +263,6 @@ namespace Katabatic { throw Error( os.str() ); } unsetFlags( CntInvalidatedCache ); - ltrace(110) << "seg:" << _segment << endl; delete [] horizontals; @@ -354,6 +351,7 @@ namespace Katabatic { else if (delta == 0) setLayer( rg->getRoutingLayer(anchorDepth) ); else if (delta == 1) setLayer( rg->getContactLayer(std::min(anchorDepth,segmentDepth)) ); } + _segment->invalidate( this ); ltraceout(110); DebugSession::close(); diff --git a/katabatic/src/AutoContactTurn.cpp b/katabatic/src/AutoContactTurn.cpp index cd657c91..6affe780 100644 --- a/katabatic/src/AutoContactTurn.cpp +++ b/katabatic/src/AutoContactTurn.cpp @@ -28,7 +28,6 @@ #include "hurricane/Plug.h" #include "hurricane/Vertical.h" #include "hurricane/Horizontal.h" -#include "hurricane/UpdateSession.h" #include "hurricane/DebugSession.h" #include "crlcore/RoutingGauge.h" #include "katabatic/AutoContactTurn.h" @@ -251,6 +250,8 @@ namespace Katabatic { setLayer ( (delta == 0) ? rg->getRoutingLayer(depthContact) : rg->getContactLayer(depthContact) ); } } + _horizontal1->invalidate( this ); + _vertical1 ->invalidate( this ); ltraceout(110); DebugSession::close (); diff --git a/katabatic/src/AutoContactVTee.cpp b/katabatic/src/AutoContactVTee.cpp index 33915ce1..842862b0 100644 --- a/katabatic/src/AutoContactVTee.cpp +++ b/katabatic/src/AutoContactVTee.cpp @@ -28,7 +28,6 @@ #include "hurricane/Plug.h" #include "hurricane/Vertical.h" #include "hurricane/Horizontal.h" -#include "hurricane/UpdateSession.h" #include "hurricane/DebugSession.h" #include "crlcore/RoutingGauge.h" #include "katabatic/AutoContactVTee.h" @@ -289,6 +288,9 @@ namespace Katabatic { } } } + _horizontal1->invalidate( this ); + _vertical1 ->invalidate( this ); + _vertical2 ->invalidate( this ); ltraceout(110); DebugSession::close (); diff --git a/katabatic/src/AutoHorizontal.cpp b/katabatic/src/AutoHorizontal.cpp index 8679a658..a03b6c14 100644 --- a/katabatic/src/AutoHorizontal.cpp +++ b/katabatic/src/AutoHorizontal.cpp @@ -231,9 +231,6 @@ namespace Katabatic { Interval sourceConstraints = Interval(getAutoSource()->getCBYMin(),getAutoSource()->getCBYMax()); Interval targetConstraints = Interval(getAutoTarget()->getCBYMin(),getAutoTarget()->getCBYMax()); - // Ugly: should uses topRightShrink from GCell. - //sourceConstraints.inflate( 0, /*Katabatic::GCell::getTopRightShrink()*/ DbU::lambda(1.0) ); - //targetConstraints.inflate( 0, /*Katabatic::GCell::getTopRightShrink()*/ DbU::lambda(1.0) ); // Expand by a tiny amount for the "contains" to work for sure. sourceConstraints.inflate( 1 ); targetConstraints.inflate( 1 ); @@ -245,9 +242,6 @@ namespace Katabatic { ltrace(200) << "target constraints: " << targetConstraints << " " << DbU::getValueString(targetConstraints.getSize()) << endl; - // Ugly: GCell's track number is hardwired. - //if (sourceConstraints.getSize() / DbU::lambda(5.0) < 10) { ltraceout(200); return true; } - //if (targetConstraints.getSize() / DbU::lambda(5.0) < 10) { ltraceout(200); return true; } if (not sourceConstraints.contains(sourceSide)) { ltraceout(200); return true; } if (not targetConstraints.contains(targetSide)) { ltraceout(200); return true; } @@ -298,8 +292,8 @@ namespace Katabatic { if (source->isTerminal()) { Interval perpandConstraints = getAutoTarget()->getUConstraints(KbHorizontal); - Interval constraints = source->getUConstraints (KbVertical).inflate( 0, /*Katabatic::GCell::getTopRightShrink()*/ DbU::lambda(1.0) ); - Interval nativeConstraints = source->getNativeUConstraints(KbVertical).inflate( 0, /*Katabatic::GCell::getTopRightShrink()*/ DbU::lambda(1.0) ); + Interval constraints = source->getUConstraints (KbVertical|KbNoGCellShrink); + Interval nativeConstraints = source->getNativeUConstraints(KbVertical|KbNoGCellShrink); int slack = constraints.getSize() / getPitch(); int nativeSlack = nativeConstraints.getSize() / getPitch(); @@ -334,8 +328,8 @@ namespace Katabatic { if (parallel) target = parallel->getAutoTarget(); if (target->isTerminal()) { - Interval constraints = target->getUConstraints (KbVertical).inflate( 0, /*Katabatic::GCell::getTopRightShrink()*/ DbU::lambda(1.0) ); - Interval nativeConstraints = target->getNativeUConstraints(KbVertical).inflate( 0, /*Katabatic::GCell::getTopRightShrink()*/ DbU::lambda(1.0) ); + Interval constraints = target->getUConstraints (KbVertical|KbNoGCellShrink); + Interval nativeConstraints = target->getNativeUConstraints(KbVertical|KbNoGCellShrink); int slack = constraints.getSize() / getPitch(); int nativeSlack = nativeConstraints.getSize() / getPitch(); @@ -390,7 +384,7 @@ namespace Katabatic { if (_horizontal->getY() == axis) return; - ltrace(80) << "_setAxis() @Y " << DbU::getLambda(axis) << " " << this << endl; + ltrace(80) << "_setAxis() @Y " << DbU::toLambda(axis) << " " << this << endl; _horizontal->setY( axis ); invalidate(); @@ -410,6 +404,13 @@ namespace Katabatic { if (_horizontal->getTargetX() < _horizontal->getSourceX()) { ltrace(80) << "updateOrient() " << this << " (before S/T swap)" << endl; _horizontal->invert(); + + unsigned int spinFlags = _flags & SegDepthSpin; + unsetFlags( SegDepthSpin ); + if (spinFlags & SegSourceTop ) setFlags( SegTargetTop ); + if (spinFlags & SegSourceBottom) setFlags( SegTargetBottom ); + if (spinFlags & SegTargetTop ) setFlags( SegSourceTop ); + if (spinFlags & SegTargetBottom) setFlags( SegSourceBottom ); } } @@ -690,7 +691,7 @@ namespace Katabatic { { ltrace(200) << "AutoHorizontal::_makeDogleg(GCell*)" << endl; - DebugSession::open( getNet(), 110 ); + DebugSession::open( getNet(), 80 ); ltracein(159); //Session::doglegReset(); @@ -723,7 +724,7 @@ namespace Katabatic { Session::dogleg( this ); targetDetach(); - invalidate(); + invalidate( KbTopology ); autoTarget->invalidate( KbTopology ); AutoContact* dlContact1 = AutoContactTurn::create( doglegGCell, _horizontal->getNet(), contactLayer ); AutoContact* dlContact2 = AutoContactTurn::create( doglegGCell, _horizontal->getNet(), contactLayer ); diff --git a/katabatic/src/AutoSegment.cpp b/katabatic/src/AutoSegment.cpp index 4a300d6c..e654d7ee 100644 --- a/katabatic/src/AutoSegment.cpp +++ b/katabatic/src/AutoSegment.cpp @@ -198,7 +198,7 @@ namespace { _attractors[position]++; _attractorsCount++; - ltrace(88) << "add Attractor @" << DbU::getLambda(position) + ltrace(88) << "add Attractor @" << DbU::toLambda(position) << " [" << _attractors[position] << "]" << endl; } @@ -356,9 +356,7 @@ namespace Katabatic { Session::link( this ); updateOrient(); updatePositions(); - invalidate( KbNoFlags ); - //sourceAttach( getAutoSource() ); - //targetAttach( getAutoTarget() ); + invalidate( KbTopology ); _observers.notify( Create ); } @@ -415,15 +413,19 @@ namespace Katabatic { void AutoSegment::invalidate ( unsigned int flags ) { if (Session::doDestroyTool()) return; + if (flags & KbSource) setFlags( SegInvalidatedSource ); + if (flags & KbTarget) setFlags( SegInvalidatedTarget ); if (isInvalidated()) return; ltrace(200) << "AutoSegment::invalidate() " << flags << " " << this << endl; ltracein(200); _invalidate(); + if ((flags & KbPropagate) and not isNotAligned()) { - forEach( AutoSegment*, isegment, getAligneds() ) + forEach( AutoSegment*, isegment, getAligneds() ) { isegment->_invalidate(); + } } ltraceout(200); } @@ -441,20 +443,63 @@ namespace Katabatic { } + void AutoSegment::invalidate ( AutoContact* contact ) + { + if (Session::doDestroyTool()) return; + if (contact == getAutoSource()) setFlags( SegInvalidatedSource ); + if (contact == getAutoTarget()) setFlags( SegInvalidatedTarget ); + } + + void AutoSegment::revalidate () { - ltrace(110) << "AutoSegment::revalidate() " << this << endl; + ltrace(200) << "AutoSegment::revalidate() " << this << endl; if (not isInvalidated()) return; - ltracein(110); + ltracein(200); - updateOrient(); + updateOrient (); updatePositions(); - unsetFlags( SegInvalidated|SegInvalidatedLayer|SegCreated ); - _observers.notify( Revalidate ); + unsigned int oldSpinFlags = _flags & SegDepthSpin; - ltraceout(110); + if (_flags & (SegInvalidatedSource|SegCreated)) { + const Layer* contactLayer = getAutoSource()->getLayer(); + const Layer* segmentLayer = getLayer(); + ltrace(200) << "Changed source: " << getAutoSource() << endl; + + unsetFlags( SegSourceTop|SegSourceBottom ); + if (contactLayer != segmentLayer) { + setFlags( (segmentLayer == contactLayer->getTop()) ? SegSourceBottom : SegSourceTop ); + } + } + + if (_flags & (SegInvalidatedTarget|SegCreated)) { + const Layer* contactLayer = getAutoTarget()->getLayer(); + const Layer* segmentLayer = getLayer(); + ltrace(200) << "Changed target: " << getAutoTarget() << endl; + + unsetFlags( SegTargetTop|SegTargetBottom ); + if (contactLayer != segmentLayer) { + setFlags( (segmentLayer == contactLayer->getTop()) ? SegTargetBottom : SegTargetTop ); + } + } + + unsigned int observerFlags = Revalidate; + if ( (_flags & SegCreated) or (oldSpinFlags != (_flags & SegDepthSpin)) ) + observerFlags |= RevalidatePPitch; + + unsetFlags( SegInvalidated + | SegInvalidatedSource + | SegInvalidatedTarget + | SegInvalidatedLayer + | SegCreated + ); + + _observers.notify( observerFlags ); + + ltrace(200) << "Updated: " << this << endl; + ltraceout(200); } @@ -471,6 +516,38 @@ namespace Katabatic { } + bool AutoSegment::isSameLayerDogleg () const + { + if (not isSpinTopOrBottom()) return false; + + unsigned int perpandicularDepth = getDepth() + (isSpinTop() ? 1 : -1); + if (perpandicularDepth >= Session::getDepth()) { + cerr << this << " isSpinTop too high." << endl; + } + perpandicularDepth = Session::getDepth() - 1; + + return (getLength() > (Session::getPitch(perpandicularDepth))) + and (getLength() < (Session::getPitch(perpandicularDepth) * 3)); + } + + + DbU::Unit AutoSegment::getPPitch () const + { + DbU::Unit topPPitch = getPitch(); + DbU::Unit bottomPPitch = topPPitch; + unsigned int depth = getDepth(); + + if (depth < Session::getDepth()) { + topPPitch = Session::getPitch( depth + ((_flags & SegSpinTop) ? 1 : 0) ); + } + if (depth > 0) { + bottomPPitch = Session::getPitch( depth - ((_flags & SegSpinBottom) ? 1 : 0) ); + } + + return std::max( topPPitch, bottomPPitch ); + } + + DbU::Unit AutoSegment::getSlack () const { DbU::Unit constraintMin; @@ -578,6 +655,49 @@ namespace Katabatic { { return AutoSegments_Perpandiculars( this ); } + bool AutoSegment::checkDepthSpin () const + { + bool valid = true; + const Layer* sourceLayer = getAutoSource()->getLayer(); + const Layer* targetLayer = getAutoTarget()->getLayer(); + + if ( (_flags & SegSourceTop) and (sourceLayer->getBottom() != getLayer()) ) { + cerr << Error("%s\n" + " Source is not going above, connected to *top* of %s." + , getString(this).c_str() + , getString(getAutoSource()).c_str() + ) << endl; + valid = false; + } + if ( (_flags & SegSourceBottom) and (sourceLayer->getTop() != getLayer()) ) { + cerr << Error("%s\n" + " Source is not going below, connected to *bottom* of %s." + , getString(this).c_str() + , getString(getAutoSource()).c_str() + ) << endl; + valid = false; + } + if ( (_flags & SegTargetTop) and (targetLayer->getBottom() != getLayer()) ) { + cerr << Error("%s\n" + " Target is not going above connected to *top* of %s." + , getString(this).c_str() + , getString(getAutoTarget()).c_str() + ) << endl; + valid = false; + } + if ( (_flags & SegTargetBottom) and (targetLayer->getTop() != getLayer()) ) { + cerr << Error("%s\n" + " Target is not going below, connected to *bottom* of %s." + , getString(this).c_str() + , getString(getAutoTarget()).c_str() + ) << endl; + valid = false; + } + + return valid; + } + + void AutoSegment::setFlagsOnAligneds ( unsigned int flags ) { setFlags( flags ); @@ -595,6 +715,7 @@ namespace Katabatic { base()->getSourceHook()->detach(); source->cacheDetach( this ); unsetFlags( SegNotSourceAligned ); + setFlags( SegInvalidatedSource ); } } @@ -606,6 +727,7 @@ namespace Katabatic { base()->getTargetHook()->detach(); target->cacheDetach( this ); unsetFlags( SegNotTargetAligned ); + setFlags( SegInvalidatedTarget ); } } @@ -662,9 +784,10 @@ namespace Katabatic { if (constraintMin > constraintMax) { ltraceout(200); return false; } if (isDogleg()) { - // Ugly: hard-wired value of the track spacing. - constraintMin -= DbU::lambda(25.0); - constraintMax += DbU::lambda(25.0); + DbU::Unit halfSideLength = getAutoSource()->getGCell()->getSide + ( isHorizontal() ? KbVertical : KbHorizontal ).getHalfSize(); + constraintMin -= halfSideLength; + constraintMax += halfSideLength; } if (getAxis() < constraintMin) { @@ -725,8 +848,8 @@ namespace Katabatic { if ( (axis == getAxis()) and not (flags & KbRealignate) ) return; ltrace(200) << "setAxis() @" - << ((isHorizontal())?"Y ":"X ") << DbU::getLambda(getAxis()) - << " to " << DbU::getLambda(axis) << " on " << this << endl; + << ((isHorizontal())?"Y ":"X ") << DbU::toLambda(getAxis()) + << " to " << DbU::toLambda(axis) << " on " << this << endl; ltracein(80); _setAxis( axis ); @@ -856,8 +979,8 @@ namespace Katabatic { getConstraints( constraintMin, constraintMax ); if (attractors.getAttractorsCount()) { - ltrace(89) << "Lower Median " << DbU::getLambda(attractors.getLowerMedian()) << endl; - ltrace(89) << "Upper Median " << DbU::getLambda(attractors.getUpperMedian()) << endl; + ltrace(89) << "Lower Median " << DbU::toLambda(attractors.getLowerMedian()) << endl; + ltrace(89) << "Upper Median " << DbU::toLambda(attractors.getUpperMedian()) << endl; optimalMin = attractors.getLowerMedian(); optimalMax = attractors.getUpperMedian(); @@ -1044,7 +1167,7 @@ namespace Katabatic { ltracein(200); invalidate( KbNoFlags ); - setFlags( SegInvalidatedLayer ); + setFlags( SegInvalidatedLayer|SegInvalidatedSource|SegInvalidatedTarget ); const Layer* newLayer = Session::getRoutingGauge()->getRoutingLayer(depth); if (getLayer() != newLayer) { @@ -1658,9 +1781,10 @@ namespace Katabatic { { bool coherency = true; - coherency = coherency && checkNotInvalidated(); - coherency = coherency && checkPositions(); - coherency = coherency && checkConstraints(); + coherency = checkNotInvalidated() and coherency; + coherency = checkPositions() and coherency; + coherency = checkConstraints() and coherency; + coherency = checkDepthSpin() and coherency; return coherency; } @@ -1681,6 +1805,14 @@ namespace Katabatic { state += isNotAligned () ? "A": "-"; state += isSlackened () ? "S": "-"; state += isInvalidated () ? "i": "-"; + + if (_flags & SegSourceTop) state += 'T'; + else if (_flags & SegSourceBottom) state += 'B'; + else state += '-'; + if (_flags & SegTargetTop) state += 'T'; + else if (_flags & SegTargetBottom) state += 'B'; + else state += '-'; + return state; } diff --git a/katabatic/src/AutoSegments.cpp b/katabatic/src/AutoSegments.cpp index 4d686256..f828b296 100644 --- a/katabatic/src/AutoSegments.cpp +++ b/katabatic/src/AutoSegments.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 | @@ -381,8 +380,8 @@ namespace Katabatic { ltrace(79) << _hookLocator->getElement() << endl; Hook* hook = dynamic_cast(_hookLocator->getElement()); if (hook) { - if ( ((_flags & KbBySource) and (dynamic_cast(hook))) - or ((_flags & KbByTarget) and (dynamic_cast(hook))) ) { + if ( ((_flags & KbSource) and (dynamic_cast(hook))) + or ((_flags & KbTarget) and (dynamic_cast(hook))) ) { _element = Session::lookup( static_cast(hook->getComponent()) ); if (_element->isHorizontal()) { diff --git a/katabatic/src/AutoVertical.cpp b/katabatic/src/AutoVertical.cpp index 791e9f50..ec04170f 100644 --- a/katabatic/src/AutoVertical.cpp +++ b/katabatic/src/AutoVertical.cpp @@ -224,16 +224,10 @@ namespace Katabatic { Interval sourceConstraints = Interval(getAutoSource()->getCBXMin(),getAutoSource()->getCBXMax()); Interval targetConstraints = Interval(getAutoTarget()->getCBXMin(),getAutoTarget()->getCBXMax()); - // Ugly: should uses topRightShrink from GCell. - //sourceConstraints.inflate( 0, /*Katabatic::GCell::getTopRightShrink()*/ DbU::lambda(1.0) ); - //targetConstraints.inflate( 0, /*Katabatic::GCell::getTopRightShrink()*/ DbU::lambda(1.0) ); // Expand by a tiny amount for the "contains" to work for sure. sourceConstraints.inflate( 1 ); targetConstraints.inflate( 1 ); - // Ugly: GCell's track number is hardwired. - //if (sourceConstraints.getSize() / DbU::lambda(5.0) < 10) { ltraceout(200); return true; } - //if (targetConstraints.getSize() / DbU::lambda(5.0) < 10) { ltraceout(200); return true; } if (not sourceConstraints.contains(sourceSide)) { ltraceout(200); return true; } if (not targetConstraints.contains(targetSide)) { ltraceout(200); return true; } @@ -263,8 +257,8 @@ namespace Katabatic { AutoSegment* parallel = this; if (source->isTerminal()) { - Interval constraints = source->getUConstraints (KbHorizontal).inflate( 0, /*Katabatic::GCell::getTopRightShrink()*/ DbU::lambda(1.0) ); - Interval nativeConstraints = source->getNativeUConstraints(KbHorizontal).inflate( 0, /*Katabatic::GCell::getTopRightShrink()*/ DbU::lambda(1.0) ); + Interval constraints = source->getUConstraints (KbHorizontal|KbNoGCellShrink); + Interval nativeConstraints = source->getNativeUConstraints(KbHorizontal|KbNoGCellShrink); int slack = constraints.getSize() / getPitch(); int nativeSlack = nativeConstraints.getSize() / getPitch(); @@ -294,8 +288,8 @@ namespace Katabatic { } if (target->isTerminal()) { - Interval constraints = target->getUConstraints (KbHorizontal).inflate( 0, /*Katabatic::GCell::getTopRightShrink()*/ DbU::lambda(1.0) ); - Interval nativeConstraints = target->getNativeUConstraints(KbHorizontal).inflate( 0, /*Katabatic::GCell::getTopRightShrink()*/ DbU::lambda(1.0) ); + Interval constraints = target->getUConstraints (KbHorizontal|KbNoGCellShrink); + Interval nativeConstraints = target->getNativeUConstraints(KbHorizontal|KbNoGCellShrink); int slack = constraints.getSize() / getPitch(); int nativeSlack = nativeConstraints.getSize() / getPitch(); @@ -333,7 +327,7 @@ namespace Katabatic { if (_vertical->getX() == axis) return; - ltrace(159) << "_setAxis() @X " << DbU::getLambda(axis) << " " << this << endl; + ltrace(159) << "_setAxis() @X " << DbU::toLambda(axis) << " " << this << endl; _vertical->setX( axis ); invalidate(); @@ -353,6 +347,13 @@ namespace Katabatic { if (_vertical->getTargetY() < _vertical->getSourceY()) { ltrace(80) << "updateOrient() " << this << " (before S/T swap)" << endl; _vertical->invert(); + + unsigned int spinFlags = _flags & SegDepthSpin; + unsetFlags( SegDepthSpin ); + if (spinFlags & SegSourceTop ) setFlags( SegTargetTop ); + if (spinFlags & SegSourceBottom) setFlags( SegTargetBottom ); + if (spinFlags & SegTargetTop ) setFlags( SegSourceTop ); + if (spinFlags & SegTargetBottom) setFlags( SegSourceBottom ); } } @@ -641,7 +642,7 @@ namespace Katabatic { Session::dogleg( this ); targetDetach(); - invalidate(); + invalidate( KbTopology ); autoTarget->invalidate( KbTopology ); AutoContact* dlContact1 = AutoContactTurn::create( doglegGCell, _vertical->getNet(), contactLayer ); ltrace(200) << dlContact1 << endl; diff --git a/katabatic/src/ChipTools.cpp b/katabatic/src/ChipTools.cpp index ac892f31..28310320 100644 --- a/katabatic/src/ChipTools.cpp +++ b/katabatic/src/ChipTools.cpp @@ -47,16 +47,20 @@ namespace { enum SegmentType { LocalSegments=0x10, GlobalSegments=0x20 }; - bool isChip ( Cell* cell, Instance*& core ) + bool isChip ( Cell* cell, Instance*& core, Cell*& referencePad ) { AllianceFramework* af = AllianceFramework::get(); int pads = 0; int cores = 0; + core = NULL; + referencePad = NULL; forEach ( Instance*, iinstance, cell->getInstances() ) { - if ( af->isPad(iinstance->getMasterCell()) ) + if ( af->isPad(iinstance->getMasterCell()) ) { ++pads; - else { + if (not referencePad) + referencePad = iinstance->getMasterCell(); + } else { ++cores; core = *iinstance; } @@ -177,7 +181,7 @@ namespace Katabatic { cmess1 << " o Slackening IOs of <" << core->getName() << ">." << endl; Layer::Mask mask = Session::getRoutingLayer(1)->getMask(); - slackenBorder ( core->getBoundingBox().inflate(DbU::lambda(50.0)) + slackenBorder ( core->getBoundingBox().inflate(Session::getSliceHeight()) , mask , GlobalSegments|Constant::Horizontal ); @@ -186,19 +190,19 @@ namespace Katabatic { void KatabaticEngine::chipPrep () { - if ( isChip() ) { - reselectPadRp ( getCell() ); - // slackenBlockIos ( _core ); + if (isChip()) { + reselectPadRp( getCell() ); + //slackenBlockIos( _core ); - // cmess1 << " o Slackening Pads-connected segments." << endl; - // slackenBorder ( _cell->getBoundingBox().inflate(DbU::lambda(-425.0)) - // , Session::getRoutingLayer(3)->getMask() - // , GlobalSegments|LocalSegments|Constant::Horizontal - // ); - // slackenBorder ( _cell->getBoundingBox().inflate(DbU::lambda(-425.0)) - // , Session::getRoutingLayer(1)->getMask() - // , GlobalSegments|Constant::Horizontal - // ); + //cmess1 << " o Slackening Pads-connected segments." << endl; + //slackenBorder( _cell->getBoundingBox().inflate(DbU::lambda(-425.0)) + // , Session::getRoutingLayer(3)->getMask() + // , GlobalSegments|LocalSegments|Constant::Horizontal + // ); + //slackenBorder( _cell->getBoundingBox().inflate(DbU::lambda(-425.0)) + // , Session::getRoutingLayer(1)->getMask() + // , GlobalSegments|Constant::Horizontal + // ); } } @@ -206,6 +210,7 @@ namespace Katabatic { ChipTools::ChipTools ( Cell* cell ) : _cell (cell) , _core (NULL) + , _referencePad(NULL) , _isChip (false) , _chipBb (cell->getBoundingBox()) , _leftPadsBb () @@ -214,11 +219,11 @@ namespace Katabatic { , _bottomPadsBb() , _chipCorona () { - _isChip = ::isChip ( _cell, _core ); + _isChip = ::isChip( _cell, _core, _referencePad ); - if ( _isChip ) { + if (_isChip) { // Ugly: hard-coded pads height. - const DbU::Unit padHeight = DbU::lambda(400.0); + const DbU::Unit padHeight = _referencePad->getAbutmentBox().getHeight(); Box outer = _cell->getBoundingBox().inflate ( -padHeight ); _chipCorona = Torus ( outer, _core->getBoundingBox() ); @@ -228,9 +233,10 @@ namespace Katabatic { _topPadsBb = Box ( _chipBb.getXMin(), _chipCorona.getOuterBox().getYMax(), _chipBb.getXMax(), _chipBb.getYMax() ); cmess1 << " o Design is a complete chip." << endl; - cmess1 << " - Core: <" << _core->getName() << ">/<" + cmess1 << " - Core: <" << _core->getName() << ">/<" << _core->getMasterCell()->getName() << ">." << endl; - cmess1 << " - Corona: " << _chipCorona << "." << endl; + cmess1 << " - Reference pad: <" << _referencePad->getName() << ">" << endl; + cmess1 << " - Corona: " << _chipCorona << "." << endl; } else { _chipCorona = Torus ( _cell->getBoundingBox(), _cell->getBoundingBox() ); } @@ -253,6 +259,7 @@ namespace Katabatic { record->add ( getSlot ( "_cell" , _cell ) ); record->add ( getSlot ( "_core" , _core ) ); + record->add ( getSlot ( "_referencePad", _referencePad ) ); record->add ( getSlot ( "_isChip" , &_isChip ) ); record->add ( getSlot ( "_chipBb" , &_chipBb ) ); record->add ( getSlot ( "_leftPadsBb" , &_leftPadsBb ) ); diff --git a/katabatic/src/Configuration.cpp b/katabatic/src/Configuration.cpp index 4e77d0d4..6e8b6feb 100644 --- a/katabatic/src/Configuration.cpp +++ b/katabatic/src/Configuration.cpp @@ -14,19 +14,21 @@ // +-----------------------------------------------------------------+ -#include -#include -#include -#include "vlsisapd/configuration/Configuration.h" -#include "hurricane/Warning.h" -#include "hurricane/Error.h" -#include "hurricane/Technology.h" -#include "hurricane/DataBase.h" -#include "hurricane/Cell.h" -#include "crlcore/Utilities.h" -#include "crlcore/RoutingLayerGauge.h" -#include "crlcore/AllianceFramework.h" -#include "katabatic/Configuration.h" +#include +#include +#include +#include "vlsisapd/configuration/Configuration.h" +#include "hurricane/Warning.h" +#include "hurricane/Error.h" +#include "hurricane/Technology.h" +#include "hurricane/DataBase.h" +#include "hurricane/Cell.h" +#include "crlcore/Utilities.h" +#include "crlcore/CellGauge.h" +#include "crlcore/RoutingGauge.h" +#include "crlcore/RoutingLayerGauge.h" +#include "crlcore/AllianceFramework.h" +#include "katabatic/Configuration.h" @@ -62,18 +64,21 @@ namespace Katabatic { // Class : "Katabatic::ConfigurationConcrete". - ConfigurationConcrete::ConfigurationConcrete ( const RoutingGauge* rg ) + ConfigurationConcrete::ConfigurationConcrete ( const CellGauge* cg, const RoutingGauge* rg ) : Configuration () + , _cg (NULL) , _rg (NULL) , _extensionCap (DbU::lambda(0.5)) , _saturateRatio (Cfg::getParamPercentage("katabatic.saturateRatio",80.0)->asDouble()) , _saturateRp (Cfg::getParamInt ("katabatic.saturateRp" ,8 )->asInt()) - , _globalThreshold(DbU::lambda((double)Cfg::getParamInt("katabatic.globalLengthThreshold",29*50)->asInt())) // Ugly: direct uses of SxLib gauge. + , _globalThreshold(0) , _allowedDepth (0) , _hEdgeCapacity (0) , _vEdgeCapacity (0) { + if (cg == NULL) cg = AllianceFramework::get()->getCellGauge(); if (rg == NULL) rg = AllianceFramework::get()->getRoutingGauge(); + _cg = cg->getClone(); _rg = rg->getClone(); if (Cfg::hasParameter("katabatic.topRoutingLayer")) { @@ -89,15 +94,19 @@ namespace Katabatic { if (_gmetalv == NULL) cerr << Warning("Cannot get \"gmetalv\" layer from the Technology.") << endl; if (_gmetalh == NULL) cerr << Warning("Cannot get \"gmetalh\" layer from the Technology.") << endl; + DbU::Unit sliceHeight = _cg->getSliceHeight(); + _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; if (layerGauge->getDirection() == Constant::Horizontal) { - _hEdgeCapacity += layerGauge->getTrackNumber ( 0, DbU::lambda(50.0) ) - 1; + _hEdgeCapacity += layerGauge->getTrackNumber ( 0, sliceHeight ) - 1; } else if (layerGauge->getDirection() == Constant::Vertical) { - _vEdgeCapacity += layerGauge->getTrackNumber( 0, DbU::lambda(50.0) ) - 1; + _vEdgeCapacity += layerGauge->getTrackNumber( 0, sliceHeight ) - 1; } } } @@ -108,19 +117,22 @@ namespace Katabatic { , _gmetalh (other._gmetalh) , _gmetalv (other._gmetalv) , _gcontact (other._gcontact) + , _cg (NULL) , _rg (NULL) , _extensionCap (other._extensionCap) , _saturateRatio (other._saturateRatio) , _globalThreshold (other._globalThreshold) , _allowedDepth (other._allowedDepth) { - if ( other._rg ) _rg = other._rg->getClone(); + if (other._cg) _cg = other._cg->getClone(); + if (other._rg) _rg = other._rg->getClone(); } ConfigurationConcrete::~ConfigurationConcrete () { ltrace(89) << "About to delete attribute _rg (RoutingGauge)." << endl; + _cg->destroy (); _rg->destroy (); } @@ -153,6 +165,10 @@ namespace Katabatic { { return _rg->getLayerDepth(layer); } + CellGauge* ConfigurationConcrete::getCellGauge () const + { return _cg; } + + RoutingGauge* ConfigurationConcrete::getRoutingGauge () const { return _rg; } @@ -173,6 +189,14 @@ namespace Katabatic { { return _extensionCap; } + DbU::Unit ConfigurationConcrete::getSliceHeight () const + { return _cg->getSliceHeight(); } + + + DbU::Unit ConfigurationConcrete::getSliceStep () const + { return _cg->getSliceStep(); } + + DbU::Unit ConfigurationConcrete::getPitch ( const Layer* layer, unsigned int flags ) const { return getPitch( getLayerDepth(layer), flags ); } @@ -290,7 +314,7 @@ namespace Katabatic { cout << Dots::asIdentifier(" - Routing Gauge" ,getString(_rg->getName())) << endl; cout << Dots::asString (" - Top routing layer" ,topLayerName) << endl; cout << Dots::asPercentage(" - GCell saturation threshold" ,_saturateRatio) << endl; - cout << Dots::asDouble (" - Long global length threshold",DbU::getLambda(_globalThreshold)) << endl; + cout << Dots::asDouble (" - Long global length threshold",DbU::toLambda(_globalThreshold)) << endl; } diff --git a/katabatic/src/GCell.cpp b/katabatic/src/GCell.cpp index 985be6d0..1eb66c65 100644 --- a/katabatic/src/GCell.cpp +++ b/katabatic/src/GCell.cpp @@ -361,8 +361,7 @@ namespace Katabatic { GCell* GCell::create ( GCellGrid* gcellGrid, unsigned int index, Box box ) { - if (_topRightShrink == 0) - _topRightShrink = 1 /*DbU::lambda(0.0)*/; + if (_topRightShrink == 0) _topRightShrink = 1; DbU::Unit trShrink = ( gcellGrid->isOnTopBorder (index) or gcellGrid->isOnRightBorder(index)) ? 0 : _topRightShrink; @@ -499,25 +498,25 @@ namespace Katabatic { AutoSegments GCell::getHStartSegments () { - return new AutoSegments_AnchorOnGCell (this,KbHorizontal|KbBySource); + return new AutoSegments_AnchorOnGCell (this,KbHorizontal|KbSource); } AutoSegments GCell::getVStartSegments () { - return new AutoSegments_AnchorOnGCell (this,KbVertical|KbBySource); + return new AutoSegments_AnchorOnGCell (this,KbVertical|KbSource); } AutoSegments GCell::getHStopSegments () { - return new AutoSegments_AnchorOnGCell (this,KbHorizontal|KbByTarget); + return new AutoSegments_AnchorOnGCell (this,KbHorizontal|KbTarget); } AutoSegments GCell::getVStopSegments () { - return new AutoSegments_AnchorOnGCell (this,KbVertical|KbByTarget); + return new AutoSegments_AnchorOnGCell (this,KbVertical|KbTarget); } @@ -1324,8 +1323,8 @@ namespace Katabatic { , "" , getColumn() , getRow() - , DbU::getLambda(getX()) - , DbU::getLambda(getY()) + , DbU::toLambda(getX()) + , DbU::toLambda(getY()) , getDensity() , _cDensity ); diff --git a/katabatic/src/KatabaticEngine.cpp b/katabatic/src/KatabaticEngine.cpp index 51f3964c..53ec4e79 100644 --- a/katabatic/src/KatabaticEngine.cpp +++ b/katabatic/src/KatabaticEngine.cpp @@ -401,7 +401,7 @@ namespace Katabatic { AutoSegmentLut::const_iterator it = _autoSegmentLut.begin(); AutoSegmentLut::const_iterator end = _autoSegmentLut.end (); for ( ; it != end ; it++ ) - coherency = coherency && it->second->_check(); + coherency = it->second->_check() and coherency; vector::const_iterator itGCell = _gcellGrid->getGCellVector()->begin(); vector::const_iterator endGCell = _gcellGrid->getGCellVector()->end(); @@ -573,7 +573,7 @@ namespace Katabatic { } ltrace(159) << "Align on " << aligneds[0] - << " " << DbU::getLambda(aligneds[0]->getAxis()) << endl; + << " " << DbU::toLambda(aligneds[0]->getAxis()) << endl; aligneds[0]->setAxis( aligneds[0]->getAxis(), KbRealignate ); aligneds.clear(); diff --git a/katabatic/src/LayerAssign.cpp b/katabatic/src/LayerAssign.cpp index 16c76a53..dbe12250 100644 --- a/katabatic/src/LayerAssign.cpp +++ b/katabatic/src/LayerAssign.cpp @@ -299,7 +299,7 @@ namespace Katabatic { locals.push_back( autoSegment ); } else { // Ugly: Hard-coded GCell side. - if ( (autoSegment->getLength() < 3*DbU::lambda(50.0)) and (autoSegment != seed) ) + if ( (autoSegment->getLength() < 3*Session::getSliceHeight()) and (autoSegment != seed) ) locals.push_back( autoSegment ); else globals.push_back( autoSegment ); diff --git a/katabatic/src/LoadGrByNet.cpp b/katabatic/src/LoadGrByNet.cpp index 1e9aec05..1162bc93 100644 --- a/katabatic/src/LoadGrByNet.cpp +++ b/katabatic/src/LoadGrByNet.cpp @@ -961,7 +961,7 @@ namespace { } #endif // HARDCODED VALUE. - if ( (_topology & Global_Fixed) and (globalSegment->getLength() < 2*DbU::lambda(50.0)) ) + if ( (_topology & Global_Fixed) and (globalSegment->getLength() < 2*Session::getSliceHeight()) ) _toFixSegments.push_back( globalSegment ); if (_connexity.fields.globals < 2) { diff --git a/katabatic/src/Session.cpp b/katabatic/src/Session.cpp index d3f3b4a4..97df43d4 100644 --- a/katabatic/src/Session.cpp +++ b/katabatic/src/Session.cpp @@ -1,7 +1,7 @@ // -*- mode: C++; explicit-buffer-name: "Session.cpp" -*- // // 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 | @@ -81,6 +81,7 @@ namespace Katabatic { Session::Session ( KatabaticEngine* ktbt ) : _katabatic (ktbt) , _technology (ktbt->getRoutingGauge()->getTechnology()) + , _cellGauge (ktbt->getCellGauge()) , _routingGauge (ktbt->getRoutingGauge()) , _autoContacts () , _doglegs () @@ -185,7 +186,7 @@ namespace Katabatic { } if (aligneds.empty()) canonical->setFlags( SegNotAligned ); - ltrace(159) << "Align @" << DbU::getLambda(canonical->getAxis()) + ltrace(159) << "Align @" << DbU::toLambda(canonical->getAxis()) << " on " << canonical << endl; //canonical->setAxis( canonical->getAxis(), KbRealignate ); diff --git a/katabatic/src/katabatic/AutoContact.h b/katabatic/src/katabatic/AutoContact.h index c62bf76d..481e9379 100644 --- a/katabatic/src/katabatic/AutoContact.h +++ b/katabatic/src/katabatic/AutoContact.h @@ -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 | diff --git a/katabatic/src/katabatic/AutoContactTerminal.h b/katabatic/src/katabatic/AutoContactTerminal.h index cc406e71..8c2ab882 100644 --- a/katabatic/src/katabatic/AutoContactTerminal.h +++ b/katabatic/src/katabatic/AutoContactTerminal.h @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2012-2013, All Rights Reserved +// Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | diff --git a/katabatic/src/katabatic/AutoSegment.h b/katabatic/src/katabatic/AutoSegment.h index d03e3add..528b55d7 100644 --- a/katabatic/src/katabatic/AutoSegment.h +++ b/katabatic/src/katabatic/AutoSegment.h @@ -60,30 +60,40 @@ namespace Katabatic { // ------------------------------------------------------------------- // Class : "AutoSegment". - enum AutoSegmentFlag { SegHorizontal = 0x00000001 - , SegFixed = 0x00000002 - , SegGlobal = 0x00000004 - , SegWeakGlobal = 0x00000008 - , SegCanonical = 0x00000010 - , SegBipoint = 0x00000020 - , SegDogleg = 0x00000040 - , SegStrap = 0x00000080 - , SegLayerChange = 0x00000100 - , SegStrongTerminal = 0x00000200 // Replace Terminal. - , SegWeakTerminal1 = 0x00000400 // Replace TopologicalEnd. - , SegWeakTerminal2 = 0x00000800 // Replace TopologicalEnd. - , SegNotSourceAligned = 0x00001000 - , SegNotTargetAligned = 0x00002000 - , SegUnbound = 0x00010000 - , SegHalfSlackened = 0x00020000 - , SegSlackened = 0x00040000 - , SegAxisSet = 0x00080000 - , SegInvalidated = 0x00100000 - , SegInvalidatedLayer = 0x00200000 - , SegCreated = 0x00400000 - // Masks. - , SegWeakTerminal = SegStrongTerminal|SegWeakTerminal1|SegWeakTerminal2 - , SegNotAligned = SegNotSourceAligned|SegNotTargetAligned + enum AutoSegmentFlag { SegNoFlags = 0x00000000 + , SegHorizontal = 0x00000001 + , SegFixed = 0x00000002 + , SegGlobal = 0x00000004 + , SegWeakGlobal = 0x00000008 + , SegCanonical = 0x00000010 + , SegBipoint = 0x00000020 + , SegDogleg = 0x00000040 + , SegStrap = 0x00000080 + , SegSourceTop = 0x00000100 + , SegSourceBottom = 0x00000200 + , SegTargetTop = 0x00000400 + , SegTargetBottom = 0x00000800 + , SegLayerChange = 0x00001000 + , SegStrongTerminal = 0x00002000 // Replace Terminal. + , SegWeakTerminal1 = 0x00004000 // Replace TopologicalEnd. + , SegWeakTerminal2 = 0x00008000 // Replace TopologicalEnd. + , SegNotSourceAligned = 0x00010000 + , SegNotTargetAligned = 0x00020000 + , SegUnbound = 0x00100000 + , SegHalfSlackened = 0x00200000 + , SegSlackened = 0x00400000 + , SegAxisSet = 0x00800000 + , SegInvalidated = 0x01000000 + , SegInvalidatedSource = 0x02000000 + , SegInvalidatedTarget = 0x04000000 + , SegInvalidatedLayer = 0x08000000 + , SegCreated = 0x10000000 + // Masks. + , SegWeakTerminal = SegStrongTerminal|SegWeakTerminal1|SegWeakTerminal2 + , SegNotAligned = SegNotSourceAligned|SegNotTargetAligned + , SegSpinTop = SegSourceTop |SegTargetTop + , SegSpinBottom = SegSourceBottom|SegTargetBottom + , SegDepthSpin = SegSpinTop |SegSpinBottom }; @@ -92,10 +102,11 @@ namespace Katabatic { friend class AutoVertical; public: - enum ObserverFlag { Create = 0x000000001 - , Destroy = 0x000000002 - , Invalidate = 0x000000003 - , Revalidate = 0x000000004 + enum ObserverFlag { Create = 0x000000001 + , Destroy = 0x000000002 + , Invalidate = 0x000000004 + , Revalidate = 0x000000008 + , RevalidatePPitch = 0x000000010 }; public: typedef std::function< void(AutoSegment*) > RevalidateCb_t; @@ -153,7 +164,11 @@ namespace Katabatic { inline bool isNotTargetAligned () const; inline bool isNotAligned () const; bool isStrongTerminal ( unsigned int flags=0 ) const; + bool isSameLayerDogleg () const; inline bool isLayerChange () const; + inline bool isSpinTop () const; + inline bool isSpinBottom () const; + inline bool isSpinTopOrBottom () const; inline bool isStrap () const; inline bool isDogleg () const; inline bool isUnbound () const; @@ -173,6 +188,7 @@ namespace Katabatic { bool canSlacken ( unsigned int flags=0 ) const; virtual bool checkPositions () const = 0; virtual bool checkConstraints () const = 0; + bool checkDepthSpin () const; // Accessors. template< typename T > inline T* getObserver (); @@ -188,6 +204,7 @@ namespace Katabatic { inline AutoSegment* getParent () const; inline unsigned int getDepth () const; inline DbU::Unit getPitch () const; + DbU::Unit getPPitch () const; inline DbU::Unit getAxis () const; virtual DbU::Unit getSourceU () const = 0; virtual DbU::Unit getTargetU () const = 0; @@ -221,6 +238,8 @@ namespace Katabatic { void computeTerminal (); virtual void updateOrient () = 0; virtual void updatePositions () = 0; + void updateSourceSpin (); + void updateTargetSpin (); void sourceDetach (); void targetDetach (); void sourceAttach ( AutoContact* ); @@ -248,6 +267,7 @@ namespace Katabatic { // Canonical Modifiers. AutoSegment* canonize ( unsigned int flags=KbNoFlags ); virtual void invalidate ( unsigned int flags=KbPropagate ); + void invalidate ( AutoContact* ); void computeOptimal ( set& processeds ); void setAxis ( DbU::Unit, unsigned int flags=KbNoFlags ); bool toConstraintAxis ( unsigned int flags=KbRealignate ); @@ -414,6 +434,9 @@ namespace Katabatic { inline bool AutoSegment::isUnbound () const { return _flags & SegUnbound ; } inline bool AutoSegment::isStrap () const { return _flags & SegStrap; } inline bool AutoSegment::isLayerChange () const { return _flags & SegLayerChange; } + inline bool AutoSegment::isSpinTop () const { return ((_flags & SegSpinTop ) == SegSpinTop); } + inline bool AutoSegment::isSpinBottom () const { return ((_flags & SegSpinBottom) == SegSpinBottom); } + inline bool AutoSegment::isSpinTopOrBottom () const { return isSpinTop() or isSpinBottom(); } inline bool AutoSegment::isSlackened () const { return _flags & SegSlackened; } inline bool AutoSegment::isCanonical () const { return _flags & SegCanonical; } inline bool AutoSegment::isUnsetAxis () const { return not (_flags & SegAxisSet); } diff --git a/katabatic/src/katabatic/AutoSegments.h b/katabatic/src/katabatic/AutoSegments.h index b15c85c7..e68c5a8e 100644 --- a/katabatic/src/katabatic/AutoSegments.h +++ b/katabatic/src/katabatic/AutoSegments.h @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2013, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | diff --git a/katabatic/src/katabatic/ChipTools.h b/katabatic/src/katabatic/ChipTools.h index a8cdea8a..3f53533e 100644 --- a/katabatic/src/katabatic/ChipTools.h +++ b/katabatic/src/katabatic/ChipTools.h @@ -42,6 +42,7 @@ namespace Katabatic { inline bool isChip () const; inline Cell* getCell () const; inline Instance* getCore () const; + inline Cell* getReferencePad () const; inline const Box& getChipBb () const; inline const Box& getLeftPadsBb () const; inline const Box& getRightPadsBb () const; @@ -59,6 +60,7 @@ namespace Katabatic { private: Cell* _cell; Instance* _core; + Cell* _referencePad; bool _isChip; Box _chipBb; Box _leftPadsBb; @@ -73,6 +75,7 @@ namespace Katabatic { inline bool ChipTools::isChip () const { return _isChip; } inline Cell* ChipTools::getCell () const { return _cell; } inline Instance* ChipTools::getCore () const { return _core; } + inline Cell* ChipTools::getReferencePad () const { return _referencePad; } inline const Box& ChipTools::getChipBb () const { return _chipBb; } inline const Box& ChipTools::getLeftPadsBb () const { return _leftPadsBb; }; inline const Box& ChipTools::getRightPadsBb () const { return _rightPadsBb; }; diff --git a/katabatic/src/katabatic/Configuration.h b/katabatic/src/katabatic/Configuration.h index d1107fa3..3b3573ca 100644 --- a/katabatic/src/katabatic/Configuration.h +++ b/katabatic/src/katabatic/Configuration.h @@ -25,8 +25,9 @@ namespace Hurricane { class Cell; } -#include "crlcore/RoutingGauge.h" namespace CRL { + class CellGauge; + class RoutingGauge; class RoutingLayerGauge; } @@ -40,6 +41,7 @@ namespace Katabatic { using Hurricane::Layer; using Hurricane::DbU; using Hurricane::Cell; + using CRL::CellGauge; using CRL::RoutingGauge; using CRL::RoutingLayerGauge; @@ -61,11 +63,14 @@ namespace Katabatic { virtual size_t getDepth () const = 0; virtual size_t getAllowedDepth () const = 0; virtual size_t getLayerDepth ( const Layer* ) const = 0; + virtual CellGauge* getCellGauge () const = 0; virtual RoutingGauge* getRoutingGauge () const = 0; 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; @@ -105,7 +110,7 @@ namespace Katabatic { friend class Configuration; public: // Constructor & Destructor. - ConfigurationConcrete ( const RoutingGauge* rg=NULL ); + ConfigurationConcrete ( const CellGauge* cg=NULL, const RoutingGauge* rg=NULL ); virtual ~ConfigurationConcrete (); virtual ConfigurationConcrete* clone () const; // Methods. @@ -114,11 +119,14 @@ namespace Katabatic { virtual size_t getDepth () const; virtual size_t getAllowedDepth () const; virtual size_t getLayerDepth ( const Layer* ) const; + virtual CellGauge* getCellGauge () const; virtual RoutingGauge* getRoutingGauge () const; 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; @@ -145,6 +153,7 @@ namespace Katabatic { const Layer* _gmetalh; const Layer* _gmetalv; const Layer* _gcontact; + CellGauge* _cg; RoutingGauge* _rg; DbU::Unit _extensionCap; float _saturateRatio; diff --git a/katabatic/src/katabatic/Constants.h b/katabatic/src/katabatic/Constants.h index a339e52a..d0afb8e1 100644 --- a/katabatic/src/katabatic/Constants.h +++ b/katabatic/src/katabatic/Constants.h @@ -1,7 +1,7 @@ // -*- mode: C++; explicit-buffer-name: "Constants.h" -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2013-2013, All Rights Reserved +// Copyright (c) UPMC 2013-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -27,8 +27,8 @@ namespace Katabatic { , KbHorizontal = 0x00000010 , KbVertical = 0x00000020 , KbWithPerpands = 0x00000040 - , KbBySource = 0x00000080 - , KbByTarget = 0x00000100 + , KbSource = 0x00000080 + , KbTarget = 0x00000100 , KbWarnOnError = 0x00000200 , KbTopology = 0x00000400 , KbGlobalSegment = 0x00000800 @@ -44,6 +44,7 @@ namespace Katabatic { , KbWithNeighbors = 0x00200000 , KbNoCheckLayer = 0x00400000 , KbHalfSlacken = 0x00800000 + , KbNoGCellShrink = 0x01000000 , KbDirectionMask = KbHorizontal|KbVertical }; @@ -72,7 +73,7 @@ namespace Katabatic { inline unsigned int perpandicularTo ( unsigned int direction ) { - switch ( direction ) { + switch ( direction & KbDirectionMask ) { case KbHorizontal: return KbVertical; case KbVertical: return KbHorizontal; } diff --git a/katabatic/src/katabatic/GridBox.h b/katabatic/src/katabatic/GridBox.h index 3296284a..aab22a3d 100644 --- a/katabatic/src/katabatic/GridBox.h +++ b/katabatic/src/katabatic/GridBox.h @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2013, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -172,14 +171,14 @@ namespace Katabatic { ) const { if ( direction & Constant::Horizontal ) { - channelMin = getYMin() + DbU::lambda( inclusive?0:0.1 ); + channelMin = getYMin() + DbU::toLambda( inclusive?0:0.1 ); channelMax = getYMax(); - channelLeft = getXMin() + DbU::lambda( inclusive?0:0.1 ); + channelLeft = getXMin() + DbU::toLambda( inclusive?0:0.1 ); channelRight = getXMax(); } else { - channelMin = getXMin() + DbU::lambda( inclusive?0:0.1 ); + channelMin = getXMin() + DbU::toLambda( inclusive?0:0.1 ); channelMax = getXMax(); - channelLeft = getYMin() + DbU::lambda( inclusive?0:0.1 ); + channelLeft = getYMin() + DbU::toLambda( inclusive?0:0.1 ); channelRight = getYMax(); } } diff --git a/katabatic/src/katabatic/KatabaticEngine.h b/katabatic/src/katabatic/KatabaticEngine.h index 7270f194..1411bc97 100644 --- a/katabatic/src/katabatic/KatabaticEngine.h +++ b/katabatic/src/katabatic/KatabaticEngine.h @@ -106,6 +106,7 @@ namespace Katabatic { inline unsigned int getFlags ( unsigned int mask ) const; inline Configuration* getKatabaticConfiguration (); virtual Configuration* getConfiguration (); + inline CellGauge* getCellGauge () const; inline RoutingGauge* getRoutingGauge () const; inline RoutingLayerGauge* getLayerGauge ( size_t depth ) const; inline const Layer* getRoutingLayer ( size_t depth ) const ; @@ -219,6 +220,7 @@ namespace Katabatic { inline void KatabaticEngine::setGlobalThreshold ( DbU::Unit threshold ) { _configuration->setGlobalThreshold(threshold); } inline unsigned int KatabaticEngine::getFlags ( unsigned int mask ) const { return _flags & mask; } inline EngineState KatabaticEngine::getState () const { return _state; } + inline CellGauge* KatabaticEngine::getCellGauge () const { return _configuration->getCellGauge(); } inline RoutingGauge* KatabaticEngine::getRoutingGauge () const { return _configuration->getRoutingGauge(); } inline RoutingLayerGauge* KatabaticEngine::getLayerGauge ( size_t depth ) const { return _configuration->getLayerGauge(depth); } inline const Layer* KatabaticEngine::getRoutingLayer ( size_t depth ) const { return _configuration->getRoutingLayer(depth); } diff --git a/katabatic/src/katabatic/Observer.h b/katabatic/src/katabatic/Observer.h index 9b942b29..b36164b9 100644 --- a/katabatic/src/katabatic/Observer.h +++ b/katabatic/src/katabatic/Observer.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/katabatic/src/katabatic/Session.h b/katabatic/src/katabatic/Session.h index 643af7f3..528f1ae4 100644 --- a/katabatic/src/katabatic/Session.h +++ b/katabatic/src/katabatic/Session.h @@ -24,6 +24,7 @@ #include #include "hurricane/Commons.h" #include "hurricane/DbU.h" +#include "crlcore/CellGauge.h" #include "crlcore/RoutingGauge.h" #include "katabatic/Constants.h" #include "katabatic/Configuration.h" @@ -82,6 +83,9 @@ namespace Katabatic { static size_t getSaturateRp (); static inline size_t getAllowedDepth (); static DbU::Unit getExtensionCap (); + static inline CellGauge* getCellGauge (); + static inline DbU::Unit getSliceHeight (); + static inline DbU::Unit getSliceStep (); static inline RoutingGauge* getRoutingGauge (); static inline RoutingLayerGauge* getLayerGauge ( size_t depth ); static inline size_t getDepth (); @@ -147,6 +151,7 @@ namespace Katabatic { static Session* _session; KatabaticEngine* _katabatic; Technology* _technology; + CellGauge* _cellGauge; RoutingGauge* _routingGauge; vector _autoContacts; vector _doglegs; @@ -170,6 +175,7 @@ namespace Katabatic { // Inline Functions. inline Technology* Session::getTechnology () { return get("getTechnology()")->_technology; } + inline CellGauge* Session::getCellGauge () { return get("getCellGauge()")->_cellGauge; } inline RoutingGauge* Session::getRoutingGauge () { return get("getRoutingGauge()")->_routingGauge; } inline bool Session::doDestroyBaseContact () { return get("doDestroyBaseContact()")->_doDestroyBaseContact(); } inline bool Session::doDestroyBaseSegment () { return get("doDestroyBaseSegment()")->_doDestroyBaseSegment(); } @@ -195,6 +201,8 @@ namespace Katabatic { inline DbU::Unit Session::getExtensionCap () { return getConfiguration()->getExtensionCap(); } inline size_t Session::getAllowedDepth () { return getConfiguration()->getAllowedDepth(); } + inline DbU::Unit Session::getSliceHeight () { return getCellGauge()->getSliceHeight(); } + inline DbU::Unit Session::getSliceStep () { return getCellGauge()->getSliceStep(); } inline RoutingLayerGauge* Session::getLayerGauge ( size_t depth ) { return getRoutingGauge()->getLayerGauge(depth); } inline size_t Session::getDepth () { return getRoutingGauge()->getDepth(); } inline size_t Session::getViaDepth ( const Layer* layer ) { return getRoutingGauge()->getViaDepth(layer); } diff --git a/kite/src/BuildPowerRails.cpp b/kite/src/BuildPowerRails.cpp index 9a09e263..51097962 100644 --- a/kite/src/BuildPowerRails.cpp +++ b/kite/src/BuildPowerRails.cpp @@ -223,16 +223,67 @@ namespace { else destroyRing( _vdde ); if (_vsse == NULL) cerr << Error("Missing net (for pads) at chip level." ) << endl; else destroyRing( _vsse ); + if (_vddi == NULL) cerr << Error("Missing / net (for pads) at top level." ) << endl; + else destroyRing( _vddi ); + if (_vssi == NULL) cerr << Error("Missing / net (for pads) at top level." ) << endl; + else destroyRing( _vssi ); if (_ck == NULL) cerr << Warning("No net at (for pads) chip level." ) << endl; if (_cki == NULL) cerr << Warning("No net at (for pads) chip level." ) << endl; else destroyRing( _cki ); + } else { + _vddiName = ""; + _vssiName = ""; + _ckoName = ""; + + forEach ( Net*, inet, topCell->getNets() ) { + Net::Type netType = inet->getType(); + if (netType == Net::Type::POWER) { + if (_vddiName.isEmpty()) { + _vddiName = inet->getName(); + _vddi = *inet; + } else { + cerr << Error("Second power supply net <%s> net at top block level will be ignored.\n" + " (will consider only <%s>)" + , getString(inet ->getName()).c_str() + , getString(_vddi->getName()).c_str() + ) << endl; + } + } + + if (netType == Net::Type::GROUND) { + if (_vssiName.isEmpty()) { + _vssiName = inet->getName(); + _vssi = *inet; + } else { + cerr << Error("Second power ground net <%s> net at top block level will be ignored.\n" + " (will consider only <%s>)" + , getString(inet ->getName()).c_str() + , getString(_vssi->getName()).c_str() + ) << endl; + } + } + + if (netType == Net::Type::CLOCK) { + if (_ckoName.isEmpty()) { + _ckoName = inet->getName(); + _cko = *inet; + } else { + cerr << Error("Second clock net <%s> net at top block level will be ignored.\n" + " (will consider only <%s>)" + , getString(inet ->getName()).c_str() + , getString(_cko->getName()).c_str() + ) << endl; + } + } + } + + if ((_vddi) == NULL) cerr << Error("Missing net at top block level." ) << endl; + else destroyRing( _vddi ); + if (_vssi == NULL) cerr << Error("Missing net at top block level." ) << endl; + else destroyRing( _vssi ); } - if (_vddi == NULL) cerr << Error("Missing / net (for pads) at top level." ) << endl; - else destroyRing( _vddi ); - if (_vssi == NULL) cerr << Error("Missing / net (for pads) at top level." ) << endl; - else destroyRing( _vssi ); - if (_cko == NULL) cparanoid << Warning("No net at top level." ) << endl; + if (_cko == NULL) cparanoid << Warning("No clock net at top level." ) << endl; } @@ -524,7 +575,7 @@ namespace { Segment* segment = NULL; DbU::Unit delta = plane->getLayerGauge()->getPitch() - plane->getLayerGauge()->getHalfWireWidth() - - DbU::lambda(0.1); + - DbU::fromLambda(0.1); DbU::Unit extension = layer->getExtentionCap(); //DbU::Unit extension = Session::getExtentionCap(); //unsigned int type = plane->getLayerGauge()->getType(); @@ -1020,8 +1071,8 @@ namespace { if ( _chipTools.isChip() and ((depth == 2) or (depth == 3)) - and (segment->getWidth () == DbU::lambda( 12.0)) - and (segment->getLength() > DbU::lambda(200.0)) + and (segment->getWidth () == DbU::fromLambda( 12.0)) + and (segment->getLength() > DbU::fromLambda(200.0)) and (_kite->getChipTools().getCorona().contains(bb)) ) { switch ( depth ) { case 2: _vRingSegments.push_back ( segment ); break; // M3 V. diff --git a/kite/src/Configuration.cpp b/kite/src/Configuration.cpp index a5927e86..7c9e8647 100644 --- a/kite/src/Configuration.cpp +++ b/kite/src/Configuration.cpp @@ -125,10 +125,22 @@ namespace Kite { { return _base->getLayerDepth(layer); } + CellGauge* Configuration::getCellGauge () const + { return _base->getCellGauge(); } + + RoutingGauge* Configuration::getRoutingGauge () const { return _base->getRoutingGauge(); } + DbU::Unit Configuration::getSliceHeight () const + { return _base->getSliceHeight(); } + + + DbU::Unit Configuration::getSliceStep () const + { return _base->getSliceStep(); } + + RoutingLayerGauge* Configuration::getLayerGauge ( size_t depth ) const { return _base->getLayerGauge(depth); } diff --git a/kite/src/DataNegociate.cpp b/kite/src/DataNegociate.cpp index 8e2f642c..d985bbca 100644 --- a/kite/src/DataNegociate.cpp +++ b/kite/src/DataNegociate.cpp @@ -125,7 +125,7 @@ namespace Kite { if (RoutingEvent::getStage() == RoutingEvent::Repair) perpandicular->base()->setFlagsOnAligneds( Katabatic::SegUnbound ); - interval.inflate( DbU::lambda(-0.5) ); + interval.inflate( DbU::fromLambda(-0.5) ); ltrace(148) << "| perpandicular: " << perpandiculars[i] << endl; ltrace(148) << "| canonical: " << perpandicular << endl; diff --git a/kite/src/GraphicKiteEngine.cpp b/kite/src/GraphicKiteEngine.cpp index 0db01d5e..ae413c28 100644 --- a/kite/src/GraphicKiteEngine.cpp +++ b/kite/src/GraphicKiteEngine.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -52,7 +51,6 @@ namespace Kite { using Hurricane::Exception; using Hurricane::Breakpoint; using Hurricane::DebugSession; - using Hurricane::UpdateSession; using Hurricane::Point; using Hurricane::Net; using Hurricane::Graphics; diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index 5401eb89..66ebcf1d 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -30,7 +30,6 @@ #include "hurricane/Instance.h" #include "hurricane/Vertical.h" #include "hurricane/Horizontal.h" -#include "hurricane/UpdateSession.h" #include "crlcore/Measures.h" #include "knik/Vertex.h" #include "knik/Edge.h" @@ -41,6 +40,7 @@ #include "kite/DataNegociate.h" #include "kite/RoutingPlane.h" #include "kite/Session.h" +#include "kite/TrackSegment.h" #include "kite/NegociateWindow.h" #include "kite/KiteEngine.h" @@ -456,6 +456,7 @@ namespace Kite { //DebugSession::addToTrace( getCell(), "acc_reg_ckx" ); //DebugSession::addToTrace( getCell(), "acc_reg_nckx" ); //DebugSession::addToTrace( getCell(), "i(0)" ); + //DebugSession::addToTrace( getCell(), "ram_nmux_0_sel0" ); //DebugSession::addToTrace( getCell(), "ram_adrb_14" ); //DebugSession::addToTrace( getCell(), "ram_adrb_9" ); //DebugSession::addToTrace( getCell(), "ram_adra(11)" ); @@ -463,7 +464,7 @@ namespace Kite { //DebugSession::addToTrace( getCell(), "ram_adrb(8)" ); //DebugSession::addToTrace( getCell(), "alu_carry(1)" ); //DebugSession::addToTrace( getCell(), "alu_np(0)" ); - //DebugSession::addToTrace( getCell(), "ram_d(3)" ); + //DebugSession::addToTrace( getCell(), "ram_q2(0)" ); //DebugSession::addToTrace( getCell(), "ram_q1(0)" ); //DebugSession::addToTrace( getCell(), "ram_i_up" ); // Test signals from (M1-VLSI). @@ -504,6 +505,7 @@ namespace Kite { //DebugSession::addToTrace( getCell(), "mips_r3000_1m_dp_mux32_s_mw_se_sel0" ); //DebugSession::addToTrace( getCell(), "mips_r3000_1m_dp_mux32_badr_sd_sel1" ); //DebugSession::addToTrace( getCell(), "mips_r3000_1m_dp_addsub32_carith_se_pi_3_21" ); + //DebugSession::addToTrace( getCell(), "mips_r3000_1m_dp_addsub32_carith_se_pi_4_26" ); //DebugSession::addToTrace( getCell(), "mips_r3000_1m_ct_cause_rx(1)" ); // Test signals from (R3000,pipeline+chip). //DebugSession::addToTrace( getCell(), "mips_r3000_core.mips_r3000_1m_dp.banc.reada0" ); @@ -552,7 +554,6 @@ namespace Kite { if (_negociateWindow) return; startMeasures(); - Session::open( this ); _negociateWindow = NegociateWindow::create( this ); @@ -564,9 +565,9 @@ namespace Kite { _negociateWindow = NULL; Session::close(); + stopMeasures(); //if ( _editor ) _editor->refresh (); - stopMeasures(); printMeasures( "algo" ); Session::open( this ); @@ -601,7 +602,7 @@ namespace Kite { TrackElement* segment = _lookup( ilut->second ); if (segment == NULL) continue; - unsigned long long wl = (unsigned long long)DbU::getLambda( segment->getLength() ); + unsigned long long wl = (unsigned long long)DbU::toLambda( segment->getLength() ); if (wl > 100000) { cerr << Error("KiteEngine::printCompletion(): Suspiciously long wire: %llu for %p:%s" ,wl,ilut->first,getString(segment).c_str()) << endl; @@ -610,6 +611,12 @@ namespace Kite { if (segment->isFixed() or segment->isBlockage()) continue; + // if (segment->isSameLayerDogleg()) { + // cerr << " Same layer:" << segment << endl; + // cerr << " S: " << segment->base()->getAutoSource() << endl; + // cerr << " T: " << segment->base()->getAutoTarget() << endl; + // } + totalWireLength += wl; if (segment->getTrack() != NULL) { routeds++; diff --git a/kite/src/KiteMain.cpp b/kite/src/KiteMain.cpp index 57e37802..c1c2a4de 100644 --- a/kite/src/KiteMain.cpp +++ b/kite/src/KiteMain.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2013, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -25,7 +25,6 @@ namespace bopts = boost::program_options; #include "hurricane/DataBase.h" #include "hurricane/Cell.h" #include "hurricane/Warning.h" -#include "hurricane/UpdateSession.h" using namespace Hurricane; #include "crlcore/Utilities.h" diff --git a/kite/src/Manipulator.cpp b/kite/src/Manipulator.cpp index 9a7ce4a3..afff592a 100644 --- a/kite/src/Manipulator.cpp +++ b/kite/src/Manipulator.cpp @@ -127,13 +127,13 @@ namespace Kite { TrackElement* neighbor = _segment->getPrevious(); if (neighbor and (neighbor->isFixed() or neighbor->isBlockage())) { - if (abs(axis - neighbor->getTargetU()) < DbU::lambda(10.0)) + if (abs(axis - neighbor->getTargetU()) < getPPitch()*2) return true; } neighbor = _segment->getNext(); if (neighbor and (neighbor->isFixed() or neighbor->isBlockage())) { - if (abs(axis - neighbor->getSourceU()) < DbU::lambda(10.0)) + if (abs(axis - neighbor->getSourceU()) < getPPitch()*2) return true; } @@ -209,8 +209,7 @@ namespace Kite { if (Manipulator(perpandiculars[i],_fsm).ripup(perpandicularActionFlags)) { if (dislodgeCaged) { - // Ugly: hard-coded uses of pitch. - _event->setAxisHint( _event->getSegment()->getAxis() + DbU::lambda(5.0) ); + _event->setAxisHint( _event->getSegment()->getAxis() + _event->getSegment()->getPitch() ); } continue; } @@ -272,7 +271,7 @@ namespace Kite { bool Manipulator::relax ( Interval interval, unsigned int flags ) { - interval.inflate( - Session::getExtensionCap() /*+ DbU::lambda(5.0)*/ ); // Ugly. + interval.inflate( - Session::getExtensionCap() ); ltrace(200) << "Manipulator::relax() of: " << _segment << " " << interval << endl; if (_segment->isFixed()) return false; @@ -451,9 +450,8 @@ namespace Kite { uside = gcells[imaxconflict+1]->getSide( _segment->getDirection() ); ltrace(200) << "GCell Edge Comparison (max): " << uside << " vs. " << DbU::getValueString(interval.getVMax()) << endl; - // Ugly: Direct uses of routing pitch. - if (interval.getVMax()+DbU::lambda(5.0) >= uside.getVMin()) { - interval.inflate( 0, DbU::fromLambda(5.0) ); + if (interval.getVMax()+getPPitch() >= uside.getVMin()) { + interval.inflate( 0, getPPitch() ); ltrace(200) << "Using next GCell " << interval << endl; imaxconflict++; } @@ -501,8 +499,7 @@ namespace Kite { doglegAxis = dogLegGCell->getSide( _segment->getDirection() ).getCenter(); //ltrace(200) << "MARK 1 doglegAxis: " << DbU::getValueString(doglegAxis) << endl; } else { - // Ugly: hardcoded pitch. - doglegAxis = interval.getVMin() - DbU::lambda(5.0); + doglegAxis = interval.getVMin() - getPPitch(); //ltrace(200) << "MARK 2 doglegAxis: " << DbU::getValueString(doglegAxis) << endl; } } else { @@ -510,8 +507,7 @@ namespace Kite { doglegAxis = dogLegGCell->getSide( _segment->getDirection() ).getVMin(); //ltrace(200) << "MARK 3 doglegAxis: " << DbU::getValueString(doglegAxis) << endl; } else { - // Ugly: hardcoded pitch (5.0 - 1.0). - doglegAxis = interval.getVMax() + DbU::lambda(4.0); + doglegAxis = interval.getVMax() + getPPitch() - DbU::fromLambda(1.0); //ltrace(200) << "MARK 4 doglegAxis: " << DbU::getValueString(doglegAxis) << endl; } } @@ -558,8 +554,7 @@ namespace Kite { if (maxExpanded) { doglegAxis = dogLegGCell->getSide(segment1->getDirection()/*,false*/).getCenter(); } else { - // Ugly: hardcoded pitch. - doglegAxis = interval.getVMax() + DbU::lambda(5.0); + doglegAxis = interval.getVMax() + getPPitch(); } if (doglegReuse2) _fsm.addAction( dogleg, SegmentAction::OtherRipup ); else dogleg->setAxis( doglegAxis ); @@ -740,7 +735,7 @@ namespace Kite { if ( shrinkRight ) { if ( not (success=Manipulator(*isegment3,_fsm) .ripup( SegmentAction::OtherRipupPerpandAndPushAside - , toFree.getVMin() - DbU::lambda(2.5) + , toFree.getVMin() - getPPitch()/2 )) ) break; @@ -755,7 +750,7 @@ namespace Kite { if ( shrinkLeft ) { if ( not (success=Manipulator(*isegment3,_fsm) .ripup( SegmentAction::OtherRipupPerpandAndPushAside - , toFree.getVMax() + DbU::lambda(2.5) + , toFree.getVMax() + getPPitch()/2 )) ) break; if ( event3->getTracksFree() == 1 ) { @@ -1033,12 +1028,12 @@ namespace Kite { if (other->getAxis() < _segment->getAxis()) { // Ugly: routing pitch. - shiftedAxisHint = otherEvent->getAxisHint() - DbU::lambda(5.0); + shiftedAxisHint = otherEvent->getAxisHint() - getPitch(); if (shiftedAxisHint < uside.getVMin()) shiftedAxisHint = uside.getVMin(); } else { // Ugly: routing pitch. - shiftedAxisHint = otherEvent->getAxisHint() + DbU::lambda(5.0); + shiftedAxisHint = otherEvent->getAxisHint() + getPitch(); if (shiftedAxisHint > uside.getVMax()) shiftedAxisHint = uside.getVMax(); } @@ -1094,7 +1089,7 @@ namespace Kite { if (_segment->isLocal()) { if (not _segment->canPivotUp(0.5)) return false; } else { - if (_segment->getLength() < DbU::lambda(100.0)) { + if (_segment->getLength() < 20*getPitch()) { if (not (flags & AllowShortPivotUp)) return false; if (not _segment->canPivotUp(1.0)) return false; } @@ -1113,7 +1108,7 @@ namespace Kite { if ( _segment->isFixed()) return false; if (not _segment->isLocal()) return false; - if (_segment->getLength() < 5*DbU::lambda(5.0)) return false; + if (_segment->getLength() < 5*getPitch()) return false; if (_fsm.getCosts().size()) { Track* track = _fsm.getTrack(0); diff --git a/kite/src/PreProcess.cpp b/kite/src/PreProcess.cpp index 3afe513a..75e89924 100644 --- a/kite/src/PreProcess.cpp +++ b/kite/src/PreProcess.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 | @@ -243,20 +242,21 @@ namespace { for ( size_t i=0 ; igetSize() ; ++i ) { TrackElement* segment = track->getSegment(i); if ( segment and segment->isFixed() and segment->isTerminal() ) { - Interval freeInterval = track->getFreeInterval( segment->getSourceU(), segment->getNet() ); + Interval freeInterval = track->getFreeInterval( segment->getSourceU(), segment->getNet() ); + DbU::Unit ppitch = segment->getPPitch(); - //if (freeInterval.getSize() < DbU::lambda(5.0)*6) { - if ( (segment->getSourceU() - freeInterval.getVMin() < DbU::lambda(5.0)*3) - or (freeInterval.getVMax() - segment->getTargetU() < DbU::lambda(5.0)*3) ) { + //if (freeInterval.getSize() < ppitch*6) { + if ( (segment->getSourceU() - freeInterval.getVMin() < ppitch*3) + or (freeInterval.getVMax() - segment->getTargetU() < ppitch*3) ) { cinfo << "Caged terminal: " << segment << endl; - if ( (segment->getLayer() != metal2) - or (segment->getLength() >= DbU::lambda(5.0)) - or (segment->getNet() == neighborNet) ) { + if ( (segment->getLayer () != metal2) + or (segment->getLength() >= ppitch) + or (segment->getNet () == neighborNet) ) { neighborNet = segment->getNet(); continue; } - if (segment->getSourceU() - lastMovedUp < DbU::lambda(5.0)*4) { + if (segment->getSourceU() - lastMovedUp < ppitch*4) { ++moveUpCount; if (moveUpCount % 2 == 0) { moveUpCaged( segment ); @@ -274,7 +274,7 @@ namespace { , rp , metal3 , rp->getSourcePosition() - , DbU::lambda(1.0), DbU::lambda(1.0) + , DbU::fromLambda(1.0), DbU::fromLambda(1.0) ); source->setFlags( Katabatic::CntIgnoreAnchor ); @@ -283,7 +283,7 @@ namespace { , rp , metal3 , rp->getSourcePosition() - , DbU::lambda(1.0), DbU::lambda(1.0) + , DbU::fromLambda(1.0), DbU::fromLambda(1.0) ); target->setFlags( Katabatic::CntIgnoreAnchor ); diff --git a/kite/src/ProtectRoutingPads.cpp b/kite/src/ProtectRoutingPads.cpp index 90926c42..77d35245 100644 --- a/kite/src/ProtectRoutingPads.cpp +++ b/kite/src/ProtectRoutingPads.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 | @@ -98,7 +97,7 @@ namespace { DbU::Unit wireWidth = plane->getLayerGauge()->getWireWidth(); DbU::Unit delta = plane->getLayerGauge()->getHalfPitch() + wireWidth/2 - - DbU::lambda(0.1); + - DbU::fromLambda(0.1); DbU::Unit extension = segments[i]->getLayer()->getExtentionCap(); Box bb ( segments[i]->getBoundingBox() ); diff --git a/kite/src/RoutingEvent.cpp b/kite/src/RoutingEvent.cpp index b9c9d89b..73b1f1d1 100644 --- a/kite/src/RoutingEvent.cpp +++ b/kite/src/RoutingEvent.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 | @@ -617,8 +616,7 @@ namespace Kite { ltrace(200) << "Not expanding on Terminals:" << _constraints << endl; } else { ltrace(200) << "Expanding:" << _constraints << endl; - // Ugly: direct uses of Cell Gauge. - _constraints.inflate( DbU::lambda(50.0) ); + _constraints.inflate( Session::getSliceHeight() ); ltrace(200) << "Expanding (after):" << _constraints << endl; } } @@ -655,8 +653,8 @@ namespace Kite { } _priority - = (DbU::getLambda(_segment->getLength()) + 1.0) - * (DbU::getLambda(_segment->base()->getSlack()) + 1.0); + = (DbU::toLambda(_segment->getLength()) + 1.0) + * (DbU::toLambda(_segment->base()->getSlack()) + 1.0); ltrace(200) << _segment << " has " << _tracksNb << " choices " << perpandicular << endl; ltraceout(200); diff --git a/kite/src/RoutingPlane.cpp b/kite/src/RoutingPlane.cpp index 3c45faf0..00c929c9 100644 --- a/kite/src/RoutingPlane.cpp +++ b/kite/src/RoutingPlane.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 | @@ -100,18 +99,27 @@ namespace Kite { if (not plane->_layerGauge) throw Error( badLayerGauge, depth, getString(kite->getRoutingGauge()).c_str() ); + DbU::Unit hExtension = 0; + DbU::Unit vExtension = 0; + unsigned int 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; + size_t trackNumber; Box abutmentBox = kite->getCell()->getAbutmentBox(); // HARD CODED. if (plane->getDirection() == KbHorizontal) { - plane->_trackMin = abutmentBox.getXMin() - DbU::lambda(2.0); - plane->_trackMax = abutmentBox.getXMax() + DbU::lambda(2.0); + plane->_trackMin = abutmentBox.getXMin() - hExtension; + plane->_trackMax = abutmentBox.getXMax() + hExtension; plane->_axisMin = abutmentBox.getYMin(); plane->_axisMax = abutmentBox.getYMax(); trackNumber = plane->computeTracksSize(); } else { - plane->_trackMin = abutmentBox.getYMin() - DbU::lambda(2.0); - plane->_trackMax = abutmentBox.getYMax() + DbU::lambda(2.0); + plane->_trackMin = abutmentBox.getYMin() - vExtension; + plane->_trackMax = abutmentBox.getYMax() + vExtension; plane->_axisMin = abutmentBox.getXMin(); plane->_axisMax = abutmentBox.getXMax(); trackNumber = plane->computeTracksSize(); diff --git a/kite/src/SegmentFsm.cpp b/kite/src/SegmentFsm.cpp index 93902fa9..b48d2a66 100644 --- a/kite/src/SegmentFsm.cpp +++ b/kite/src/SegmentFsm.cpp @@ -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 | @@ -41,7 +41,7 @@ namespace { class Cs1Candidate { public: - inline Cs1Candidate ( Track* track=NULL ); + inline Cs1Candidate ( Track* track=NULL, DbU::Unit ppitch=0 ); inline Track* getTrack () const; inline size_t getBegin () const; inline size_t getEnd () const; @@ -58,6 +58,7 @@ namespace { friend inline bool operator< ( const Cs1Candidate&, const Cs1Candidate& ); private: Track* _track; + DbU::Unit _ppitch; size_t _begin; size_t _end; vector _conflicts; @@ -67,8 +68,9 @@ namespace { }; - inline Cs1Candidate::Cs1Candidate ( Track* track ) + inline Cs1Candidate::Cs1Candidate ( Track* track, DbU::Unit ppitch ) : _track (track) + , _ppitch (ppitch) , _begin (0) , _end (0) , _conflicts () @@ -123,7 +125,7 @@ namespace { } // Ugly: hard-coded pitch. - _breakPos = _conflicts[i].getVMin() - DbU::lambda(5.0); + _breakPos = _conflicts[i].getVMin() - _ppitch; } } @@ -742,7 +744,7 @@ namespace Kite { } for ( ; track and track->getAxis() <= constraints.getVMax() ; track = track->getNextTrack() ) { - candidates.push_back( Cs1Candidate(track) ); + candidates.push_back( Cs1Candidate(track,segment->getPPitch()) ); size_t begin; size_t end; diff --git a/kite/src/Session.cpp b/kite/src/Session.cpp index b6e6c2ff..de3fcf42 100644 --- a/kite/src/Session.cpp +++ b/kite/src/Session.cpp @@ -1,7 +1,7 @@ // -*- mode: C++; explicit-buffer-name: "Session.cpp" -*- // // 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 | @@ -205,6 +205,10 @@ namespace Kite { for ( set::iterator it=packTracks.begin() ; it != packTracks.end() ; ++it ) (*it)->check( overlaps, "Session::_revalidate() - on packed track." ); + for ( size_t i=0 ; i_check(); + } + //_getKiteEngine()->_showOverlap (); # endif diff --git a/kite/src/Track.cpp b/kite/src/Track.cpp index 24436d37..46c9be43 100644 --- a/kite/src/Track.cpp +++ b/kite/src/Track.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 | diff --git a/kite/src/TrackCost.cpp b/kite/src/TrackCost.cpp index b3eb0a7d..32977312 100644 --- a/kite/src/TrackCost.cpp +++ b/kite/src/TrackCost.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 | @@ -58,17 +57,20 @@ namespace Kite { , _deltaShared (0) , _deltaPerpand (0) , _axisWeight (0) - , _distanceToFixed(DbU::lambda(100.0)) + , _distanceToFixed(2*Session::getSliceHeight()) , _longuestOverlap(0) , _dataState (0) , _ripupCount (0) { + // This is the GCell side (it is *one* cell height from the gauge). + DbU::Unit cellHeight = Session::getSliceHeight(); + TrackElement* neighbor; if ( _begin != Track::npos ) { neighbor = _track->getSegment(_begin); if ( neighbor and (neighbor->getNet() != net) ) { DbU::Unit distance = interval.getVMin() - neighbor->getTargetU(); - if ( distance < DbU::lambda(50.0) ) + if ( distance < cellHeight ) _distanceToFixed = distance; } // if ( neighbor and neighbor->isFixed() ) { @@ -80,8 +82,8 @@ namespace Kite { neighbor = _track->getSegment(_end); if ( neighbor and (neighbor->getNet() != net) ) { DbU::Unit distance = neighbor->getSourceU() - interval.getVMax(); - if ( _distanceToFixed == DbU::lambda(100.0) ) _distanceToFixed = 0; - if ( distance < DbU::lambda(50.0) ) + if ( _distanceToFixed == 2*cellHeight ) _distanceToFixed = 0; + if ( distance < cellHeight ) _distanceToFixed += distance; } // if ( neighbor and neighbor->isFixed() ) { diff --git a/kite/src/TrackElement.cpp b/kite/src/TrackElement.cpp index def2196a..4a7991f4 100644 --- a/kite/src/TrackElement.cpp +++ b/kite/src/TrackElement.cpp @@ -102,20 +102,23 @@ namespace Kite { void SegmentObserver::notify ( unsigned int flags ) { TrackElement* segment = getOwner(); - switch ( flags ) { - case AutoSegment::Invalidate: - if (not segment->isInvalidated()) { - ltrace(200) << "::notify() on " << segment << endl; - segment->invalidate(); - } - break; - case AutoSegment::Revalidate: - // Revalidation must be delayed until *all* the AutoSegments have been revalidated. - // if (segment->isInvalidated()) { - // ltrace(200) << "::notify() on " << segment << endl; - // segment->revalidate( true ); - // } - break; + if (flags & AutoSegment::Invalidate) { + if (not segment->isInvalidated()) { + ltrace(200) << "::notify() on " << segment << endl; + segment->invalidate(); + } + } + + if (flags & AutoSegment::Revalidate) { + // Revalidation must be delayed until *all* the AutoSegments have been revalidated. + // if (segment->isInvalidated()) { + // ltrace(200) << "::notify() on " << segment << endl; + // segment->revalidate( true ); + // } + } + + if (flags & AutoSegment::RevalidatePPitch) { + segment->updatePPitch(); } } @@ -146,6 +149,7 @@ namespace Kite { bool TrackElement::isStrap () const { return false; } bool TrackElement::isSlackened () const { return false; } bool TrackElement::isDogleg () const { return false; } + bool TrackElement::isSameLayerDogleg () const { return false; } // Predicates. bool TrackElement::canSlacken () const { return false; } bool TrackElement::canPivotUp ( float ) const { return false; }; @@ -157,6 +161,8 @@ namespace Kite { // Accessors. unsigned long TrackElement::getId () const { return 0; } unsigned long TrackElement::getFreedomDegree () const { return 0; } + DbU::Unit TrackElement::getPitch () const { return 0; } + DbU::Unit TrackElement::getPPitch () const { return 0; } float TrackElement::getMaxUnderDensity ( unsigned int ) const { return 0.0; }; unsigned int TrackElement::getDoglegLevel () const { return 0; } TrackElement* TrackElement::getParent () const { return NULL; } @@ -176,6 +182,7 @@ namespace Kite { void TrackElement::reschedule ( unsigned int ) { } void TrackElement::detach () { } void TrackElement::revalidate () { } + void TrackElement::updatePPitch () { } void TrackElement::setAxis ( DbU::Unit, unsigned int flags ) { } TrackElement* TrackElement::makeDogleg () { return NULL; } TrackElement* TrackElement::makeDogleg ( Interval, unsigned int& ) { return NULL; } diff --git a/kite/src/TrackMarker.cpp b/kite/src/TrackMarker.cpp index 09cf8acf..cb1d4f40 100644 --- a/kite/src/TrackMarker.cpp +++ b/kite/src/TrackMarker.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 | @@ -65,8 +64,9 @@ namespace Kite { { Point sourcePoint = pad->getSourcePosition(); Point targetPoint = pad->getTargetPosition(); - RoutingGauge* rg = Session::getKiteEngine()->getRoutingGauge(); + RoutingGauge* rg = Session::getRoutingGauge(); RoutingPlane* rp = Session::getKiteEngine()->getRoutingPlaneByIndex(depth); + DbU::Unit pitch = DbU::toLambda(Session::getPitch(depth)); unsigned int rpDirection = rg->getLayerDirection(depth); Interval trackSpan; @@ -81,9 +81,9 @@ namespace Kite { } if ( rpDirection xor rg->getLayerDirection(rg->getLayerDepth(pad->getLayer())) ) { - _weight = (unsigned int)(( 5.0 / (5.0+DbU::getLambda(trackSpan.getSize())) ) * 100.0) ; + _weight = (unsigned int)(( pitch / (pitch+DbU::toLambda(trackSpan.getSize())) ) * 100.0) ; } else { - _weight = (unsigned int)( (5.0 + DbU::getLambda(trackSpan.getSize())) * 20.0 ); + _weight = (unsigned int)( (pitch + DbU::toLambda(trackSpan.getSize())) * 20.0 ); } Track* track = rp->getTrackByPosition ( trackSpan.getVMin() ); diff --git a/kite/src/TrackSegment.cpp b/kite/src/TrackSegment.cpp index 729bb58f..5ad4fec5 100644 --- a/kite/src/TrackSegment.cpp +++ b/kite/src/TrackSegment.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 | @@ -53,11 +52,18 @@ namespace Kite { // ------------------------------------------------------------------- // Class : "TrackSegment". + size_t TrackSegment::_allocateds = 0; + + + size_t TrackSegment::getAllocateds () + { return _allocateds; } + TrackSegment::TrackSegment ( AutoSegment* segment, Track* track ) : TrackElement (track) , _base (segment) , _freedomDegree(0) + , _ppitch (0) , _data (NULL) , _dogLegLevel (0) { @@ -69,7 +75,10 @@ namespace Kite { _data = new DataNegociate( this ); _base->getCanonical( _sourceU, _targetU ); updateFreedomDegree(); + updatePPitch(); } + + ++_allocateds; } @@ -83,6 +92,7 @@ namespace Kite { TrackSegment::~TrackSegment () { if (_data) delete _data; + --_allocateds; } @@ -131,12 +141,15 @@ namespace Kite { bool TrackSegment::isStrap () const { return _base->isStrap(); } bool TrackSegment::isSlackened () const { return _base->isSlackened(); } bool TrackSegment::isDogleg () const { return _base->isDogleg(); } + bool TrackSegment::isSameLayerDogleg () const { return _base->isSameLayerDogleg(); } // Predicates. // Accessors. unsigned long TrackSegment::getId () const { return _base->getId(); } unsigned int TrackSegment::getDirection () const { return _base->getDirection(); } Net* TrackSegment::getNet () const { return _base->getNet(); } 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::getAxis () const { return _base->getAxis(); } unsigned long TrackSegment::getFreedomDegree () const { return _freedomDegree; } unsigned int TrackSegment::getDoglegLevel () const { return _dogLegLevel; } @@ -277,6 +290,13 @@ namespace Kite { { _freedomDegree = _base->getSlack(); } + void TrackSegment::updatePPitch () + { + _ppitch = _base->getPPitch(); + //cerr << "Update P/Pitch (" << DbU::toLambda(getPPitch()) << ") on " << this << endl; + } + + void TrackSegment::setTrack ( Track* track ) { TrackElement::setTrack( track ); } diff --git a/kite/src/TrackSegmentCost.cpp b/kite/src/TrackSegmentCost.cpp index 00124a5d..3e64719d 100644 --- a/kite/src/TrackSegmentCost.cpp +++ b/kite/src/TrackSegmentCost.cpp @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2013, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | diff --git a/kite/src/kite/Configuration.h b/kite/src/kite/Configuration.h index e4997406..5a30660c 100644 --- a/kite/src/kite/Configuration.h +++ b/kite/src/kite/Configuration.h @@ -28,6 +28,7 @@ namespace Kite { using Hurricane::Layer; using Hurricane::DbU; using Hurricane::Cell; + using CRL::CellGauge; using CRL::RoutingGauge; using CRL::RoutingLayerGauge; @@ -59,7 +60,10 @@ namespace Kite { virtual bool isGContact ( const Layer* ) const; virtual size_t getDepth () const; virtual size_t getAllowedDepth () const; + virtual DbU::Unit getSliceHeight () const; + virtual DbU::Unit getSliceStep () const; virtual size_t getLayerDepth ( const Layer* ) const; + virtual CellGauge* getCellGauge () const; virtual RoutingGauge* getRoutingGauge () const; virtual RoutingLayerGauge* getLayerGauge ( size_t depth ) const; virtual const Layer* getRoutingLayer ( size_t depth ) const; diff --git a/kite/src/kite/Constants.h b/kite/src/kite/Constants.h index 8d6bfa0f..dd3479fa 100644 --- a/kite/src/kite/Constants.h +++ b/kite/src/kite/Constants.h @@ -1,7 +1,7 @@ // -*- mode: C++; explicit-buffer-name: "Constants.h" -*- // // 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 | @@ -28,8 +28,8 @@ namespace Kite { using Katabatic::KbHorizontal; using Katabatic::KbVertical; using Katabatic::KbWithPerpands; - using Katabatic::KbBySource; - using Katabatic::KbByTarget; + using Katabatic::KbSource; + using Katabatic::KbTarget; using Katabatic::KbWarnOnError; using Katabatic::perpandicularTo; diff --git a/kite/src/kite/Manipulator.h b/kite/src/kite/Manipulator.h index 80dc08bd..fef6680e 100644 --- a/kite/src/kite/Manipulator.h +++ b/kite/src/kite/Manipulator.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 | @@ -56,6 +56,8 @@ namespace Kite { inline TrackElement* getSegment () const; inline DataNegociate* getData () const; inline RoutingEvent* getEvent () const; + inline DbU::Unit getPitch () const; + inline DbU::Unit getPPitch () const; bool canRipup ( unsigned int flags=0 ) const; bool isCaged ( DbU::Unit ) const; bool ripup ( unsigned int type, DbU::Unit axisHint=0 ); @@ -91,6 +93,8 @@ namespace Kite { inline TrackElement* Manipulator::getSegment () const { return _segment; } inline DataNegociate* Manipulator::getData () const { return _data; } inline RoutingEvent* Manipulator::getEvent () const { return _event; } + inline DbU::Unit Manipulator::getPitch () const { return _segment->getPitch(); } + inline DbU::Unit Manipulator::getPPitch () const { return _segment->getPPitch(); } } // Kite namespace. diff --git a/kite/src/kite/Session.h b/kite/src/kite/Session.h index 232eef66..c3357296 100644 --- a/kite/src/kite/Session.h +++ b/kite/src/kite/Session.h @@ -1,7 +1,7 @@ // -*- mode: C++; explicit-buffer-name: "Session.h" -*- // // 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/kite/src/kite/TrackElement.h b/kite/src/kite/TrackElement.h index 9b47d9fc..f8d82323 100644 --- a/kite/src/kite/TrackElement.h +++ b/kite/src/kite/TrackElement.h @@ -116,6 +116,7 @@ namespace Kite { virtual bool isStrap () const; virtual bool isSlackened () const; virtual bool isDogleg () const; + virtual bool isSameLayerDogleg () const; // Predicates. inline bool isCreated () const; inline bool isInvalidated () const; @@ -138,6 +139,8 @@ namespace Kite { virtual unsigned int getDirection () const = 0; virtual Net* getNet () const = 0; virtual const Layer* getLayer () const = 0; + virtual DbU::Unit getPitch () const; + virtual DbU::Unit getPPitch () const; inline Track* getTrack () const; inline size_t getIndex () const; virtual unsigned long getFreedomDegree () const; @@ -171,8 +174,9 @@ namespace Kite { virtual void swapTrack ( TrackElement* ); virtual void reschedule ( unsigned int level ); virtual void detach (); - virtual void revalidate (); virtual void invalidate (); + virtual void revalidate (); + virtual void updatePPitch (); virtual void incOverlapCost ( Net*, TrackCost& ) const; virtual void setAxis ( DbU::Unit, unsigned int flags=Katabatic::SegAxisSet ); virtual TrackElement* makeDogleg (); diff --git a/kite/src/kite/TrackSegment.h b/kite/src/kite/TrackSegment.h index 1b6679ce..4235d6db 100644 --- a/kite/src/kite/TrackSegment.h +++ b/kite/src/kite/TrackSegment.h @@ -52,6 +52,7 @@ namespace Kite { public: static TrackElement* create ( AutoSegment*, Track*, bool& created ); + static size_t getAllocateds (); public: // Wrapped AutoSegment Functions (when applicable). virtual AutoSegment* base () const; @@ -66,6 +67,7 @@ namespace Kite { virtual bool isStrap () const; virtual bool isSlackened () const; virtual bool isDogleg () const; + virtual bool isSameLayerDogleg () const; // Predicates. virtual bool canDogleg (); virtual bool canDogleg ( Interval ); @@ -79,6 +81,8 @@ namespace Kite { virtual unsigned int getDirection () const; virtual Net* getNet () const; virtual const Layer* getLayer () const; + virtual DbU::Unit getPitch () const; + virtual DbU::Unit getPPitch () const; virtual unsigned long getFreedomDegree () const; virtual unsigned int getDoglegLevel () const; virtual TrackElement* getNext () const; @@ -102,8 +106,9 @@ namespace Kite { virtual void swapTrack ( TrackElement* ); virtual void reschedule ( unsigned int level ); virtual void detach (); - virtual void revalidate (); virtual void invalidate (); + virtual void revalidate (); + virtual void updatePPitch (); virtual void setAxis ( DbU::Unit, unsigned int flags ); virtual TrackElement* makeDogleg (); virtual TrackElement* makeDogleg ( Katabatic::GCell*, TrackElement*& perpandicular, TrackElement*& parallel ); @@ -123,10 +128,12 @@ namespace Kite { protected: // Attributes. - AutoSegment* _base; - unsigned long _freedomDegree; - DataNegociate* _data; - unsigned int _dogLegLevel:4; + static size_t _allocateds; + AutoSegment* _base; + unsigned long _freedomDegree; + DbU::Unit _ppitch; + DataNegociate* _data; + unsigned int _dogLegLevel:4; protected: // Constructors & Destructors. diff --git a/mauka/src/Configuration.cpp b/mauka/src/Configuration.cpp index aaebb156..f3a73023 100644 --- a/mauka/src/Configuration.cpp +++ b/mauka/src/Configuration.cpp @@ -14,14 +14,13 @@ // +-----------------------------------------------------------------+ -#include -#include - -#include "vlsisapd/configuration/Configuration.h" -#include "hurricane/Cell.h" -#include "crlcore/Utilities.h" -#include "crlcore/AllianceFramework.h" -#include "mauka/Configuration.h" +#include +#include +#include "vlsisapd/configuration/Configuration.h" +#include "hurricane/Cell.h" +#include "crlcore/Utilities.h" +#include "crlcore/AllianceFramework.h" +#include "mauka/Configuration.h"