From 51a1615d9260f5063317d65bb4cf3d82aa10a499 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 1 Aug 2014 17:22:06 +0200 Subject: [PATCH] Do not display H/V edge capacity on one column/row design. --- knik/src/Graph.cpp | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/knik/src/Graph.cpp b/knik/src/Graph.cpp index e978167c..3899bf1a 100644 --- a/knik/src/Graph.cpp +++ b/knik/src/Graph.cpp @@ -170,8 +170,15 @@ void Graph::_postCreate() #endif } - cout << Dots::asUInt (" - Global router H edges capacity" ,_lowerLeftVertex->getHEdgeOut()->getCapacity()) << endl; - cout << Dots::asUInt (" - Global router V edges capacity" ,_lowerLeftVertex->getVEdgeOut()->getCapacity()) << endl; + if (_lowerLeftVertex->getHEdgeOut()) + cout << Dots::asUInt (" - Global router H edges capacity" ,_lowerLeftVertex->getHEdgeOut()->getCapacity()) << endl; + else + cerr << Warning( "Knik::Graph: Design has only one column, H edge capacity is zero." ) << endl; + + if (_lowerLeftVertex->getVEdgeOut()) + cout << Dots::asUInt (" - Global router V edges capacity" ,_lowerLeftVertex->getVEdgeOut()->getCapacity()) << endl; + else + cerr << Warning( "Knik::Graph: Design has only one row, V edge capacity is zero." ) << endl; // #ifdef __USE_MATRIXVERTEX__ // _matrixVertex = MatrixVertex::create(this); @@ -1009,7 +1016,7 @@ int Graph::initRouting ( Net* net ) //cerr << " Adding vertex to _vertexes_to_route: continue" << endl; _vertexes_to_route.insert ( contactVertex ); _searchingArea.merge ( contactVertex->getBox() ); - contactVertex->setDistance((float)(HUGE_VAL)); + contactVertex->setDistance((float)(HUGE)); contactVertex->setPredecessor(NULL); currentConnexID++; } @@ -1049,7 +1056,7 @@ int Graph::initRouting ( Net* net ) _searchingArea.merge ( rpVertex->getBox() ); rpVertex->setConnexID ( currentConnexID ); rpVertex->setNetStamp ( _netStamp ); - rpVertex->setDistance((float)(HUGE_VAL)); + rpVertex->setDistance((float)(HUGE)); rpVertex->setPredecessor(NULL); currentConnexID++; } @@ -1135,7 +1142,7 @@ void Graph::Dijkstra() while ( _vertexes_to_route.size() > 1 ) { // Now, let's expanse the top of the queue VertexList reachedVertexes; - float reachedDistance = (float)(HUGE_VAL); + float reachedDistance = (float)(HUGE); //checkGraphConsistency(); if (ltracelevel() >= 600) { @@ -1267,7 +1274,7 @@ void Graph::Dijkstra() message << " Unable to reach target on net " << _working_net->getName() << "."; throw Error( message.str() ); } - assert( reachedDistance < (float)(HUGE_VAL) ); + assert( reachedDistance < (float)(HUGE) ); ltrace(600) << "Updating two connex components:" << endl; ltrace(600) << "1. " << (*(reachedVertexes.begin())) << endl; @@ -1368,8 +1375,8 @@ void Graph::Monotonic() while ( topEdge ) { Vertex* currentVertex = topEdge->getOpposite ( vertPred ); if ( currentVertex->getPosition().getY() <= targetY ) { - float vertDistance = (float)(HUGE_VAL); - float horzDistance = (float)(HUGE_VAL); + float vertDistance = (float)(HUGE); + float horzDistance = (float)(HUGE); vertDistance = vertPred->getDistance() + topEdge->getCost ( vertPred->getPredecessor() ); Edge* leftEdge = currentVertex->getHEdgeIn(); @@ -1443,8 +1450,8 @@ void Graph::Monotonic() while ( bottomEdge ) { Vertex* currentVertex = bottomEdge->getOpposite ( vertPred ); if ( currentVertex->getPosition().getY() >= targetY ) { - float vertDistance = (float)(HUGE_VAL); - float horzDistance = (float)(HUGE_VAL); + float vertDistance = (float)(HUGE); + float horzDistance = (float)(HUGE); vertDistance = vertPred->getDistance() + bottomEdge->getCost ( vertPred->getPredecessor() ); Edge* leftEdge = currentVertex->getHEdgeIn(); @@ -1812,7 +1819,7 @@ void Graph::rebuildConnexComponent ( Contact* contact, int connexID, Segment* ar contactVertex->setContact ( contact ); contactVertex->setConnexID ( connexID ); contactVertex->setNetStamp ( _netStamp ); - contactVertex->setDistance((float)(HUGE_VAL)); + contactVertex->setDistance((float)(HUGE)); contactVertex->setPredecessor(NULL); //cerr << "from :" << contact << endl; //cerr << "arrivalSegment: " << arrivalSegment << endl; @@ -1851,7 +1858,7 @@ void Graph::setNetStampConnexID ( Segment* segment, int connexID ) assert(vertex); vertex->setNetStamp ( _netStamp ); vertex->setConnexID ( connexID ); - vertex->setDistance((float)(HUGE_VAL)); + vertex->setDistance((float)(HUGE)); Edge* edge = vertex->getVEdgeOut(); assert(edge); edge->setNetStamp ( _netStamp ); @@ -1861,7 +1868,7 @@ void Graph::setNetStampConnexID ( Segment* segment, int connexID ) assert(vertex); vertex->setNetStamp ( _netStamp ); vertex->setConnexID ( connexID ); - vertex->setDistance((float)(HUGE_VAL)); + vertex->setDistance((float)(HUGE)); return; } if ( sourceLineIdx == targetLineIdx ) { // horizontal segment @@ -1870,7 +1877,7 @@ void Graph::setNetStampConnexID ( Segment* segment, int connexID ) assert(vertex); vertex->setNetStamp ( _netStamp ); vertex->setConnexID ( connexID ); - vertex->setDistance((float)(HUGE_VAL)); + vertex->setDistance((float)(HUGE)); Edge* edge = vertex->getHEdgeOut(); assert(edge); edge->setNetStamp ( _netStamp ); @@ -1880,7 +1887,7 @@ void Graph::setNetStampConnexID ( Segment* segment, int connexID ) assert(vertex); vertex->setNetStamp ( _netStamp ); vertex->setConnexID ( connexID ); - vertex->setDistance((float)(HUGE_VAL)); + vertex->setDistance((float)(HUGE)); return; } throw Error ( "Graph::setNetStampConnexId(): what sort of segment is that, a diagonal one?" ); @@ -2325,7 +2332,7 @@ void Graph::CleanRoutingState() // assert (vertex); // vertex->setLocalRingHook(NULL); // vertex->setConnexID(-1); - // vertex->setDistance((float)(HUGE_VAL)); + // vertex->setDistance((float)(HUGE)); // vertex->setPredecessor(NULL); // assert ( vertex->getVTuple() == NULL ); //}