* ./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.
This commit is contained in:
Jean-Paul Chaput 2008-06-11 09:20:35 +00:00
parent 2c032796cc
commit 0118f02c3f
6 changed files with 72 additions and 24 deletions

View File

@ -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.

View File

@ -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 <limits.h>
# include <string.h>

View File

@ -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;
}
}
}

View File

@ -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<string>* subNetList=NULL );
public: void mbksave (string &name) throw (except_done);
public: void route (void);

View File

@ -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<string>* 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++) {

View File

@ -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 <netset>] :=\n"
<< " Route only this subset of nets.\n"
<< " [-p|--place <placement>] :=\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<string>* 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<string>();
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;
}