From 2ca9e162ef3f0ae4ea3326329dfad488f5d7acdf Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 11 Dec 2021 19:51:24 +0100 Subject: [PATCH] Allow the detailed routing to be build from non-bottom P&R layers. * New: In Anabatic::AutoSegment::create(), allow the created segment to be in any supported routing layer, and not only the bottom H & V. Modifications impact the *two* overload of the function. * Change: In Anabatic::NetBuilderHV::doRp_AutoContacts(), for punctual METAL1, the protection has to be in METAL2. Bump the layer depth to correctly use the updated verstion of AutoSegment::create(). * Change: In AnabaticEngine::checkPlacement(), for the Pin, check that it's layer is in the routing gauge before anything else. * New: In Katana::NegociateWindow::createTrackSegment(), if the track nearest the segment axis (refTrack) do not exists, call a breakpoint just before crashing. --- anabatic/src/AnabaticEngine.cpp | 102 +++++++++++++++++--------------- anabatic/src/AutoSegment.cpp | 17 +++++- anabatic/src/NetBuilderHV.cpp | 3 +- katabatic/src/LoadGrByNet.cpp | 2 +- katana/src/NegociateWindow.cpp | 5 ++ 5 files changed, 77 insertions(+), 52 deletions(-) diff --git a/anabatic/src/AnabaticEngine.cpp b/anabatic/src/AnabaticEngine.cpp index a9bc8df9..d39e8d44 100644 --- a/anabatic/src/AnabaticEngine.cpp +++ b/anabatic/src/AnabaticEngine.cpp @@ -615,6 +615,7 @@ namespace Anabatic { } } + RoutingGauge* rg = getConfiguration()->getRoutingGauge(); size_t errorCount = 0; ostringstream errors; errors << "AnabaticEngine::checkPlacement():\n"; @@ -626,55 +627,62 @@ namespace Anabatic { ostringstream pinError; - Point pinCenter = rp->getCenter(); - if ( (pin->getAccessDirection() == Pin::AccessDirection::NORTH) - or (pin->getAccessDirection() == Pin::AccessDirection::SOUTH) ) { - if (pin->getLayer() != getConfiguration()->getDVerticalLayer()) { - pinError << " Should be in vertical routing layer, " - << "pin:" << pin->getLayer()->getName() - << " vs gauge:" << getConfiguration()->getDVerticalLayer()->getName() - << "\n"; - valid = false; - ++errorCount; - } - if ((pinCenter.getX() - getCell()->getAbutmentBox().getXMin() - - getConfiguration()->getDVerticalOffset()) - % getConfiguration()->getDVerticalPitch()) { - pinError << " Misaligned, " - << "pin:" << DbU::getValueString(pinCenter.getX()) - << " vs gauge, pitch:" << DbU::getValueString(getConfiguration()->getDVerticalPitch ()) - << ", offset:" << DbU::getValueString(getConfiguration()->getDVerticalOffset()) - << "\n"; - valid = false; - ++errorCount; - } - } + RoutingLayerGauge* lg = rg->getLayerGauge( pin->getLayer() ); + if (not lg) { + pinError << " Layer not in the routing gauge, " + << "pin:" << pin->getLayer()->getName() + << "\n"; + valid = false; + ++errorCount; + } else { + Point pinCenter = rp->getCenter(); + if ( (pin->getAccessDirection() == Pin::AccessDirection::NORTH) + or (pin->getAccessDirection() == Pin::AccessDirection::SOUTH) ) { + if (not lg->isVertical()) { + pinError << " Should be in vertical routing layer, " + << "pin:" << pin->getLayer()->getName() + << " vs gauge:" << lg->getLayer()->getName() + << "\n"; + valid = false; + ++errorCount; + } + if ((pinCenter.getX() - getCell()->getAbutmentBox().getXMin() - lg->getOffset()) + % lg->getPitch()) { + pinError << " Misaligned, " + << "pin:" << DbU::getValueString(pinCenter.getX()) + << " vs gauge, pitch:" << DbU::getValueString(lg->getPitch ()) + << ", offset:" << DbU::getValueString(lg->getOffset()) + << "\n"; + valid = false; + ++errorCount; + } + } - if ( (pin->getAccessDirection() == Pin::AccessDirection::EAST) - or (pin->getAccessDirection() == Pin::AccessDirection::WEST) ) { - if (pin->getLayer() != getConfiguration()->getDHorizontalLayer()) { - pinError << " Should be in horizontal routing layer, " - << "pin:" << pin->getLayer()->getName() - << " vs gauge:" << getConfiguration()->getDHorizontalLayer()->getName() - << "\n"; - valid = false; - ++errorCount; - } - if ((pinCenter.getY() - getCell()->getAbutmentBox().getYMin() - - getConfiguration()->getDHorizontalOffset()) - % getConfiguration()->getDHorizontalPitch()) { - pinError << " Misaligned, " - << "pin:" << DbU::getValueString(pinCenter.getY()) - << " vs gauge, pitch:" << DbU::getValueString(getConfiguration()->getDHorizontalPitch ()) - << ", offset:" << DbU::getValueString(getConfiguration()->getDHorizontalOffset()) - << "\n"; - valid = false; - ++errorCount; - } - } + if ( (pin->getAccessDirection() == Pin::AccessDirection::EAST) + or (pin->getAccessDirection() == Pin::AccessDirection::WEST) ) { + if (not lg->isHorizontal()) { + pinError << " Should be in horizontal routing layer, " + << "pin:" << pin->getLayer()->getName() + << " vs gauge:" << lg->getLayer()->getName() + << "\n"; + valid = false; + ++errorCount; + } + if ((pinCenter.getY() - getCell()->getAbutmentBox().getYMin() - lg->getOffset()) + % lg->getPitch()) { + pinError << " Misaligned, " + << "pin:" << DbU::getValueString(pinCenter.getY()) + << " vs gauge, pitch:" << DbU::getValueString(lg->getPitch ()) + << ", offset:" << DbU::getValueString(lg->getOffset()) + << "\n"; + valid = false; + ++errorCount; + } + } - if (not pinError.str().empty()) { - errors << "On " << pin << "\n" << pinError.str(); + if (not pinError.str().empty()) { + errors << "On " << pin << "\n" << pinError.str(); + } } } } diff --git a/anabatic/src/AutoSegment.cpp b/anabatic/src/AutoSegment.cpp index 9d0be15a..5e487408 100644 --- a/anabatic/src/AutoSegment.cpp +++ b/anabatic/src/AutoSegment.cpp @@ -2770,10 +2770,23 @@ namespace Anabatic { , Segment* hurricaneSegment ) { + Horizontal* horizontal = dynamic_cast( hurricaneSegment ); + Vertical* vertical = dynamic_cast( hurricaneSegment ); + const Layer* horizontalLayer = Session::getDHorizontalLayer(); DbU::Unit horizontalWidth = Session::getDHorizontalWidth(); const Layer* verticalLayer = Session::getDVerticalLayer(); DbU::Unit verticalWidth = Session::getDVerticalWidth(); + if (not Session::getAnabatic()->getConfiguration()->isGMetal(hurricaneSegment->getLayer())) { + size_t depth = Session::getAnabatic()->getConfiguration()->getLayerDepth( hurricaneSegment->getLayer() ); + if (depth > 2) { + horizontalLayer = verticalLayer = hurricaneSegment->getLayer(); + horizontalWidth = Session::getAnabatic()->getConfiguration()->getWireWidth( depth ); + verticalWidth = Session::getAnabatic()->getConfiguration()->getPWireWidth( depth ); + if (vertical) + std::swap( horizontalWidth, verticalWidth ); + } + } uint32_t wPitch = NetRoutingExtension::getWPitch( source->getNet() ); if (wPitch > 1) { @@ -2788,9 +2801,7 @@ namespace Anabatic { bool reattachSource = false; bool reattachTarget = false; - AutoSegment* segment; - Horizontal* horizontal = dynamic_cast( hurricaneSegment ); - Vertical* vertical = dynamic_cast( hurricaneSegment ); + AutoSegment* segment = NULL; AutoContact* reference = NULL; cdebug_log(149,0) << "Source:" << source << endl; diff --git a/anabatic/src/NetBuilderHV.cpp b/anabatic/src/NetBuilderHV.cpp index 76f2ef40..5565a334 100644 --- a/anabatic/src/NetBuilderHV.cpp +++ b/anabatic/src/NetBuilderHV.cpp @@ -170,7 +170,8 @@ namespace Anabatic { sourceProtect->setFlags( CntFixed ); targetProtect->setFlags( CntFixed ); - AutoSegment* segment = AutoSegment::create( sourceProtect, targetProtect, direction ); + if (rpDepth == 0) rpDepth = 1; + AutoSegment* segment = AutoSegment::create( sourceProtect, targetProtect, direction, rpDepth ); segment->setFlags( AutoSegment::SegFixed ); getRpLookup().insert( make_pair(rp,segment) ); diff --git a/katabatic/src/LoadGrByNet.cpp b/katabatic/src/LoadGrByNet.cpp index 665f9bef..2f59b0c1 100644 --- a/katabatic/src/LoadGrByNet.cpp +++ b/katabatic/src/LoadGrByNet.cpp @@ -2037,7 +2037,7 @@ namespace Katabatic { void KatabaticEngine::_loadGrByNet () { cmess1 << " o Loading Nets global routing from Knik." << endl; - cmess1 << Dots::asDouble(" - Saturation",getMeasure("Sat.")) << endl; + cmess1 << Dots::asDouble(" - Saturation",*getMeasure("Sat.")) << endl; startMeasures(); Session::open( this ); diff --git a/katana/src/NegociateWindow.cpp b/katana/src/NegociateWindow.cpp index 14b959c5..4ca865d1 100644 --- a/katana/src/NegociateWindow.cpp +++ b/katana/src/NegociateWindow.cpp @@ -334,6 +334,11 @@ namespace Katana { Interval fixedSpan; Interval blockageSpan; + if (not refTrack) { + string message = "NULL refTrack for " + getString(autoSegment); + Breakpoint::stop( 0, message ); + } + if (refTrack->getAxis() != autoSegment->getAxis()) { trackSpan = 2; refTrack = plane->getTrackByPosition( autoSegment->getAxis(), Constant::Inferior );