From d6561da230320337f3442f93ae56852a5d93a070 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 14 Dec 2004 19:02:07 +0000 Subject: [PATCH] * nero/src/ : - Bug : the global qualification of a net was independent of the RBox choice. The bug occurs for designs about the size of the local/ global choice : when the routing is still local but some nets have a size that made them global. In that cases terminals are extented (for global routing) outside of the routing box : in z=3 where z <= 2, which leads to immediate memory corruption. --- alliance/src/nero/src/AAstar.cpp | 4 +-- alliance/src/nero/src/ASimple.cpp | 8 +++--- alliance/src/nero/src/MDefs.h | 30 +++++++++++++++++----- alliance/src/nero/src/MNet.cpp | 42 +++++++++++++++++++++---------- alliance/src/nero/src/RMBK.cpp | 4 +-- alliance/src/nero/src/nero.cpp | 4 +-- 6 files changed, 63 insertions(+), 29 deletions(-) diff --git a/alliance/src/nero/src/AAstar.cpp b/alliance/src/nero/src/AAstar.cpp index 14f4ef74..a8154d20 100644 --- a/alliance/src/nero/src/AAstar.cpp +++ b/alliance/src/nero/src/AAstar.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // -// $Id: AAstar.cpp,v 1.8 2002/11/17 16:40:13 jpc Exp $ +// $Id: AAstar.cpp,v 1.9 2004/12/14 19:02:07 jpc Exp $ // // /----------------------------------------------------------------\ // | | @@ -554,7 +554,7 @@ void CAStar::load (CNet *pNet, int delta, int expand) _skip = false; if (net->size < 2) { _skip = true; return; } - _drgrid->pri->load (*pNet, _netsched->rglobal && pNet->global(), expand); + _drgrid->pri->load (*pNet, pNet->global(_netsched->rglobal), expand); _drgrid->pri->delta = delta; net->unroute (); diff --git a/alliance/src/nero/src/ASimple.cpp b/alliance/src/nero/src/ASimple.cpp index caeece9f..b470d3f2 100644 --- a/alliance/src/nero/src/ASimple.cpp +++ b/alliance/src/nero/src/ASimple.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // -// $Id: ASimple.cpp,v 1.2 2002/10/13 14:22:47 jpc Exp $ +// $Id: ASimple.cpp,v 1.3 2004/12/14 19:02:07 jpc Exp $ // // /----------------------------------------------------------------\ // | | @@ -41,11 +41,11 @@ void CASimple::CQueue::load (MNet *nets, bool rglobal, bool global) endNet = nets->end(); for (itNet = nets->begin(); itNet != endNet; itNet++) { // Global routing stage. - if ( rglobal && global && (itNet->second->global()) ) + if ( global && (itNet->second->global(rglobal)) ) push (itNet->second); // Local routing stage. - if ( !rglobal || ( !global && !(itNet->second->global()) ) ) + if ( !rglobal || ( !global && !(itNet->second->global(true)) ) ) push (itNet->second); } } @@ -113,7 +113,7 @@ void CASimple::global (void) // Locking global signals. endNet = nets->end(); for (itNet = nets->begin(); itNet != endNet; itNet++) { - if ( itNet->second->global() ) itNet->second->locktree(); + if ( itNet->second->global(rglobal) ) itNet->second->locktree(); } } diff --git a/alliance/src/nero/src/MDefs.h b/alliance/src/nero/src/MDefs.h index 7f1fc8a5..13189da0 100644 --- a/alliance/src/nero/src/MDefs.h +++ b/alliance/src/nero/src/MDefs.h @@ -1,7 +1,7 @@ // -*- C++ -*- // -// $Id: MDefs.h,v 1.6 2004/07/23 08:50:05 jpc Exp $ +// $Id: MDefs.h,v 1.7 2004/12/14 19:02:07 jpc Exp $ // // /-----------------------------------------------------------------\ // | | @@ -540,14 +540,32 @@ class merge_term : public except_done { // Attributes. - public: int id; + string message; + public: int id; // Constructor. - public: merge_term (int mergeid) { id = mergeid; } + public: merge_term ( int ident + , string& tn1 + , string& tn2 + , string& nn + , long x + , long y + , long z + ) + : id(ident) + { + ostringstream m; + m << "Terminals \"" << tn1 << "\" and \"" << tn2 << "\" of net \"" << nn + << "\" overlaps at " << "(" << x << "," << y << "," << z << ")"; + message = m.str(); + } + + // Destructor. + public: ~merge_term (void) throw () { }; // Overridables. public: const char* what () const throw () { - return ((char*)"Terminal must be merged."); + return (message.c_str()); } }; @@ -667,13 +685,13 @@ public: bool operator< (CNet &other); // Accessor. - public: bool global (void) { return (bb.hp >= D::GLOBAL_HP); } + public: bool global (bool rglobal); // Modifiers. public: void newaccess (string termName, int x, int y, int z); public: void newaccess (string termName, CRect &rect, int z); public: void order (void); - public: void lockalone (void); + public: void lockalone (bool rglobal); public: void locktree (void); public: void unroute (void); diff --git a/alliance/src/nero/src/MNet.cpp b/alliance/src/nero/src/MNet.cpp index 9c45e0b1..00a42cf3 100644 --- a/alliance/src/nero/src/MNet.cpp +++ b/alliance/src/nero/src/MNet.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // -// $Id: MNet.cpp,v 1.6 2002/11/04 14:43:08 jpc Exp $ +// $Id: MNet.cpp,v 1.7 2004/12/14 19:02:07 jpc Exp $ // // /----------------------------------------------------------------\ // | | @@ -146,7 +146,6 @@ CNode *CTerm::newaccess (int x, int y, int z, int ident, CNet *net) CNode *pNode; - coord = net->_drgrid->origin; coord.set (x, y, z); @@ -171,7 +170,14 @@ CNode *CTerm::newaccess (int x, int y, int z, int ident, CNet *net) // Check if the node belongs to another terminal of this net. // If so, send a merging exception to CNet::newaccess (). - if (pNode->getid () != ident) throw merge_term ( pNode->getid () ); + if (pNode->getid () != ident) throw merge_term ( pNode->getid() + , pNode->data.owner->terms[pNode->getid()]->name + , pNode->data.owner->terms[ident]->name + , net->name + , coord.x() + , coord.y() + , coord.z() + ); return (NULL); } @@ -246,7 +252,6 @@ void CTerm::lockalone (bool global) int z, i; bool adjust; - if (nodes.size() != 1) return; coord = nodes.back (); @@ -255,14 +260,14 @@ void CTerm::lockalone (bool global) if ( (coord.z() > 0) && !global ) return; if ( coord.onAB()) return; - //cerr << "+ locking lone terminal : " << coord.node().data.owner->name - // << " at " << coord - // << endl; + cerr << "+ locking lone terminal : " << coord.node().data.owner->name + << " at " << coord + << endl; // All terminal case, eat up z=1 (ALU2) if not already took. if (coord.z() == 0) { // Go to z=1 (ALU2). - //cerr << "+ locking z=1 " << coord << endl; + cerr << "+ locking z=1 " << coord << endl; newaccess ( coord.x() , coord.y() , 1 @@ -278,7 +283,7 @@ void CTerm::lockalone (bool global) if (coord.z() < 2) { // Go to z=2 (ALU3). - //cerr << "+ locking z=2 " << coord2 << endl; + cerr << "+ locking z=2 " << coord2 << endl; newaccess ( coord2.x() , coord2.y() , 2 @@ -317,7 +322,7 @@ void CTerm::lockalone (bool global) if (adjust) { // Adjust to the double grid pitch to z=2 (ALU3). - //cerr << "+ locking z=2 (ADJUST) " << coord2 << endl; + cerr << "+ locking z=2 (ADJUST) " << coord2 << endl; newaccess ( coord2.x() , coord2.y() , 2 @@ -330,7 +335,7 @@ void CTerm::lockalone (bool global) if (coord.z() < 4) { // Go to z=3 (ALU3). - //cerr << "+ locking z=3 " << coord2 << endl; + cerr << "+ locking z=3 " << coord2 << endl; newaccess ( coord2.x() , coord2.y() , 3 @@ -425,6 +430,17 @@ bool CNet::operator< (CNet &other) +// ------------------------------------------------------------------- +// Method : "CNet::global()". + +bool CNet::global (bool rglobal) +{ + return ((bb.hp >= D::GLOBAL_HP) && rglobal); +} + + + + // ------------------------------------------------------------------- // Method : "CNet::newaccess()". @@ -504,12 +520,12 @@ void CNet::newaccess (string termName, CRect &rect, int z) // ------------------------------------------------------------------- // Method : "CNet::lockalone()". -void CNet::lockalone (void) +void CNet::lockalone (bool rglobal) { int id; - for (id = 0; id < size; id++) terms[id]->lockalone (global()); + for (id = 0; id < size; id++) terms[id]->lockalone (global(rglobal)); } diff --git a/alliance/src/nero/src/RMBK.cpp b/alliance/src/nero/src/RMBK.cpp index 75c8c28e..94435273 100644 --- a/alliance/src/nero/src/RMBK.cpp +++ b/alliance/src/nero/src/RMBK.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // -// $Id: RMBK.cpp,v 1.6 2002/11/04 14:43:08 jpc Exp $ +// $Id: RMBK.cpp,v 1.7 2004/12/14 19:02:07 jpc Exp $ // // /----------------------------------------------------------------\ // | | @@ -327,7 +327,7 @@ void CRBox::mbkload (MBK::CFig *mbkfig, int z, int zup, int rtype) // Reorder terminals (nearest). pNet->order (); - pNet->lockalone (); + pNet->lockalone (rglobal); cdebug << "+ " << pNet->bb << ".\n"; } // End of "pSig" (signal) loop. diff --git a/alliance/src/nero/src/nero.cpp b/alliance/src/nero/src/nero.cpp index 2e015906..dfe03485 100644 --- a/alliance/src/nero/src/nero.cpp +++ b/alliance/src/nero/src/nero.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // -// $Id: nero.cpp,v 1.5 2002/11/17 16:40:14 jpc Exp $ +// $Id: nero.cpp,v 1.6 2004/12/14 19:02:07 jpc Exp $ // // /----------------------------------------------------------------\ // | | @@ -273,7 +273,7 @@ int main (int argc, char *argv[]) exit (1); } catch (except_done &e) { - //cerr << e.what () << endl; + cerr << e.what () << endl; emergency (); exit (1);