From a6addb5c56d89629a3af9104ed16db1765ab0263 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 21 Jun 2014 18:07:28 +0200 Subject: [PATCH] In Knik add support for excluded nets (not to be routeds). * New: In Knik, in , the methods ::initGlobalRouting(), ::run() and ::Route() now accepts one argument, a reference to a map of not to be routed nets (the key being the name for fast search by name). This feature is introduced to prevent the routing of nets for which a global/detailed routing is already supplied by the designer. For now it applies to the clock tree. --- knik/src/GraphicKnikEngine.cpp | 8 +++++--- knik/src/KnikEngine.cpp | 28 +++++++++++++++------------- knik/src/knik/KnikEngine.h | 34 +++++++++++++++++----------------- 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/knik/src/GraphicKnikEngine.cpp b/knik/src/GraphicKnikEngine.cpp index 0ebd1ad4..01880472 100644 --- a/knik/src/GraphicKnikEngine.cpp +++ b/knik/src/GraphicKnikEngine.cpp @@ -190,8 +190,9 @@ namespace Knik { if ( !knik ) return; //emit cellPreModificated (); - - knik->run (); + + map excludedNets; + knik->run ( excludedNets ); //emit cellPostModificated (); } @@ -204,7 +205,8 @@ namespace Knik { //emit cellPreModificated (); - knik->Route (); + map excludedNets; + knik->Route ( excludedNets ); //emit cellPostModificated (); } diff --git a/knik/src/KnikEngine.cpp b/knik/src/KnikEngine.cpp index 37514a33..6967739e 100644 --- a/knik/src/KnikEngine.cpp +++ b/knik/src/KnikEngine.cpp @@ -79,6 +79,8 @@ namespace Knik { , _allowedDepth ( 0) , _routingGraph ( NULL ) , _routingGrid ( NULL ) + , _timer () + , _nets_to_route () , _benchMode ( benchMode ) , _useSegments ( useSegments ) , _routingDone ( false ) @@ -189,8 +191,8 @@ void KnikEngine::MakeRoutingLeaves() return; } -void KnikEngine::initGlobalRouting() -// ********************************* +void KnikEngine::initGlobalRouting( const map& excludedNets ) +// ********************************************************************* { assert( _nets_to_route.empty() ); cmess2 << " o Initializing global routing." << endl; @@ -222,6 +224,11 @@ void KnikEngine::initGlobalRouting() Name obstacleNetName ("obstaclenet"); forEach ( Net*, inet, getCell()->getNets() ) { + if (excludedNets.find(inet->getName()) != excludedNets.end()) { + cparanoid << " - <" << inet->getName() << "> not routed (pre-routing found)." << endl; + continue; + } + if ( inet->isGlobal() or inet->isSupply() or inet->isClock() @@ -1035,10 +1042,10 @@ void KnikEngine::computeOverflow() // _routingGraph->UpdateOccupancyWindow(); // } -void KnikEngine::run() -// ******************* +void KnikEngine::run( const map& excludedNets ) +// ******************************************************* { - Route(); + Route( excludedNets ); bool done = analyseRouting(); while ( !done ) { unrouteOvSegments(); @@ -1059,12 +1066,12 @@ void KnikEngine::run() computeSymbolicWireLength (); } -void KnikEngine::Route() -// ********************* +void KnikEngine::Route( const map& excludedNets ) +// ********************************************************* { UpdateSession::open(); if ( !__initialized__ ) - initGlobalRouting(); + initGlobalRouting( excludedNets ); _timer.resetIncrease(); _timer.start(); @@ -1073,11 +1080,6 @@ void KnikEngine::Route() cmess2 << " Iteration INIT" << " # of nets to route:" << left << _nets_to_route.size() << endl; - //CEditor* editor = getCEditor ( getCell() ); - //editor->showRubbers(); - //editor->Refresh(); - //editor->Stop("Global Routing is going to do its job"); - // initializing netStamp for routingGraph: //_routingGraph->setNetStamp(1); // Maybe NetStamp should not be initialized here ! // Be aware that initializingthe NetStamp in the construction of the routingGraph, might be a bad idea, if a lotof rerouting processes are run, it may overpass the unsigne limit (really ?) diff --git a/knik/src/knik/KnikEngine.h b/knik/src/knik/KnikEngine.h index 9e61d196..d5870491 100644 --- a/knik/src/knik/KnikEngine.h +++ b/knik/src/knik/KnikEngine.h @@ -119,20 +119,20 @@ typedef vector NetVector; // Attributes // ********** private: - static const Name _toolName; - static size_t _hEdgeReservedLocal; - static size_t _vEdgeReservedLocal; - RoutingGauge* _routingGauge; - unsigned int _allowedDepth; - Graph* _routingGraph; - RoutingGrid* _routingGrid; - Timer _timer; - NetVector _nets_to_route; - bool _benchMode; - bool _useSegments; - bool _routingDone; - unsigned _rerouteIteration; - map _segmentOverEdges; + static const Name _toolName; + static size_t _hEdgeReservedLocal; + static size_t _vEdgeReservedLocal; + RoutingGauge* _routingGauge; + unsigned int _allowedDepth; + Graph* _routingGraph; + RoutingGrid* _routingGrid; + Timer _timer; + NetVector _nets_to_route; + bool _benchMode; + bool _useSegments; + bool _routingDone; + unsigned _rerouteIteration; + map _segmentOverEdges; vector > _sortSegmentOv; set _segmentsToUnroute; @@ -166,9 +166,9 @@ typedef vector NetVector; RoutingGauge* getRoutingGauge () const { return _routingGauge; } void setAllowedDepth ( unsigned int ); unsigned int getAllowedDepth () const { return _allowedDepth; } - void initGlobalRouting (); // Making it public, so it can be called earlier and then capacities on edges can be ajusted - void run (); - void Route (); + void initGlobalRouting ( const map& excludedNets ); // Making it public, so it can be called earlier and then capacities on edges can be ajusted + void run ( const map& excludedNets ); + void Route ( const map& excludedNets ); void createRoutingGrid ( unsigned nbXTiles , unsigned nbYTiles , const Box& boundingBox