From 8f0a8e5a3a399dc14ba904e10cf1d3013d1b78ca Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 30 Sep 2020 11:55:39 +0200 Subject: [PATCH] Added support for loading user defined global routing in Anabatic. * New: In Hurricane::NetRoutingProperty, add and change the meaning of the following flags: - ManualGlobalRoute : now means that a global routing *trunk* is present, made of "gmetalh", "gmetalv" & "gcontact". - Manualdetailroute : added, get the former meaning of ManualGlobalRoute, that is, the detailed routing is already present for this net, but can be changed by the detailed router. Implies that it respect the Terminal, HTee & VTee structuration. * New: Add Anabatic::Diskstra::loadFixedGlobal(), to account a manually global net into the edges capacities. * New: In Anabatic::Edges::ripup(), exclude manually global routed segments from the ripup. Change the segment sorting function so that thoses segments are put in head of list (considered as "smaller"). * Change: In AnabaticEngine::setupPreRouteds(), now detect manual global routed and manual detail routed signals, and tag them accordingly. * New: In AnabaticEngine::Configuration & Session, add proxies for the global routing layers ("gmetalh", "gmetalv", "gcontact"). * New: In Anabatic::Constants, add flags for global fixed and detail routed nets. * Change: In KatanaEngine::updateEstimateDensity(), now use int64_t for flute coordinates. * New: Add CRL::RoutingGauge::hasLayer(), to know if a layer is managed by the gauge (comparison by mask). --- anabatic/src/AnabaticEngine.cpp | 3 +- anabatic/src/AutoHorizontal.cpp | 8 ++ anabatic/src/Constants.cpp | 6 +- anabatic/src/Dijkstra.cpp | 42 ++++++ anabatic/src/Edge.cpp | 21 ++- anabatic/src/PreRouteds.cpp | 89 ++++++++---- anabatic/src/anabatic/AnabaticEngine.h | 12 +- anabatic/src/anabatic/Configuration.h | 2 + anabatic/src/anabatic/Constants.h | 6 +- anabatic/src/anabatic/Dijkstra.h | 1 + anabatic/src/anabatic/Edge.h | 6 +- anabatic/src/anabatic/Session.h | 8 ++ crlcore/src/ccore/RoutingGauge.cpp | 4 + crlcore/src/ccore/crlcore/RoutingGauge.h | 1 + flute/src/3.1/PyFlute.cpp | 133 ++++++++++++++++++ .../src/hurricane/NetRoutingProperty.cpp | 2 + .../hurricane/hurricane/NetRoutingProperty.h | 27 ++-- hurricane/src/isobar/PyNetRoutingProperty.cpp | 2 + hurricane/src/isobar/PyNetRoutingState.cpp | 3 + .../src/isobar/hurricane/isobar/PyPoint.h | 6 +- katana/src/PowerRails.cpp | 1 + kite/src/BuildPowerRails.cpp | 1 + kite/src/BuildPreRouteds.cpp | 4 +- kite/src/KiteEngine.cpp | 2 +- 24 files changed, 326 insertions(+), 64 deletions(-) create mode 100644 flute/src/3.1/PyFlute.cpp diff --git a/anabatic/src/AnabaticEngine.cpp b/anabatic/src/AnabaticEngine.cpp index 883a1344..5fbd15b4 100644 --- a/anabatic/src/AnabaticEngine.cpp +++ b/anabatic/src/AnabaticEngine.cpp @@ -1144,7 +1144,8 @@ namespace Anabatic { //AutoSegment::setShortNetMode( true ); ++shortNets; } - if (NetRoutingExtension::isAutomaticGlobalRoute(net)) { + if ( NetRoutingExtension::isManualGlobalRoute(net) + or NetRoutingExtension::isAutomaticGlobalRoute(net)) { DebugSession::open( net, 145, 150 ); AutoSegment::setAnalogMode( NetRoutingExtension::isAnalog(net) ); diff --git a/anabatic/src/AutoHorizontal.cpp b/anabatic/src/AutoHorizontal.cpp index 1fba55ca..c91739f7 100644 --- a/anabatic/src/AutoHorizontal.cpp +++ b/anabatic/src/AutoHorizontal.cpp @@ -93,6 +93,14 @@ namespace Anabatic { mergeNativeMax( gcell->getConstraintYMax() ); } } + + if (getId() == 1518590) { + cerr << "AutoHorizontal::_postCreate(): " << this << endl; + cerr << "| Source contact:" << source << endl; + cerr << "| Source GCell: " << getGCell() << endl; + cerr << "| Target contact:" << target << endl; + cerr << "| Target GCell: " << target->getGCell() << endl; + } } diff --git a/anabatic/src/Constants.cpp b/anabatic/src/Constants.cpp index 3fd5f6d0..da12c1d2 100644 --- a/anabatic/src/Constants.cpp +++ b/anabatic/src/Constants.cpp @@ -54,9 +54,11 @@ namespace Anabatic { const BaseFlags Flags::DestroyBaseContact = (1L << 8); const BaseFlags Flags::DestroyBaseSegment = (1L << 9); // Flags for NetDatas objects states only. - const BaseFlags Flags::GlobalRouted = (1L << 5); + const BaseFlags Flags::GlobalFixed = (1L << 5); const BaseFlags Flags::GlobalEstimated = (1L << 6); - const BaseFlags Flags::ExcludeRoute = (1L << 7); + const BaseFlags Flags::GlobalRouted = (1L << 7); + const BaseFlags Flags::DetailRouted = (1L << 8); + const BaseFlags Flags::ExcludeRoute = (1L << 9); // Masks. const BaseFlags Flags::WestSide = Horizontal|Target; const BaseFlags Flags::EastSide = Horizontal|Source; diff --git a/anabatic/src/Dijkstra.cpp b/anabatic/src/Dijkstra.cpp index 995ccf6b..c5dbb1de 100644 --- a/anabatic/src/Dijkstra.cpp +++ b/anabatic/src/Dijkstra.cpp @@ -1478,6 +1478,48 @@ namespace Anabatic { } + void Dijkstra::loadFixedGlobal ( Net* net ) + { + NetData* netData = _anabatic->getNetData( net ); + netData->setGlobalRouted( true ); + netData->setGlobalFixed ( true ); + + for ( Component* component : net->getComponents() ) { + Horizontal* horizontal = dynamic_cast( component ); + if (horizontal) { + if (not Session::isGLayer(horizontal->getLayer())) { + cerr << Error( "Dijsktra::loadFixedGlobal(): A component of \"%s\" has not a global layer.\n" + " (%s)" + , getString(net->getName()).c_str() + , getString(component).c_str() + ) << endl; + continue; + } + GCell* begin = _anabatic->getGCellUnder( horizontal->getSource()->getPosition() ); + GCell* end = _anabatic->getGCellUnder( horizontal->getTarget()->getPosition() ); + for ( Edge* edge : _anabatic->getEdgesUnderPath(begin,end) ) + edge->add( horizontal ); + } + + Vertical* vertical = dynamic_cast( component ); + if (vertical) { + if (not Session::isGLayer(vertical->getLayer())) { + cerr << Error( "Dijsktra::loadFixedGlobal(): A component of \"%s\" has not a global layer.\n" + " (%s)" + , getString(net->getName()).c_str() + , getString(component).c_str() + ) << endl; + continue; + } + GCell* begin = _anabatic->getGCellUnder( vertical->getSource()->getPosition() ); + GCell* end = _anabatic->getGCellUnder( vertical->getTarget()->getPosition() ); + for ( Edge* edge : _anabatic->getEdgesUnderPath(begin,end,Flags::NorthPath) ) + edge->add( vertical ); + } + } + } + + void Dijkstra::load ( Net* net ) { _cleanup(); diff --git a/anabatic/src/Edge.cpp b/anabatic/src/Edge.cpp index 007559f8..6f11d8ce 100644 --- a/anabatic/src/Edge.cpp +++ b/anabatic/src/Edge.cpp @@ -29,16 +29,31 @@ namespace { using namespace std; using namespace Hurricane; + using Anabatic::NetData; + using Anabatic::AnabaticEngine; class SortSegmentByLength { public: - inline bool operator() ( const Segment*, const Segment* ); + inline SortSegmentByLength ( AnabaticEngine* ); + inline bool operator() ( const Segment*, const Segment* ); + private: + AnabaticEngine* _anabatic; }; + inline SortSegmentByLength::SortSegmentByLength ( AnabaticEngine* anabatic ) + : _anabatic(anabatic) + { } + + inline bool SortSegmentByLength::operator() ( const Segment* lhs, const Segment* rhs ) { + NetData* lhsNData = _anabatic->getNetData( lhs->getNet() ); + NetData* rhsNData = _anabatic->getNetData( rhs->getNet() ); + if (lhsNData->isGlobalFixed() and not rhsNData->isGlobalFixed()) return true; + if (rhsNData->isGlobalFixed() and not lhsNData->isGlobalFixed()) return false; + DbU::Unit delta = rhs->getLength() - lhs->getLength(); if (delta > 0) return true; if (delta < 0) return false; @@ -358,12 +373,13 @@ namespace Anabatic { AnabaticEngine* anabatic = getAnabatic(); size_t netCount = 0; - sort( _segments.begin(), _segments.end(), SortSegmentByLength() ); + sort( _segments.begin(), _segments.end(), SortSegmentByLength(anabatic) ); if (Session::getRoutingGauge()->isTwoMetals()) { for ( size_t i=0 ; i<_segments.size() ; ) { if (not isEnding(_segments[i])) { NetData* netData = anabatic->getNetData( _segments[i]->getNet() ); + if (netData->isGlobalFixed ()) break; if (netData->isGlobalRouted()) ++netCount; anabatic->ripup( _segments[i], Flags::Propagate ); continue; @@ -374,6 +390,7 @@ namespace Anabatic { size_t truncate = (size_t)( (getCapacity()*2) / 3 ); while ( _segments.size() > truncate ) { NetData* netData = anabatic->getNetData( _segments[truncate]->getNet() ); + if (netData->isGlobalFixed ()) break; if (netData->isGlobalRouted()) ++netCount; anabatic->ripup( _segments[truncate], Flags::Propagate ); } diff --git a/anabatic/src/PreRouteds.cpp b/anabatic/src/PreRouteds.cpp index bc90ead1..25393b17 100644 --- a/anabatic/src/PreRouteds.cpp +++ b/anabatic/src/PreRouteds.cpp @@ -35,6 +35,7 @@ namespace Anabatic { using Hurricane::RegularLayer; using Hurricane::Component; using Hurricane::Pin; + using Hurricane::Plug; using Hurricane::DeepNet; using Hurricane::Cell; using Hurricane::NetRoutingExtension; @@ -85,16 +86,26 @@ namespace Anabatic { vector segments; vector contacts; - bool isPreRouted = false; - bool isFixed = false; - size_t rpCount = 0; + bool isManualGlobalRouted = false; + bool isManualDetailRouted = false; + bool isFixed = false; + size_t rpCount = 0; for( Component* component : net->getComponents() ) { - if (dynamic_cast(component)) continue; + if (dynamic_cast(component)) continue; + if (dynamic_cast(component)) continue; const RegularLayer* layer = dynamic_cast(component->getLayer()); if (layer and (layer->getBasicLayer()->getMaterial() == BasicLayer::Material::blockage)) - continue; + continue; + + if ( not Session::isGaugeLayer(component->getLayer()) + and not Session::isGLayer (component->getLayer())) + throw Error( "AnabaticEngine::setupPreRouted(): A component of \"%s\" has a routing gauge umanaged layer.\n" + " (%s)" + , getString(net->getName()).c_str() + , getString(component).c_str() + ); Horizontal* horizontal = dynamic_cast(component); if (horizontal) { @@ -102,30 +113,42 @@ namespace Anabatic { and not ab.contains(horizontal->getTargetPosition()) ) continue; segments.push_back( horizontal ); - isPreRouted = true; - if (horizontal->getWidth() != Session::getWireWidth(horizontal->getLayer())) - isFixed = true; + if (Session::isGLayer(component->getLayer())) { + isManualGlobalRouted = true; + } else { + isManualDetailRouted = true; + if (horizontal->getWidth() != Session::getWireWidth(horizontal->getLayer())) + isFixed = true; + } } else { Vertical* vertical = dynamic_cast(component); if (vertical) { if ( not ab.contains(vertical->getSourcePosition()) and not ab.contains(vertical->getTargetPosition()) ) continue; - isPreRouted = true; - segments.push_back( vertical ); - if (vertical->getWidth() != Session::getWireWidth(vertical->getLayer())) - isFixed = true; + if (Session::isGLayer(component->getLayer())) { + isManualGlobalRouted = true; + } else { + isManualDetailRouted = true; + segments.push_back( vertical ); + if (vertical->getWidth() != Session::getWireWidth(vertical->getLayer())) + isFixed = true; + } } else { Contact* contact = dynamic_cast(component); if (contact) { if (not ab.contains(contact->getCenter())) continue; - isPreRouted = true; - contacts.push_back( contact ); - if ( (contact->getWidth () != Session::getViaWidth(contact->getLayer())) - or (contact->getHeight() != Session::getViaWidth(contact->getLayer())) - or (contact->getLayer () == Session::getContactLayer(0)) ) - isFixed = true; + if (Session::isGLayer(component->getLayer())) { + isManualGlobalRouted = true; + } else { + isManualGlobalRouted = true; + contacts.push_back( contact ); + if ( (contact->getWidth () != Session::getViaWidth(contact->getLayer())) + or (contact->getHeight() != Session::getViaWidth(contact->getLayer())) + or (contact->getLayer () == Session::getContactLayer(0)) ) + isFixed = true; + } } else { RoutingPad* rp = dynamic_cast(component); if (rp) { @@ -142,7 +165,10 @@ namespace Anabatic { } } - if ((not isFixed and not isPreRouted) and net->isDeepNet()) { + if ( (not isFixed) + and (not isManualGlobalRouted) + and (not isManualDetailRouted) + and net->isDeepNet()) { Net* rootNet = dynamic_cast( dynamic_cast(net)->getRootNetOccurrence().getEntity() ); for( Component* component : rootNet->getComponents() ) { @@ -152,29 +178,34 @@ namespace Anabatic { } } - if (isFixed or isPreRouted or (rpCount < 2)) { + if (isFixed or isManualDetailRouted or isManualGlobalRouted or (rpCount < 2)) { NetData* ndata = getNetData( net, Flags::Create ); NetRoutingState* state = ndata->getNetRoutingState(); state->unsetFlags( NetRoutingState::AutomaticGlobalRoute ); - state->setFlags ( NetRoutingState::ManualGlobalRoute ); + if (isManualGlobalRouted) { + state->setFlags( NetRoutingState::ManualGlobalRoute ); + ndata->setGlobalFixed( true ); + } + if (isManualDetailRouted) + state->setFlags( NetRoutingState::ManualDetailRoute ); ndata->setGlobalRouted( true ); if (rpCount < 2) - state->setFlags ( NetRoutingState::Unconnected ); + state->setFlags( NetRoutingState::Unconnected ); if (isFixed) { if (rpCount > 1) cmess2 << " - <" << net->getName() << "> is fixed." << endl; - state->unsetFlags( NetRoutingState::ManualGlobalRoute ); + state->unsetFlags( NetRoutingState::ManualGlobalRoute|NetRoutingState::ManualDetailRoute ); state->setFlags ( NetRoutingState::Fixed ); - } else { + } else if (isManualGlobalRouted) { + cmess2 << " - <" << net->getName() << "> is manually global routed." << endl; + } else if (isManualDetailRouted) { if (rpCount > 1) { ++toBeRouteds; - - cmess2 << " - <" << net->getName() << "> is manually global routed." << endl; - for ( auto icontact : contacts ) { - AutoContact::createFrom( icontact ); + cmess2 << " - <" << net->getName() << "> is manually detail routed." << endl; + for ( auto contact : contacts ) { + AutoContact::createFrom( contact ); } - for ( auto segment : segments ) { AutoContact* source = Session::lookup( dynamic_cast( segment->getSource() )); AutoContact* target = Session::lookup( dynamic_cast( segment->getTarget() )); diff --git a/anabatic/src/anabatic/AnabaticEngine.h b/anabatic/src/anabatic/AnabaticEngine.h index b363c359..ec56fc58 100644 --- a/anabatic/src/anabatic/AnabaticEngine.h +++ b/anabatic/src/anabatic/AnabaticEngine.h @@ -14,20 +14,16 @@ // +-----------------------------------------------------------------+ -#ifndef ANABATIC_ANABATIC_ENGINE_H -#define ANABATIC_ANABATIC_ENGINE_H - +#pragma once #include #include #include #include - #include "hurricane/NetRoutingProperty.h" namespace Hurricane { class Instance; class CellViewer; } - #include "crlcore/ToolEngine.h" #include "anabatic/Configuration.h" #include "anabatic/Matrix.h" @@ -107,6 +103,7 @@ namespace Anabatic { NetData ( Net* ); inline bool isGlobalEstimated () const; inline bool isGlobalRouted () const; + inline bool isGlobalFixed () const; inline bool isMixedPreRoute () const; inline bool isFixed () const; inline bool isExcluded () const; @@ -120,6 +117,7 @@ namespace Anabatic { inline void setSearchArea ( Box ); inline void setGlobalEstimated ( bool ); inline void setGlobalRouted ( bool ); + inline void setGlobalFixed ( bool ); inline void setExcluded ( bool ); inline void setRpCount ( size_t ); private: @@ -138,6 +136,7 @@ namespace Anabatic { inline bool NetData::isGlobalEstimated () const { return _flags & Flags::GlobalEstimated; } inline bool NetData::isGlobalRouted () const { return _flags & Flags::GlobalRouted; } + inline bool NetData::isGlobalFixed () const { return _flags & Flags::GlobalFixed; } inline bool NetData::isMixedPreRoute () const { return (_state) ? _state->isMixedPreRoute() : false; } inline bool NetData::isFixed () const { return (_state) ? _state->isFixed () : false; } inline bool NetData::isExcluded () const { return _flags & Flags::ExcludeRoute; } @@ -150,6 +149,7 @@ namespace Anabatic { inline DbU::Unit NetData::getSparsity () const { return _sparsity; } inline void NetData::setGlobalEstimated ( bool state ) { _flags.set(Flags::GlobalEstimated,state); } inline void NetData::setGlobalRouted ( bool state ) { _flags.set(Flags::GlobalRouted ,state); } + inline void NetData::setGlobalFixed ( bool state ) { _flags.set(Flags::GlobalFixed ,state); } inline void NetData::setExcluded ( bool state ) { _flags.set(Flags::ExcludeRoute ,state); } inline void NetData::setRpCount ( size_t count ) { _rpCount=count; _update(); } @@ -419,5 +419,3 @@ namespace Anabatic { INSPECTOR_P_SUPPORT(Anabatic::AnabaticEngine); - -#endif // ANABATIC_ANABATIC_ENGINE_H diff --git a/anabatic/src/anabatic/Configuration.h b/anabatic/src/anabatic/Configuration.h index 802b7080..9c440dc4 100644 --- a/anabatic/src/anabatic/Configuration.h +++ b/anabatic/src/anabatic/Configuration.h @@ -64,6 +64,7 @@ namespace Anabatic { virtual ~Configuration (); virtual Configuration* clone () const; // Methods. + inline bool isGLayer ( const Layer* ) const; bool isGMetal ( const Layer* ) const; bool isGContact ( const Layer* ) const; bool isTwoMetals () const; @@ -160,6 +161,7 @@ namespace Anabatic { }; + inline bool Configuration::isGLayer ( const Layer* layer ) const { return isGMetal(layer) or isGContact(layer); } inline size_t Configuration::getGHorizontalDepth () const { return _gdepthh; } inline size_t Configuration::getGVerticalDepth () const { return _gdepthv; } inline DbU::Unit Configuration::getGHorizontalPitch () const { return getPitch( getGHorizontalDepth(), Flags::NoFlags ); } diff --git a/anabatic/src/anabatic/Constants.h b/anabatic/src/anabatic/Constants.h index b79ba76b..fe75946e 100644 --- a/anabatic/src/anabatic/Constants.h +++ b/anabatic/src/anabatic/Constants.h @@ -52,9 +52,11 @@ namespace Anabatic { static const BaseFlags DestroyBaseContact ; // = (1 << 8); static const BaseFlags DestroyBaseSegment ; // = (1 << 9); // Flags for NetDatas objects states only. - static const BaseFlags GlobalRouted ; // = (1 << 5); + static const BaseFlags GlobalFixed ; // = (1 << 5); static const BaseFlags GlobalEstimated ; // = (1 << 6); - static const BaseFlags ExcludeRoute ; // = (1 << 7); + static const BaseFlags GlobalRouted ; // = (1 << 7); + static const BaseFlags DetailRouted ; // = (1 << 8); + static const BaseFlags ExcludeRoute ; // = (1 << 9); // Masks. static const BaseFlags WestSide ; // = Horizontal|Target; static const BaseFlags EastSide ; // = Horizontal|Source; diff --git a/anabatic/src/anabatic/Dijkstra.h b/anabatic/src/anabatic/Dijkstra.h index cad767c8..cf298670 100644 --- a/anabatic/src/anabatic/Dijkstra.h +++ b/anabatic/src/anabatic/Dijkstra.h @@ -517,6 +517,7 @@ namespace Anabatic { inline DistanceT* setDistance ( DistanceT ); inline void setSearchAreaHalo ( DbU::Unit ); void load ( Net* net ); + void loadFixedGlobal ( Net* net ); void run ( Mode mode=Mode::Standart ); inline const VertexSet& getSources () const; private: diff --git a/anabatic/src/anabatic/Edge.h b/anabatic/src/anabatic/Edge.h index 180a7ff8..bdbb813a 100644 --- a/anabatic/src/anabatic/Edge.h +++ b/anabatic/src/anabatic/Edge.h @@ -14,9 +14,7 @@ // +-----------------------------------------------------------------+ -#ifndef ANABATIC_EDGE_H -#define ANABATIC_EDGE_H - +#pragma once #include #include "hurricane/Name.h" #include "hurricane/Interval.h" @@ -168,5 +166,3 @@ namespace Anabatic { INSPECTOR_P_SUPPORT(Anabatic::Edge); - -#endif // ANABATIC_EDGE_H diff --git a/anabatic/src/anabatic/Session.h b/anabatic/src/anabatic/Session.h index 70698b93..a0bcacd8 100644 --- a/anabatic/src/anabatic/Session.h +++ b/anabatic/src/anabatic/Session.h @@ -109,6 +109,10 @@ namespace Anabatic { static inline DbU::Unit getDContactWidth (); static inline DbU::Unit getDContactPitch (); static inline RoutingGauge* getRoutingGauge (); + static inline bool isGLayer ( const Layer* ); + static inline bool isGMetal ( const Layer* ); + static inline bool isGContact ( const Layer* ); + static inline bool isGaugeLayer ( const Layer* ); static inline RoutingLayerGauge* getLayerGauge ( size_t depth ); static inline size_t getDepth (); static inline size_t getViaDepth ( const Layer* layer ); @@ -246,6 +250,10 @@ namespace Anabatic { inline const Layer* Session::getDContactLayer () { return getConfiguration()->getDContactLayer(); } inline DbU::Unit Session::getDContactWidth () { return getConfiguration()->getDContactWidth(); } inline DbU::Unit Session::getDContactPitch () { return getConfiguration()->getDContactPitch(); } + inline bool Session::isGLayer ( const Layer* layer ) { return getConfiguration()->isGLayer(layer); } + inline bool Session::isGMetal ( const Layer* layer ) { return getConfiguration()->isGMetal(layer); } + inline bool Session::isGContact ( const Layer* layer ) { return getConfiguration()->isGContact(layer); } + inline bool Session::isGaugeLayer ( const Layer* layer ) { return getRoutingGauge()->hasLayer(layer); } 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/crlcore/src/ccore/RoutingGauge.cpp b/crlcore/src/ccore/RoutingGauge.cpp index 1ef5c08f..b5e94849 100644 --- a/crlcore/src/ccore/RoutingGauge.cpp +++ b/crlcore/src/ccore/RoutingGauge.cpp @@ -120,6 +120,10 @@ namespace CRL { } + bool RoutingGauge::hasLayer ( const Layer* layer ) const + { return (getLayerGauge(layer) != NULL) or (getViaDepth(layer) != nlayerdepth); } + + RoutingLayerGauge* RoutingGauge::getHorizontalGauge () const { RoutingLayerGauge* pinOnly = NULL; diff --git a/crlcore/src/ccore/crlcore/RoutingGauge.h b/crlcore/src/ccore/crlcore/RoutingGauge.h index 213f561e..b7047411 100644 --- a/crlcore/src/ccore/crlcore/RoutingGauge.h +++ b/crlcore/src/ccore/crlcore/RoutingGauge.h @@ -58,6 +58,7 @@ namespace CRL { inline bool isTwoMetals () const; inline bool isHV () const; inline bool isVH () const; + bool hasLayer ( const Layer* ) const; // Accessors. RoutingGauge* getClone () const; inline const Name getName () const; diff --git a/flute/src/3.1/PyFlute.cpp b/flute/src/3.1/PyFlute.cpp new file mode 100644 index 00000000..7b91a7f2 --- /dev/null +++ b/flute/src/3.1/PyFlute.cpp @@ -0,0 +1,133 @@ +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) SU 2020-2020, All Rights Reserved +// +// +-----------------------------------------------------------------+ +// | C O R I O L I S | +// | F l u t e - Flute / Python Interface | +// | | +// | Author : Jean-Paul CHAPUT | +// | E-mail : Jean-Paul.Chaput@lip6.fr | +// | =============================================================== | +// | C++ Module : "./PyFlute.cpp" | +// +-----------------------------------------------------------------+ + + +#include "hurricane/isobar/PyPoint.h" +#include "crlcore/Utilities.h" +#include +#include +#include "flute.h" + + +namespace Flute { + + using namespace Hurricane; + using namespace Isobar; + using namespace std; + using CRL::System; + + +#if !defined(__PYTHON_MODULE__) + +// +=================================================================+ +// | "PyFlute" Shared Library Code Part | +// +=================================================================+ + + +# else // PyFlute Shared Library Code Part. + +// +=================================================================+ +// | "PyFlute" Python Module Code Part | +// +=================================================================+ + + +extern "C" { + + static PyObject* PyFlute_readLUT ( PyObject* self, PyObject* ) + { + HTRY + Flute::readLUT( System::getPath( "coriolis_top" ).toString() ); + HCATCH + Py_RETURN_NONE; + } + + + static PyObject* PyFlute_flute ( PyObject* self, PyObject* args ) + { + PyObject* treeTuple = NULL; + HTRY + PyObject* pyPoints = NULL; + if (PyArg_ParseTuple(args,"O:Flute.flute()",&pyPoints)) { + } else { + PyErr_SetString( ConstructorError, "Flute.flute(): Takes only one argument." ); + return NULL; + } + if (not PyList_Check(pyPoints)) { + PyErr_SetString( ConstructorError, "Flute.flute(): Argument must be a list." ); + return NULL; + } + size_t size = PyList_Size( pyPoints ); + int accuracy = 3; + int64_t* xs = new int64_t [size]; + int64_t* ys = new int64_t [size]; + + for ( size_t i=0 ; iisManualDetailRoute(); + } + + inline bool NetRoutingExtension::isAutomaticGlobalRoute ( const Net* net ) { NetRoutingState* state = get( net ); diff --git a/hurricane/src/isobar/PyNetRoutingProperty.cpp b/hurricane/src/isobar/PyNetRoutingProperty.cpp index ca9b861c..7e1d1c2e 100644 --- a/hurricane/src/isobar/PyNetRoutingProperty.cpp +++ b/hurricane/src/isobar/PyNetRoutingProperty.cpp @@ -121,6 +121,7 @@ extern "C" { ExtensionGetBoolFunction(isFixed ,NetRoutingExtension) ExtensionGetBoolFunction(isUnconnected ,NetRoutingExtension) ExtensionGetBoolFunction(isManualGlobalRoute ,NetRoutingExtension) + ExtensionGetBoolFunction(isManualDetailRoute ,NetRoutingExtension) ExtensionGetBoolFunction(isAutomaticGlobalRoute,NetRoutingExtension) ExtensionGetBoolFunction(isMixedPreRoute ,NetRoutingExtension) ExtensionGetBoolFunction(isSymmetric ,NetRoutingExtension) @@ -197,6 +198,7 @@ extern "C" { { { "isFixed" , (PyCFunction)PyNetRoutingExtension_isFixed , METH_NOARGS |METH_CLASS , "To be documented." } , { "isUnconnected" , (PyCFunction)PyNetRoutingExtension_isUnconnected , METH_NOARGS |METH_CLASS , "To be documented." } , { "isManualGlobalRoute" , (PyCFunction)PyNetRoutingExtension_isManualGlobalRoute , METH_NOARGS |METH_CLASS , "To be documented." } + , { "isManualDetailRoute" , (PyCFunction)PyNetRoutingExtension_isManualDetailRoute , METH_NOARGS |METH_CLASS , "To be documented." } , { "isAutomaticGlobalRoute", (PyCFunction)PyNetRoutingExtension_isAutomaticGlobalRoute, METH_NOARGS |METH_CLASS , "To be documented." } , { "isMixedPreRoute" , (PyCFunction)PyNetRoutingExtension_isMixedPreRoute , METH_NOARGS |METH_CLASS , "To be documented." } , { "isSymmetric" , (PyCFunction)PyNetRoutingExtension_isSymmetric , METH_NOARGS |METH_CLASS , "To be documented." } diff --git a/hurricane/src/isobar/PyNetRoutingState.cpp b/hurricane/src/isobar/PyNetRoutingState.cpp index ea2e2705..bb89058f 100644 --- a/hurricane/src/isobar/PyNetRoutingState.cpp +++ b/hurricane/src/isobar/PyNetRoutingState.cpp @@ -72,6 +72,7 @@ extern "C" { DirectGetBoolAttribute(PyNetRoutingState_isFixed ,isFixed ,PyNetRoutingState,NetRoutingState) DirectGetBoolAttribute(PyNetRoutingState_isUnconnected ,isUnconnected ,PyNetRoutingState,NetRoutingState) DirectGetBoolAttribute(PyNetRoutingState_isManualGlobalRoute ,isManualGlobalRoute ,PyNetRoutingState,NetRoutingState) + DirectGetBoolAttribute(PyNetRoutingState_isManualDetailRoute ,isManualDetailRoute ,PyNetRoutingState,NetRoutingState) DirectGetBoolAttribute(PyNetRoutingState_isAutomaticGlobalRoute,isAutomaticGlobalRoute,PyNetRoutingState,NetRoutingState) DirectGetBoolAttribute(PyNetRoutingState_isMixedPreRoute ,isMixedPreRoute ,PyNetRoutingState,NetRoutingState) DirectGetBoolAttribute(PyNetRoutingState_isSymmetric ,isSymmetric ,PyNetRoutingState,NetRoutingState) @@ -97,6 +98,7 @@ extern "C" { , { "isFixed" , (PyCFunction)PyNetRoutingState_isFixed , METH_NOARGS , "To be documented." } , { "isUnconnected" , (PyCFunction)PyNetRoutingState_isUnconnected , METH_NOARGS , "To be documented." } , { "isManualGlobalRoute" , (PyCFunction)PyNetRoutingState_isManualGlobalRoute , METH_NOARGS , "To be documented." } + , { "isManualDetailRoute" , (PyCFunction)PyNetRoutingState_isManualDetailRoute , METH_NOARGS , "To be documented." } , { "isAutomaticGlobalRoute", (PyCFunction)PyNetRoutingState_isAutomaticGlobalRoute, METH_NOARGS , "To be documented." } , { "isMixedPreRoute" , (PyCFunction)PyNetRoutingState_isMixedPreRoute , METH_NOARGS , "To be documented." } , { "isSymmetric" , (PyCFunction)PyNetRoutingState_isSymmetric , METH_NOARGS , "To be documented." } @@ -145,6 +147,7 @@ extern "C" { LoadObjectConstant(PyTypeNetRoutingState.tp_dict,NetRoutingState::Fixed ,"Fixed" ); LoadObjectConstant(PyTypeNetRoutingState.tp_dict,NetRoutingState::Unconnected ,"Unconnected" ); LoadObjectConstant(PyTypeNetRoutingState.tp_dict,NetRoutingState::ManualGlobalRoute ,"ManualGlobalRoute" ); + LoadObjectConstant(PyTypeNetRoutingState.tp_dict,NetRoutingState::ManualDetailRoute ,"ManualDetailRoute" ); LoadObjectConstant(PyTypeNetRoutingState.tp_dict,NetRoutingState::AutomaticGlobalRoute,"AutomaticGlobalRoute"); LoadObjectConstant(PyTypeNetRoutingState.tp_dict,NetRoutingState::MixedPreRoute ,"MixedPreRoute" ); LoadObjectConstant(PyTypeNetRoutingState.tp_dict,NetRoutingState::Horizontal ,"Horizontal" ); diff --git a/hurricane/src/isobar/hurricane/isobar/PyPoint.h b/hurricane/src/isobar/hurricane/isobar/PyPoint.h index bd0a0fc4..a6426e34 100644 --- a/hurricane/src/isobar/hurricane/isobar/PyPoint.h +++ b/hurricane/src/isobar/hurricane/isobar/PyPoint.h @@ -14,9 +14,7 @@ // +-----------------------------------------------------------------+ -#ifndef PY_POINT_H -#define PY_POINT_H - +#pragma once #include "hurricane/isobar/PyHurricane.h" #include "hurricane/Point.h" @@ -51,5 +49,3 @@ namespace Isobar { } // extern "C". } // Isobar namespace. - -#endif // PY_POINT_H diff --git a/katana/src/PowerRails.cpp b/katana/src/PowerRails.cpp index 1996ef07..77748521 100644 --- a/katana/src/PowerRails.cpp +++ b/katana/src/PowerRails.cpp @@ -176,6 +176,7 @@ namespace { } } + if (NetRoutingExtension::isManualDetailRoute(net)) continue; if (NetRoutingExtension::isManualGlobalRoute(net)) continue; if (netType == Net::Type::POWER) { diff --git a/kite/src/BuildPowerRails.cpp b/kite/src/BuildPowerRails.cpp index 3099efaf..8b3f1aea 100644 --- a/kite/src/BuildPowerRails.cpp +++ b/kite/src/BuildPowerRails.cpp @@ -282,6 +282,7 @@ namespace { } if (NetRoutingExtension::isManualGlobalRoute(net)) continue; + if (NetRoutingExtension::isManualDetailRoute(net)) continue; if (netType == Net::Type::POWER) { if (_vddiPadNetName.isEmpty()) { diff --git a/kite/src/BuildPreRouteds.cpp b/kite/src/BuildPreRouteds.cpp index 916fecf6..62d85ef0 100644 --- a/kite/src/BuildPreRouteds.cpp +++ b/kite/src/BuildPreRouteds.cpp @@ -160,13 +160,13 @@ namespace Kite { if (isFixed or isPreRouted or (rpCount < 2)) { NetRoutingState* state = getRoutingState( net, Katabatic::KbCreate ); state->unsetFlags( NetRoutingState::AutomaticGlobalRoute ); - state->setFlags ( NetRoutingState::ManualGlobalRoute ); + state->setFlags ( NetRoutingState::ManualDetailRoute ); if (rpCount < 2) state->setFlags ( NetRoutingState::Unconnected ); if (isFixed) { cmess2 << " - <" << net->getName() << "> is fixed." << endl; - state->unsetFlags( NetRoutingState::ManualGlobalRoute ); + state->unsetFlags( NetRoutingState::ManualDetailRoute ); state->setFlags ( NetRoutingState::Fixed ); } else { if (rpCount > 1) { diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index 5608a8ba..010613bd 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -219,7 +219,7 @@ namespace Kite { for ( Net* net : cell->getNets() ) { if (net->isClock() or net->isSupply()) continue; - if (NetRoutingExtension::isManualGlobalRoute(net)) continue; + if (NetRoutingExtension::isManualDetailRoute(net)) continue; // First pass: destroy the contacts std::vector contacts;