* attila/src/MDRGrid.cpp,

attila/src/MDefs.h,
   attila/src/MNet.cpp,
   attila/src/MPri.cpp,
   attila/src/RMBK.cpp :
   - Bug : la modification pour router les RAMs (segments de taille nulle)
       a introduit un bug : pleins de petits segments de taille nulle
       apparaissaient superposes aux segments normaux. C'etait produit
       par le balayage dans la direction perpendiculaire a la direction
       preferentielle quant elle rencontrait un segment.
         Conclusion : pour l'instant on ne peut pas router une RAM seule.
   - Bug : dans "::newaccess()" je ne verifiait pas si le noeud etait
       deja pris par un autre signal. J'espere que c'est ce qui provo-
       quait les SIGABRT (du a un auto-ecrasement du programme...)
   - Bug : Et les VIAs patate ! Prise en compte des VIAs des alimentations
       et transformation en obstacles.
   - L'espacement des pistes de routage ALU5 et superieures est
       desormait de 2 pitchs (10 lambdas) pour faire plaisir a druc.
This commit is contained in:
Jean-Paul Chaput 2002-10-17 21:57:27 +00:00
parent 63d46c36db
commit 89d90c5430
9 changed files with 172 additions and 40 deletions

View File

@ -1,7 +1,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// $Id: AAstar.cpp,v 1.3 2002/10/15 14:35:36 jpc Exp $ // $Id: AAstar.cpp,v 1.4 2002/10/17 21:57:27 jpc Exp $
// //
// /----------------------------------------------------------------\ // /----------------------------------------------------------------\
// | | // | |
@ -768,11 +768,13 @@ void CAStar::dump (void)
iterations_reroute = 0; iterations_reroute = 0;
iterations_kind = &iterations_route; iterations_kind = &iterations_route;
//if (pNet->name == "c2 0") cdebug.on (); //if (pNet->name == "acc_i_down") cdebug.on ();
do { do {
if (hysteresis) { if (hysteresis) {
cdebug << "About to clear." << "\n";
clear (); clear ();
cdebug << "cleared." << "\n";
pri = 255 + (1 << increase++); pri = 255 + (1 << increase++);
@ -783,12 +785,18 @@ void CAStar::dump (void)
else else
pri = 0; pri = 0;
cdebug << "About to load net " << iterations_kind << "\n";
load (pNet, pri, expand); load (pNet, pri, expand);
cdebug << "loading done " << iterations_kind << "\n";
cdebug << "About to route net " << iterations_kind << "\n";
routed = !search (); routed = !search ();
cdebug << "routing done " << iterations_kind << "\n";
*iterations_kind += iterations; *iterations_kind += iterations;
cdebug << "mark 1.\n";
hysteresis = true; hysteresis = true;
cdebug << "mark 2.\n";
} while ((increase < 15) && !routed); } while ((increase < 15) && !routed);
if (increase >= 15) throw reach_max_pri (pNet); if (increase >= 15) throw reach_max_pri (pNet);

View File

@ -1,7 +1,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// $Id: MDRGrid.cpp,v 1.1 2002/10/02 21:23:47 jpc Exp $ // $Id: MDRGrid.cpp,v 1.2 2002/10/17 21:57:27 jpc Exp $
// //
// /----------------------------------------------------------------\ // /----------------------------------------------------------------\
// | | // | |
@ -336,6 +336,7 @@ CDRGrid::CDRGrid (int x, int y, int z)
XYZ = XY * Z; XYZ = XY * Z;
size = XY * (Z - 1); size = XY * (Z - 1);
nodes = new CMatrixNodes (this); nodes = new CMatrixNodes (this);
pri = new CMatrixPri (this); pri = new CMatrixPri (this);

View File

@ -1,7 +1,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// $Id: MDefs.h,v 1.2 2002/10/15 14:35:37 jpc Exp $ // $Id: MDefs.h,v 1.3 2002/10/17 21:57:27 jpc Exp $
// //
// /-----------------------------------------------------------------\ // /-----------------------------------------------------------------\
// | | // | |
@ -518,7 +518,8 @@
public: CDRGrid::iterator &lowest (void); public: CDRGrid::iterator &lowest (void);
// Modifiers. // Modifiers.
public: CNode *newaccess (int x, int y, int z, int ident, CNet *net) throw (dup_term); public: CNode *newaccess (int x, int y, int z, int ident, CNet *net)
throw (dup_term, bad_grab);
public: void newaccess (CRect &rect, int z, int ident, CNet *net); public: void newaccess (CRect &rect, int z, int ident, CNet *net);
public: void lockalone (bool global=false); public: void lockalone (bool global=false);
public: void setid (int ident); public: void setid (int ident);

View File

@ -1,7 +1,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// $Id: MMBK.cpp,v 1.2 2002/10/13 14:22:47 jpc Exp $ // $Id: MMBK.cpp,v 1.3 2002/10/17 21:57:27 jpc Exp $
// //
// /-----------------------------------------------------------------\ // /-----------------------------------------------------------------\
// | | // | |
@ -1105,6 +1105,50 @@ long cmpALU (char layer1, char layer2)
// -------------------------------------------------------------------
// Function : "topVIALayer()".
char topVIALayer (char type)
{
switch (type) {
case CONT_VIA: return (ALU1); break;
case CONT_VIA2: return (ALU2); break;
case CONT_VIA3: return (ALU3); break;
case CONT_VIA4: return (ALU4); break;
case CONT_VIA5: return (ALU5); break;
case CONT_VIA6: return (ALU6); break;
case CONT_VIA7: return (ALU7); break;
}
return (ALU8);
}
// -------------------------------------------------------------------
// Function : "bottomVIALayer()".
char bottomVIALayer (char type)
{
switch (type) {
case CONT_VIA: return (ALU2); break;
case CONT_VIA2: return (ALU3); break;
case CONT_VIA3: return (ALU4); break;
case CONT_VIA4: return (ALU5); break;
case CONT_VIA5: return (ALU6); break;
case CONT_VIA6: return (ALU7); break;
case CONT_VIA7: return (ALU8); break;
}
return (ALU9);
}
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// End of MBK namespace. // End of MBK namespace.

View File

@ -1,7 +1,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// $Id: MMBK.h,v 1.1 2002/10/02 21:23:47 jpc Exp $ // $Id: MMBK.h,v 1.2 2002/10/17 21:57:27 jpc Exp $
// //
// /-----------------------------------------------------------------\ // /-----------------------------------------------------------------\
// | | // | |
@ -89,11 +89,13 @@ namespace MBK {
extern char *layer2a (char layer); extern char *layer2a (char layer);
extern bool isobs (char layer); extern bool isobs (char layer);
extern bool isALU(char layer); extern bool isALU (char layer);
extern bool isCALU(char layer); extern bool isCALU (char layer);
extern char layer2ALU(char layer); extern char layer2ALU (char layer);
extern char layer2CALU(char layer); extern char layer2CALU (char layer);
extern long cmpALU(char layer1, char layer2); extern long cmpALU (char layer1, char layer2);
extern char topVIALayer (char type);
extern char bottomVIALayer (char type);

View File

@ -1,7 +1,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// $Id: MNet.cpp,v 1.2 2002/10/13 14:22:47 jpc Exp $ // $Id: MNet.cpp,v 1.3 2002/10/17 21:57:27 jpc Exp $
// //
// /----------------------------------------------------------------\ // /----------------------------------------------------------------\
// | | // | |
@ -138,7 +138,8 @@ CDRGrid::iterator &CTerm::lowest (void)
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Method : "CTerm::newaccess()". // Method : "CTerm::newaccess()".
CNode *CTerm::newaccess (int x, int y, int z, int ident, CNet *net) throw (dup_term) CNode *CTerm::newaccess (int x, int y, int z, int ident, CNet *net)
throw (dup_term, bad_grab)
{ {
list<CDRGrid::iterator>::iterator itNode; list<CDRGrid::iterator>::iterator itNode;
CDRGrid::iterator coord; CDRGrid::iterator coord;
@ -161,6 +162,19 @@ CNode *CTerm::newaccess (int x, int y, int z, int ident, CNet *net) throw (dup_t
pNode = &coord.addnode (); pNode = &coord.addnode ();
} }
// Check if the node has already been took by another terminal.
if (pNode->data.owner && (pNode->data.owner != net))
throw bad_grab ( pNode->data.owner->terms[pNode->getid()]->name
, net->name
, coord.x()
, coord.y()
, coord.z()
, 0
, pNode->data.pri
, pNode->terminal()
, pNode->data.ident
);
pNode->data.owner = net; pNode->data.owner = net;
pNode->data.obstacle = false; pNode->data.obstacle = false;
pNode->setid (ident); pNode->setid (ident);
@ -189,7 +203,7 @@ void CTerm::newaccess (CRect &rect, int z, int ident, CNet *net)
if (z > 0) return; if (z > 0) return;
// Only z=0 rectangles are stored (ALU1 is not in the grid). // Only z=0 rectangles are stored (ALU1 is not in the grid).
//if ((rect.x1 != rect.x2) || (rect.y1 != rect.y2)) // if ((rect.x1 != rect.x2) || (rect.y1 != rect.y2))
// No! Store all ALU1 rectangles. // No! Store all ALU1 rectangles.
rects.push_back (rect); rects.push_back (rect);
} }

View File

@ -1,7 +1,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// $Id: MPri.cpp,v 1.2 2002/10/15 14:35:37 jpc Exp $ // $Id: MPri.cpp,v 1.3 2002/10/17 21:57:27 jpc Exp $
// //
// /----------------------------------------------------------------\ // /----------------------------------------------------------------\
// | | // | |
@ -87,7 +87,7 @@ void CMatrixPri::findfree (int index, CNet &net)
void CMatrixPri::clear (void) void CMatrixPri::clear (void)
{ {
memset (_grid, (char)0, _drgrid->size); memset (_grid, (char)0, (size_t)(_drgrid->size));
cleared = true; cleared = true;
offset = 0; offset = 0;
@ -174,6 +174,7 @@ void CMatrixPri::load (CNet &net, bool global, int expand=0)
// Enable z=1 (in case of global signal, no effet otherwise). // Enable z=1 (in case of global signal, no effet otherwise).
if (coord.z() < _drgrid->Z - 1) (*this)[ coord.dz(1) ] = (char)1; if (coord.z() < _drgrid->Z - 1) (*this)[ coord.dz(1) ] = (char)1;
if (global) {
// Check for blocked upper nodes. // Check for blocked upper nodes.
other = (*_drgrid->nodes)[coord].data.owner; other = (*_drgrid->nodes)[coord].data.owner;
if ( (*_drgrid->nodes)[coord].data.obstacle if ( (*_drgrid->nodes)[coord].data.obstacle
@ -181,6 +182,7 @@ void CMatrixPri::load (CNet &net, bool global, int expand=0)
cdebug << "Looking for an escape!\n" << "\n"; cdebug << "Looking for an escape!\n" << "\n";
findfree (coord, net); findfree (coord, net);
} }
}
continue; continue;
} }
@ -188,6 +190,7 @@ void CMatrixPri::load (CNet &net, bool global, int expand=0)
(*this)[ coord.dz(1) ] = nextPri (currentPri); (*this)[ coord.dz(1) ] = nextPri (currentPri);
nextBorder->push (new CDRGrid::iterator (coord)); nextBorder->push (new CDRGrid::iterator (coord));
if (global) {
// Check for blocked upper nodes. // Check for blocked upper nodes.
other = (*_drgrid->nodes)[coord].data.owner; other = (*_drgrid->nodes)[coord].data.owner;
if ( (*_drgrid->nodes)[coord].data.obstacle if ( (*_drgrid->nodes)[coord].data.obstacle
@ -195,12 +198,14 @@ void CMatrixPri::load (CNet &net, bool global, int expand=0)
cdebug << "Looking for an escape!\n" << "\n"; cdebug << "Looking for an escape!\n" << "\n";
findfree (coord, net); findfree (coord, net);
} }
}
// Enable z=2 (in case of global signal, no effet otherwise). // Enable z=2 (in case of global signal, no effet otherwise).
(*this)[ coord.dz(1) ] = (char)1; (*this)[ coord.dz(1) ] = (char)1;
// Look if the upper node is blocked, in that case expand the // Look if the upper node is blocked, in that case expand the
// allowed zone till a non-blocked node is found. // allowed zone till a non-blocked node is found.
if (global) {
other = (*_drgrid->nodes)[coord].data.owner; other = (*_drgrid->nodes)[coord].data.owner;
if ( (*_drgrid->nodes)[coord].data.obstacle if ( (*_drgrid->nodes)[coord].data.obstacle
|| ((other != NULL) && (other != &net)) ) { || ((other != NULL) && (other != &net)) ) {
@ -209,10 +214,12 @@ void CMatrixPri::load (CNet &net, bool global, int expand=0)
} }
} }
} }
}
// Set to one all the points inside the enclosing box. // Set to one all the points inside the enclosing box.
// (except those in the initial queues) // (except those in the initial queues)
cdebug << _bb << "\n";
for (x = _bb.x1; x <= _bb.x2; x++) { for (x = _bb.x1; x <= _bb.x2; x++) {
for (y = _bb.y1; y <= _bb.y2; y++) { for (y = _bb.y1; y <= _bb.y2; y++) {
for (z = (global) ? 3 : 1; z < _drgrid->Z; z++) { for (z = (global) ? 3 : 1; z < _drgrid->Z; z++) {

View File

@ -1,7 +1,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// $Id: RMBK.cpp,v 1.3 2002/10/15 14:35:37 jpc Exp $ // $Id: RMBK.cpp,v 1.4 2002/10/17 21:57:27 jpc Exp $
// //
// /----------------------------------------------------------------\ // /----------------------------------------------------------------\
// | | // | |
@ -44,6 +44,7 @@ void CRBox::mbkload (MBK::CFig *mbkfig, int z, int rtype)
MBK::phcon_list *pPhcon; MBK::phcon_list *pPhcon;
MBK::losig_list *pSig; MBK::losig_list *pSig;
MBK::phseg_list *pSeg, flatSeg; MBK::phseg_list *pSeg, flatSeg;
MBK::phvia_list *pVIA;
MBK::phfig_list *pModel; MBK::phfig_list *pModel;
MBK::CXRect *rect; MBK::CXRect *rect;
MBK::CIns *pIns; MBK::CIns *pIns;
@ -173,6 +174,33 @@ void CRBox::mbkload (MBK::CFig *mbkfig, int z, int rtype)
} }
// Browse for obstacle VIAs.
for (pVIA = fig->phfig.fig->PHVIA; pVIA != NULL; pVIA = pVIA->NEXT) {
// Only power VIAs must be obstacles.
if ( (! MBK::ISVDD (pVIA->NAME)) && (! MBK::ISVSS (pVIA->NAME)))
continue;
for (x = 0; x < 2; x++) {
switch (x) {
case 0: flatSeg.LAYER = MBK::topVIALayer (pVIA->TYPE); break;
case 1: flatSeg.LAYER = MBK::bottomVIALayer (pVIA->TYPE); break;
}
}
if (flatSeg.LAYER == MBK::CALU1) continue;
flatSeg.X1 = pVIA->XVIA - pVIA->DX / 2;
flatSeg.X2 = pVIA->XVIA - pVIA->DX / 2;
flatSeg.Y1 = pVIA->YVIA;
flatSeg.Y2 = pVIA->YVIA;
flatSeg.WIDTH = pVIA->DY;
rect->setSeg (flatSeg);
drgrid->nodes->obstacle (rect->grid, MBK::env.layer2z (flatSeg.LAYER));
}
// Browse layout for terminals. // Browse layout for terminals.
for (pPhcon = fig->phfig.fig->PHCON; pPhcon != NULL; pPhcon = pPhcon->NEXT) { for (pPhcon = fig->phfig.fig->PHCON; pPhcon != NULL; pPhcon = pPhcon->NEXT) {
if (fig->lofig.signals.find(pPhcon->NAME) == endSig) { if (fig->lofig.signals.find(pPhcon->NAME) == endSig) {
@ -343,6 +371,30 @@ void CRBox::mbkload (MBK::CFig *mbkfig, int z, int rtype)
} }
} }
// On routing level above ALU4, use only half of the tracks.
// Vertical tracks.
for (zz = 4; zz < mZ; zz += 2) {
for (x = 2; x < mX; x += 2) {
for (y = 1; y < mY - 1; y++) {
node = &( coord.set(x,y,zz).node() );
if ( !node->terminal() ) node->data.obstacle = true;
}
}
}
// Horizontal tracks.
for (zz = 5; zz < mZ; zz += 2) {
for (y = 2; y < mY; y += 2) {
for (x = 1; x < mX; x++) {
node = &( coord.set(x,y,zz).node() );
if ( !node->terminal() ) node->data.obstacle = true;
}
}
}
// This flag ensure that a figure has been successfully loaded. // This flag ensure that a figure has been successfully loaded.
@ -402,7 +454,7 @@ void CRBox::mbksave (string &name)
if (inseg && (pNextNet != pNet)) { if (inseg && (pNextNet != pNet)) {
// We are changing of segment owner. // We are changing of segment owner.
// Dump the current one. // Dump the current one.
if (seg.X1 <= seg.X2) { if (seg.X1 < seg.X2) {
// This is not a "dot" segment (i.e a VIA). // This is not a "dot" segment (i.e a VIA).
fig->addphseg (seg); fig->addphseg (seg);
} }
@ -433,7 +485,7 @@ void CRBox::mbksave (string &name)
} else { } else {
if (inseg) { if (inseg) {
// Dump the current one. // Dump the current one.
if (seg.X1 <= seg.X2) { if (seg.X1 < seg.X2) {
// This is not a "dot" segment (i.e a VIA). // This is not a "dot" segment (i.e a VIA).
fig->addphseg (seg); fig->addphseg (seg);
} }
@ -467,7 +519,7 @@ void CRBox::mbksave (string &name)
if (inseg && (pNextNet != pNet)) { if (inseg && (pNextNet != pNet)) {
// We are changing of segment owner. // We are changing of segment owner.
// Dump the current one. // Dump the current one.
if (seg.Y1 <= seg.Y2) { if (seg.Y1 < seg.Y2) {
// This is not a "dot" segment (i.e a VIA). // This is not a "dot" segment (i.e a VIA).
fig->addphseg (seg); fig->addphseg (seg);
} }
@ -512,7 +564,7 @@ void CRBox::mbksave (string &name)
if (inseg) { if (inseg) {
// This segment touch the AB. // This segment touch the AB.
if (seg.Y1 <= seg.Y2) { if (seg.Y1 < seg.Y2) {
// This is not a "dot" segment (i.e a VIA). // This is not a "dot" segment (i.e a VIA).
fig->addphseg (seg); fig->addphseg (seg);
} }

View File

@ -1,7 +1,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// $Id: USys.cpp,v 1.1 2002/10/02 21:23:49 jpc Exp $ // $Id: USys.cpp,v 1.2 2002/10/17 21:57:27 jpc Exp $
// //
// /----------------------------------------------------------------\ // /----------------------------------------------------------------\
// | | // | |
@ -77,6 +77,7 @@ static void trap_sig(int aSig)
case SIGFPE: case SIGFPE:
case SIGBUS: case SIGBUS:
case SIGSEGV: case SIGSEGV:
case SIGABRT:
emergency (); emergency ();
// Ouch !! This may result from a program bug. // Ouch !! This may result from a program bug.
@ -98,6 +99,7 @@ static void trap_sig(int aSig)
cerr << "(core will be dumped).\n"; cerr << "(core will be dumped).\n";
if ( (signal(SIGFPE , SIG_DFL) == SIG_ERR) if ( (signal(SIGFPE , SIG_DFL) == SIG_ERR)
|| (signal(SIGBUS , SIG_DFL) == SIG_ERR) || (signal(SIGBUS , SIG_DFL) == SIG_ERR)
|| (signal(SIGABRT, SIG_DFL) == SIG_ERR)
|| (signal(SIGSEGV, SIG_DFL) == SIG_ERR)) || (signal(SIGSEGV, SIG_DFL) == SIG_ERR))
exit (1); exit (1);
else { else {
@ -201,6 +203,7 @@ CInterrupt::CInterrupt (void)
// Set the trap function for SIGFPE, SIGBUS and SIGSEGV signals. // Set the trap function for SIGFPE, SIGBUS and SIGSEGV signals.
if ( (signal(SIGFPE , trap_sig) == SIG_ERR) if ( (signal(SIGFPE , trap_sig) == SIG_ERR)
|| (signal(SIGBUS , trap_sig) == SIG_ERR) || (signal(SIGBUS , trap_sig) == SIG_ERR)
|| (signal(SIGABRT, trap_sig) == SIG_ERR)
|| (signal(SIGSEGV, trap_sig) == SIG_ERR)) trap_sig (SIGTFLT); || (signal(SIGSEGV, trap_sig) == SIG_ERR)) trap_sig (SIGTFLT);
} }