In Knik add support for excluded nets (not to be routeds).

* New: In Knik, in <KnikEngine>, 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.
This commit is contained in:
Jean-Paul Chaput 2014-06-21 18:07:28 +02:00
parent 7a6dcd1527
commit a6addb5c56
3 changed files with 37 additions and 33 deletions

View File

@ -190,8 +190,9 @@ namespace Knik {
if ( !knik ) return; if ( !knik ) return;
//emit cellPreModificated (); //emit cellPreModificated ();
knik->run (); map<Name,Net*> excludedNets;
knik->run ( excludedNets );
//emit cellPostModificated (); //emit cellPostModificated ();
} }
@ -204,7 +205,8 @@ namespace Knik {
//emit cellPreModificated (); //emit cellPreModificated ();
knik->Route (); map<Name,Net*> excludedNets;
knik->Route ( excludedNets );
//emit cellPostModificated (); //emit cellPostModificated ();
} }

View File

@ -79,6 +79,8 @@ namespace Knik {
, _allowedDepth ( 0) , _allowedDepth ( 0)
, _routingGraph ( NULL ) , _routingGraph ( NULL )
, _routingGrid ( NULL ) , _routingGrid ( NULL )
, _timer ()
, _nets_to_route ()
, _benchMode ( benchMode ) , _benchMode ( benchMode )
, _useSegments ( useSegments ) , _useSegments ( useSegments )
, _routingDone ( false ) , _routingDone ( false )
@ -189,8 +191,8 @@ void KnikEngine::MakeRoutingLeaves()
return; return;
} }
void KnikEngine::initGlobalRouting() void KnikEngine::initGlobalRouting( const map<Name,Net*>& excludedNets )
// ********************************* // *********************************************************************
{ {
assert( _nets_to_route.empty() ); assert( _nets_to_route.empty() );
cmess2 << " o Initializing global routing." << endl; cmess2 << " o Initializing global routing." << endl;
@ -222,6 +224,11 @@ void KnikEngine::initGlobalRouting()
Name obstacleNetName ("obstaclenet"); Name obstacleNetName ("obstaclenet");
forEach ( Net*, inet, getCell()->getNets() ) { 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() if ( inet->isGlobal()
or inet->isSupply() or inet->isSupply()
or inet->isClock() or inet->isClock()
@ -1035,10 +1042,10 @@ void KnikEngine::computeOverflow()
// _routingGraph->UpdateOccupancyWindow(); // _routingGraph->UpdateOccupancyWindow();
// } // }
void KnikEngine::run() void KnikEngine::run( const map<Name,Net*>& excludedNets )
// ******************* // *******************************************************
{ {
Route(); Route( excludedNets );
bool done = analyseRouting(); bool done = analyseRouting();
while ( !done ) { while ( !done ) {
unrouteOvSegments(); unrouteOvSegments();
@ -1059,12 +1066,12 @@ void KnikEngine::run()
computeSymbolicWireLength (); computeSymbolicWireLength ();
} }
void KnikEngine::Route() void KnikEngine::Route( const map<Name,Net*>& excludedNets )
// ********************* // *********************************************************
{ {
UpdateSession::open(); UpdateSession::open();
if ( !__initialized__ ) if ( !__initialized__ )
initGlobalRouting(); initGlobalRouting( excludedNets );
_timer.resetIncrease(); _timer.resetIncrease();
_timer.start(); _timer.start();
@ -1073,11 +1080,6 @@ void KnikEngine::Route()
cmess2 << " Iteration INIT" cmess2 << " Iteration INIT"
<< " # of nets to route:" << left << _nets_to_route.size() << endl; << " # 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: // initializing netStamp for routingGraph:
//_routingGraph->setNetStamp(1); // Maybe NetStamp should not be initialized here ! //_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 ?) // 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 ?)

View File

@ -119,20 +119,20 @@ typedef vector<NetRecord> NetVector;
// Attributes // Attributes
// ********** // **********
private: private:
static const Name _toolName; static const Name _toolName;
static size_t _hEdgeReservedLocal; static size_t _hEdgeReservedLocal;
static size_t _vEdgeReservedLocal; static size_t _vEdgeReservedLocal;
RoutingGauge* _routingGauge; RoutingGauge* _routingGauge;
unsigned int _allowedDepth; unsigned int _allowedDepth;
Graph* _routingGraph; Graph* _routingGraph;
RoutingGrid* _routingGrid; RoutingGrid* _routingGrid;
Timer _timer; Timer _timer;
NetVector _nets_to_route; NetVector _nets_to_route;
bool _benchMode; bool _benchMode;
bool _useSegments; bool _useSegments;
bool _routingDone; bool _routingDone;
unsigned _rerouteIteration; unsigned _rerouteIteration;
map<Segment*,SegRecord> _segmentOverEdges; map<Segment*,SegRecord> _segmentOverEdges;
vector<pair<Segment*,SegRecord*> > _sortSegmentOv; vector<pair<Segment*,SegRecord*> > _sortSegmentOv;
set<Segment*> _segmentsToUnroute; set<Segment*> _segmentsToUnroute;
@ -166,9 +166,9 @@ typedef vector<NetRecord> NetVector;
RoutingGauge* getRoutingGauge () const { return _routingGauge; } RoutingGauge* getRoutingGauge () const { return _routingGauge; }
void setAllowedDepth ( unsigned int ); void setAllowedDepth ( unsigned int );
unsigned int getAllowedDepth () const { return _allowedDepth; } 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 initGlobalRouting ( const map<Name,Net*>& excludedNets ); // Making it public, so it can be called earlier and then capacities on edges can be ajusted
void run (); void run ( const map<Name,Net*>& excludedNets );
void Route (); void Route ( const map<Name,Net*>& excludedNets );
void createRoutingGrid ( unsigned nbXTiles void createRoutingGrid ( unsigned nbXTiles
, unsigned nbYTiles , unsigned nbYTiles
, const Box& boundingBox , const Box& boundingBox