From 0118f02c3f54922cce6d4f1fdde1a507306ffd73 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 11 Jun 2008 09:20:35 +0000 Subject: [PATCH] * ./alliance/src/nero : - New feature : explicit selection of nets to route. - Patch for gcc 4.3 (from Thibault North). - Bug correction from G. Petley on "yoffset" in mbksave. --- alliance/src/nero/src/ADefs.h | 4 ++-- alliance/src/nero/src/MDefs.h | 4 +++- alliance/src/nero/src/MMBK.cpp | 19 ++++++++++------ alliance/src/nero/src/RDefs.h | 5 +++-- alliance/src/nero/src/RMBK.cpp | 24 +++++++++++++++----- alliance/src/nero/src/nero.cpp | 40 ++++++++++++++++++++++++++++------ 6 files changed, 72 insertions(+), 24 deletions(-) diff --git a/alliance/src/nero/src/ADefs.h b/alliance/src/nero/src/ADefs.h index 0cea111b..2af05526 100644 --- a/alliance/src/nero/src/ADefs.h +++ b/alliance/src/nero/src/ADefs.h @@ -1,7 +1,7 @@ // -*- C++ -*- // -// $Id: ADefs.h,v 1.3 2002/10/29 18:46:03 jpc Exp $ +// $Id: ADefs.h,v 1.4 2008/06/11 09:20:34 jpc Exp $ // // /-----------------------------------------------------------------\ // | | @@ -138,7 +138,7 @@ // Allocators. private: static void *operator new (size_t size); - private: static void operator delete (void *zone); + public: static void operator delete (void *zone); public: static void *operator new (size_t size, CNodeASSet &NS); // Modifiers. diff --git a/alliance/src/nero/src/MDefs.h b/alliance/src/nero/src/MDefs.h index 2b12d715..1a3e922e 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.8 2005/10/10 15:34:05 jpc Exp $ +// $Id: MDefs.h,v 1.9 2008/06/11 09:20:34 jpc Exp $ // // /-----------------------------------------------------------------\ // | | @@ -25,6 +25,8 @@ # include "UDefs.h" +# include +# include diff --git a/alliance/src/nero/src/MMBK.cpp b/alliance/src/nero/src/MMBK.cpp index efc48425..e7369d3e 100644 --- a/alliance/src/nero/src/MMBK.cpp +++ b/alliance/src/nero/src/MMBK.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // -// $Id: MMBK.cpp,v 1.8 2005/10/17 23:11:05 jpc Exp $ +// $Id: MMBK.cpp,v 1.9 2008/06/11 09:20:34 jpc Exp $ // // /-----------------------------------------------------------------\ // | | @@ -468,7 +468,6 @@ ostream &operator<< (ostream &o, const CEnv &self) CLofig::CLofig (string &name) { loins_list *pLoins; - losig_list *pLosig; cmess1 << " o Loading netlist \"" << name << "\"...\n"; @@ -478,11 +477,6 @@ CLofig::CLofig (string &name) for (pLoins = fig->LOINS; pLoins != NULL; pLoins = pLoins->NEXT) { instances[pLoins->INSNAME] = pLoins; } - - // Build the signal dictionnary. - for (pLosig = fig->LOSIG; pLosig != NULL; pLosig = pLosig->NEXT) { - signals[getsigname(pLosig)] = pLosig; - } } @@ -505,6 +499,8 @@ CLofig::~CLofig (void) void CLofig::rflatten (char concat, char catal) { loins_list *pLoins; + losig_list *pLosig; + chain_list *pChain; cmess2 << " o Flattening netlist...\n"; @@ -515,6 +511,15 @@ void CLofig::rflatten (char concat, char catal) for (pLoins = fig->LOINS; pLoins != NULL; pLoins = pLoins->NEXT) { instances[pLoins->INSNAME] = pLoins; } + + // Build the signal dictionnary. + // Load all name aliases. + for (pLosig = fig->LOSIG; pLosig != NULL; pLosig = pLosig->NEXT) { + //signals[getsigname(pLosig)] = pLosig; + for (pChain = pLosig->NAMECHAIN ; pChain !=NULL; pChain = pChain->NEXT) { + signals[(char*)pChain->DATA] = pLosig; + } + } } diff --git a/alliance/src/nero/src/RDefs.h b/alliance/src/nero/src/RDefs.h index e0a79cf1..31aac80c 100644 --- a/alliance/src/nero/src/RDefs.h +++ b/alliance/src/nero/src/RDefs.h @@ -1,7 +1,7 @@ // -*- C++ -*- // -// $Id: RDefs.h,v 1.4 2005/10/10 15:34:06 jpc Exp $ +// $Id: RDefs.h,v 1.5 2008/06/11 09:20:34 jpc Exp $ // // /-----------------------------------------------------------------\ // | | @@ -70,7 +70,8 @@ , int zup , int rtype , bool halfpitch - , bool rotate ); + , bool rotate + , set* subNetList=NULL ); public: void mbksave (string &name) throw (except_done); public: void route (void); diff --git a/alliance/src/nero/src/RMBK.cpp b/alliance/src/nero/src/RMBK.cpp index e09ea4ff..d83666ca 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.16 2006/04/12 16:33:00 jpc Exp $ +// $Id: RMBK.cpp,v 1.17 2008/06/11 09:20:34 jpc Exp $ // // /----------------------------------------------------------------\ // | | @@ -38,10 +38,12 @@ void CRBox::mbkload (MBK::CFig *mbkfig , int zup , int rtype , bool halfpitch - , bool rotate ) + , bool rotate + , set* subNetList ) { MBK::MIns::iterator itIns, endInstances, endOrphans; MBK::MLosig::iterator endSig; + MBK::MLosig::iterator sig; long mX, mY, mZ, x, y, zz, xadjust, yadjust, yoffsetslice; long XRW1, YRW1, XRW2, YRW2; bool use_global; @@ -327,7 +329,8 @@ void CRBox::mbkload (MBK::CFig *mbkfig } // Partially routed signals. - if (fig->lofig.signals.find(pSeg->NAME) == endSig) { + sig = fig->lofig.signals.find(pSeg->NAME); + if ( sig == endSig) { cerr << hwarn ("") << " The segment \"" << pSeg->NAME << "\" at (" << MBK::UNSCALE (pSeg->X1) << "," @@ -340,7 +343,7 @@ void CRBox::mbkload (MBK::CFig *mbkfig continue; } - pNet = getnet (pSeg->NAME); + pNet = getnet (getsigname(sig->second)); if ( !pNet->fixed ) { cmess2 << " o Signal " << pNet->name << " is assumed to be routed.\n"; pNet->fixed = true; @@ -542,6 +545,17 @@ void CRBox::mbkload (MBK::CFig *mbkfig cdebug << "+ " << pNet->bb << ".\n"; } // End of "pSig" (signal) loop. + // Restrict routed nets to the subNetList. + if ( subNetList ) { + for ( MNet::iterator it=nets.begin() ; it != nets.end() ; it++ ) { + if ( subNetList->find(it->first) != subNetList->end() ) { + cmess2 << " o Restricting nets to route.\n"; + cmess2 << " - \"" << it->first << "\".\n"; + } else + it->second->fixed = true; + } + } + // Allocate the net scheduler. cmess2 << " o Allocating the net scheduler.\n"; @@ -579,7 +593,7 @@ void CRBox::mbkload (MBK::CFig *mbkfig } // Bottom & top horizontal edges. - if ( xadjust == 0 ) { + if ( yadjust == 0 ) { for (y = 0; y < mY; y += mY - 1) { for (x = 0; x < mX; x++) { for (zz = 1; zz < mZ; zz++) { diff --git a/alliance/src/nero/src/nero.cpp b/alliance/src/nero/src/nero.cpp index 4c900517..d26ecf41 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.11 2006/04/12 16:33:00 jpc Exp $ +// $Id: nero.cpp,v 1.12 2008/06/11 09:20:35 jpc Exp $ // // /----------------------------------------------------------------\ // | | @@ -79,6 +79,8 @@ static void help (void) << " [-6|--layers-6] := Use only 6 routing layers.\n" << " [-G|--global] := Force use of global routing.\n" << " [-L|--local] := Disable use of global routing.\n" + << " [-N]--netset ] :=\n" + << " Route only this subset of nets.\n" << " [-p|--place ] :=\n" << " Name of the layout file holding the placement, without\n" << " extention. If ommited the layout file is assumed to have\n" @@ -96,7 +98,7 @@ static void help (void) static void serial (void) { - cout << " S/N 20051017.1\n"; + cout << " S/N 20080611.1\n"; } @@ -136,10 +138,11 @@ void emergency (void) int main (int argc, char *argv[]) { - COpts options; - MBK::CFig *fig; - string name_lofig, name_placed, name_routed; - int layers, global; + COpts options; + MBK::CFig *fig; + string name_lofig, name_placed, name_routed; + int layers, global; + set* netSet = NULL; try { @@ -157,6 +160,7 @@ int main (int argc, char *argv[]) options.add ("G", "global"); options.add ("L", "local"); options.add ("p", "place", true); + options.add ("N", "netset", true); options.getopts (argc, argv); if (options["c"]->parsed) interrupt.coredump = true; @@ -200,6 +204,25 @@ int main (int argc, char *argv[]) name_placed = name_lofig; } + if (options["N"]->parsed) { + string fileNetSet = options["N"]->value; + cout << "File: " << fileNetSet << endl; + FILE* file = fopen ( fileNetSet.c_str(), "r" ); + if ( file ) { + cout << "File Sucessfully opened." << endl; + netSet = new set(); + char buffer[2048]; + while ( !feof(file) ) { + fgets ( buffer, 2048, file ); + size_t length = strlen(buffer); + if ( buffer[length-1] == '\n' ) + buffer[length-1] = '\0'; + netSet->insert ( buffer ); + } + fclose ( file ); + } + } + layers = 3; if (options["2"]->parsed) layers = 3; if (options["3"]->parsed) layers = 4; @@ -226,10 +249,13 @@ int main (int argc, char *argv[]) , 4 , global , options["H"]->parsed - , options["R"]->parsed ); + , options["R"]->parsed + , netSet ); //cdebug.off (); crbox->route (); crbox->mbksave (name_routed); + + if ( netSet ) delete netSet; }