From 5fba1d254858a3ed83b52dadb5c47eb0b4ce1070 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 22 Apr 2016 22:55:26 +0200 Subject: [PATCH] In Knik::Vertex, the _flags member was uninitialized. * Bug: In Knik, in Vertex the _flags attribute was unitialized. This flag is, in particular, telling if the vertex is blocked. That it was taking a random value, was leading to errors and unreproductible behaviors. I hope this will make the global router deterministic at last. This problem did show in the Stratus FIFO generator. * Bug: In Knik, in Vertex, remove the unused _boundingBox attribute. --- knik/src/Graph.cpp | 15 ++++++++++++--- knik/src/MatrixVertex.cpp | 4 ++++ knik/src/Vertex.cpp | 1 + knik/src/knik/Vertex.h | 1 - 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/knik/src/Graph.cpp b/knik/src/Graph.cpp index cc2d0c85..0947b31d 100644 --- a/knik/src/Graph.cpp +++ b/knik/src/Graph.cpp @@ -981,6 +981,10 @@ int Graph::initRouting ( Net* net ) //editor->Refresh(); //editor->Stop ("Going to init"); + //if (_working_net->getName() == "read0") DebugSession::open( 600 ); + ltrace(600) << "Graph::initRouting() " << _working_net << endl; + ltracein(600); + int currentConnexID = 0; vector vContacts; vector vRoutingPads; @@ -1029,9 +1033,9 @@ int Graph::initRouting ( Net* net ) //bool useConnexID = false; for ( unsigned index = 0 ; index < vRoutingPads.size() ; index ++ ) { RoutingPad* routingPad = vRoutingPads[index]; - //cerr << " RoutingPad :" << routingPad << endl; + ltrace(600) << routingPad << endl; Vertex* rpVertex = getVertex ( routingPad->getCenter() ); - //cerr << " Vertex :" << rpVertex << endl; + ltrace(600) << rpVertex << endl; Contact* rpContact = rpVertex->getContact(); if ( rpContact && (rpContact->getNet() == routingPad->getNet()) ) { // s'il existe deja un contact pour ce vertex pour ce net, on s'y attache @@ -1113,6 +1117,10 @@ int Graph::initRouting ( Net* net ) //cerr << "net " << net << " has " << _vertexes_to_route.size() << " vertexes to route." << endl; //} + + ltraceout(600); + //DebugSession::close(); + return _vertexes_to_route.size(); } @@ -1140,7 +1148,8 @@ void Graph::Dijkstra() //#endif //DebugSession::open( _working_net, 600 ); -//DebugSession::open( 600 ); +//if (_working_net->getName() == "read0") DebugSession::open( 600 ); + ltrace(600) << "Dijkstra for net: " << _working_net << endl; ltracein(600); ltrace(600) << "Stamp:" << _netStamp << endl; diff --git a/knik/src/MatrixVertex.cpp b/knik/src/MatrixVertex.cpp index 8adc2f0e..35c05a7a 100644 --- a/knik/src/MatrixVertex.cpp +++ b/knik/src/MatrixVertex.cpp @@ -382,7 +382,11 @@ Vertex* MatrixVertex::getVertex ( Point point ) { pair indexes = getIJ ( point ); Vertex* vertex = getVertex ( indexes ); + + ltrace(600) << "MatrixVertex::getVertex(): " << vertex << endl; + if (vertex and vertex->isBlocked()) { + ltrace(600) << "Vertex is blocked, looking for neighbor." << endl; Vertex* neighbor = NULL; for ( size_t i=0; i<4 ; ++i ) { neighbor = vertex->getFirstEdges(i)->getOpposite( vertex ); diff --git a/knik/src/Vertex.cpp b/knik/src/Vertex.cpp index 301b8568..332574e6 100644 --- a/knik/src/Vertex.cpp +++ b/knik/src/Vertex.cpp @@ -106,6 +106,7 @@ Vertex::Vertex ( Graph* routingGraph, Point position, DbU::Unit halfWidth, DbU:: , _netStamp (0) , _halfWidth (halfWidth) , _halfHeight (halfHeight) + , _flags(0) { _firstEdges[0] = NULL; _firstEdges[1] = NULL; diff --git a/knik/src/knik/Vertex.h b/knik/src/knik/Vertex.h index a5dc0851..a22c38fe 100644 --- a/knik/src/knik/Vertex.h +++ b/knik/src/knik/Vertex.h @@ -37,7 +37,6 @@ namespace Knik { unsigned _netStamp; DbU::Unit _halfWidth; // this corresponds to the half width of dual bin of the vertex DbU::Unit _halfHeight; // this corresponds to the half height of dual bin of the vertex - Box _boundingBox; unsigned int _flags; // Constructors & Destructors