Many bug corrections for the chip.

This commit is contained in:
Jean-Paul Chaput 2005-10-13 12:44:40 +00:00
parent 3d3f207c17
commit f460fc3511
6 changed files with 178 additions and 58 deletions

View File

@ -1,7 +1,7 @@
// -*- C++ -*-
//
// $Id: MMBK.cpp,v 1.6 2005/10/10 15:34:05 jpc Exp $
// $Id: MMBK.cpp,v 1.7 2005/10/13 12:44:39 jpc Exp $
//
// /-----------------------------------------------------------------\
// | |
@ -80,10 +80,9 @@ void CXRect::setSeg (phseg_list &rSeg)
void CXRect::seg2rect (void)
{
long width;
width = env.layer2width (seg.LAYER);
long width = env.layer2width (seg.LAYER);
long spacing = env.layer2spacing (seg.LAYER);
long expand;
// Special case of "point like" segments.
if ((seg.X1 == seg.X2) && (seg.Y1 == seg.Y2)) {
@ -98,8 +97,12 @@ void CXRect::seg2rect (void)
switch (seg.TYPE) {
case UP:
case DOWN:
rect.x1 = seg.X1 - (seg.WIDTH - width) / 2;
rect.x2 = seg.X2 + (seg.WIDTH - width) / 2;
//rect.x1 = seg.X1 - (seg.WIDTH - width) / 2;
//rect.x2 = seg.X2 + (seg.WIDTH - width) / 2;
expand = (seg.WIDTH + spacing - env.grid_dy) / 2;
if ( expand < 0 ) expand = 0;
rect.x1 = seg.X1 - expand;
rect.x2 = seg.X2 + expand;
rect.y1 = seg.Y1;
rect.y2 = seg.Y2;
break;
@ -108,8 +111,12 @@ void CXRect::seg2rect (void)
default:
rect.x1 = seg.X1;
rect.x2 = seg.X2;
rect.y1 = seg.Y1 - (seg.WIDTH - width) / 2;
rect.y2 = seg.Y2 + (seg.WIDTH - width) / 2;
//rect.y1 = seg.Y1 - (seg.WIDTH - width) / 2;
//rect.y2 = seg.Y2 + (seg.WIDTH - width) / 2;
expand = (seg.WIDTH + spacing - env.grid_dx) / 2;
if ( expand < 0 ) expand = 0;
rect.y1 = seg.Y1 - expand;
rect.y2 = seg.Y2 + expand;
break;
}
}
@ -188,18 +195,25 @@ CEnv::CEnv (void)
// Copy constants values from constants namespace ("D::").
// Routing constants, loaded now that we have SCALE_X.
D::X_GRID = ::MBK::SCALE (D::_X_GRID);
D::Y_GRID = ::MBK::SCALE (D::_Y_GRID);
D::WIDTH_VSS = ::MBK::SCALE (D::_WIDTH_VSS);
D::WIDTH_VDD = ::MBK::SCALE (D::_WIDTH_VDD);
D::Y_SLICE = ::MBK::SCALE (D::_Y_SLICE);
D::TRACK_WIDTH_ALU1 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU1);
D::TRACK_WIDTH_ALU2 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU2);
D::TRACK_WIDTH_ALU3 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU3);
D::TRACK_WIDTH_ALU4 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU4);
D::TRACK_WIDTH_ALU5 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU5);
D::TRACK_WIDTH_ALU6 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU6);
D::TRACK_WIDTH_ALU7 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU7);
D::X_GRID = ::MBK::SCALE (D::_X_GRID);
D::Y_GRID = ::MBK::SCALE (D::_Y_GRID);
D::WIDTH_VSS = ::MBK::SCALE (D::_WIDTH_VSS);
D::WIDTH_VDD = ::MBK::SCALE (D::_WIDTH_VDD);
D::Y_SLICE = ::MBK::SCALE (D::_Y_SLICE);
D::TRACK_WIDTH_ALU1 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU1);
D::TRACK_WIDTH_ALU2 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU2);
D::TRACK_WIDTH_ALU3 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU3);
D::TRACK_WIDTH_ALU4 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU4);
D::TRACK_WIDTH_ALU5 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU5);
D::TRACK_WIDTH_ALU6 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU6);
D::TRACK_WIDTH_ALU7 = ::MBK::SCALE (D::_TRACK_WIDTH_ALU7);
D::TRACK_SPACING_ALU1 = ::MBK::SCALE (D::_TRACK_SPACING_ALU1);
D::TRACK_SPACING_ALU2 = ::MBK::SCALE (D::_TRACK_SPACING_ALU2);
D::TRACK_SPACING_ALU3 = ::MBK::SCALE (D::_TRACK_SPACING_ALU3);
D::TRACK_SPACING_ALU4 = ::MBK::SCALE (D::_TRACK_SPACING_ALU4);
D::TRACK_SPACING_ALU5 = ::MBK::SCALE (D::_TRACK_SPACING_ALU5);
D::TRACK_SPACING_ALU6 = ::MBK::SCALE (D::_TRACK_SPACING_ALU6);
D::TRACK_SPACING_ALU7 = ::MBK::SCALE (D::_TRACK_SPACING_ALU7);
// Grid spacing.
grid_dx = D::X_GRID;
@ -228,6 +242,29 @@ CEnv::CEnv (void)
ALU2W[TALU6] = D::TRACK_WIDTH_ALU6;
ALU2W[TALU7] = D::TRACK_WIDTH_ALU7;
// Layers minimal width.
ALU2S[ALU1] = D::TRACK_SPACING_ALU1;
ALU2S[ALU2] = D::TRACK_SPACING_ALU2;
ALU2S[ALU3] = D::TRACK_SPACING_ALU3;
ALU2S[ALU4] = D::TRACK_SPACING_ALU4;
ALU2S[ALU5] = D::TRACK_SPACING_ALU5;
ALU2S[ALU6] = D::TRACK_SPACING_ALU6;
ALU2S[ALU7] = D::TRACK_SPACING_ALU7;
ALU2S[CALU1] = D::TRACK_SPACING_ALU1;
ALU2S[CALU2] = D::TRACK_SPACING_ALU2;
ALU2S[CALU3] = D::TRACK_SPACING_ALU3;
ALU2S[CALU4] = D::TRACK_SPACING_ALU4;
ALU2S[CALU5] = D::TRACK_SPACING_ALU5;
ALU2S[CALU6] = D::TRACK_SPACING_ALU6;
ALU2S[CALU7] = D::TRACK_SPACING_ALU7;
ALU2S[TALU1] = D::TRACK_SPACING_ALU1;
ALU2S[TALU2] = D::TRACK_SPACING_ALU2;
ALU2S[TALU3] = D::TRACK_SPACING_ALU3;
ALU2S[TALU4] = D::TRACK_SPACING_ALU4;
ALU2S[TALU5] = D::TRACK_SPACING_ALU5;
ALU2S[TALU6] = D::TRACK_SPACING_ALU6;
ALU2S[TALU7] = D::TRACK_SPACING_ALU7;
// Layer to Z translation table.
ALU2Z[ALU1] = 0;
ALU2Z[ALU2] = 1;
@ -277,6 +314,26 @@ long CEnv::layer2width (char layer) throw (except_done)
// -------------------------------------------------------------------
// Method : "CEnv::layer2spacing()".
long CEnv::layer2spacing (char layer) throw (except_done)
{
MLayer::iterator itLayer;
if ((itLayer = ALU2S.find (layer)) == ALU2S.end ()) {
cerr << herr ("CEnv::layer2spacing ():\n");
cerr << " Layer id " << (int)layer << " is not supported.\n";
throw except_done ();
}
return (itLayer->second);
}
// -------------------------------------------------------------------
// Method : "CEnv::layer2z()".
@ -860,6 +917,8 @@ void CFig::addphcon (phcon_list &con)
extern char *layer2a(char layer)
{
switch (layer) {
case NDIF: return ("NDIF");
case PDIF: return ("PDIF");
case ALU1: return ("ALU1");
case ALU2: return ("ALU2");
case ALU3: return ("ALU3");

View File

@ -1,7 +1,7 @@
// -*- C++ -*-
//
// $Id: MMBK.h,v 1.4 2005/10/10 15:34:05 jpc Exp $
// $Id: MMBK.h,v 1.5 2005/10/13 12:44:39 jpc Exp $
//
// /-----------------------------------------------------------------\
// | |
@ -141,6 +141,7 @@ namespace MBK {
long grid_dx;
long grid_dy;
MLayer ALU2W;
MLayer ALU2S;
MLayer ALU2Z;
regex_t pxLibRegex;
@ -148,12 +149,13 @@ namespace MBK {
CEnv (void);
// Accessors.
long layer2width (char layer) throw (except_done);
long layer2z (char layer) throw (except_done);
char z2calu (int z) throw (except_done);
char z2alu (int z) throw (except_done);
char z2via (int z) throw (except_done);
long z2width (int z) { return (layer2width (z2alu(z))); }
long layer2spacing (char layer) throw (except_done);
long layer2width (char layer) throw (except_done);
long layer2z (char layer) throw (except_done);
char z2calu (int z) throw (except_done);
char z2alu (int z) throw (except_done);
char z2via (int z) throw (except_done);
long z2width (int z) { return (layer2width (z2alu(z))); }
// Friends.

View File

@ -1,7 +1,7 @@
// -*- C++ -*-
//
// $Id: MNet.cpp,v 1.9 2005/10/10 15:34:05 jpc Exp $
// $Id: MNet.cpp,v 1.10 2005/10/13 12:44:39 jpc Exp $
//
// /----------------------------------------------------------------\
// | |
@ -254,9 +254,12 @@ void CTerm::lockalone (bool global)
if (nodes.size() != 1) return;
coord = nodes.back ();
coord2 = coord;
CDRGrid* drgrid = coord._drgrid;
if ( (coord.z() > 0) && !global ) return;
if ( coord.onAB()) return;
@ -293,6 +296,7 @@ void CTerm::lockalone (bool global)
}
if ( drgrid->Z < 3 ) return;
// Global terminal : when zupper=4, find the nearest VIA on the
// double pitch grid.
@ -333,6 +337,8 @@ void CTerm::lockalone (bool global)
}
}
if ( drgrid->Z < 4 ) return;
if (coord.z() < 4) {
// Go to z=3 (ALU3).
//cerr << "+ locking z=3 " << coord2 << endl;
@ -449,8 +455,9 @@ bool CNet::global (bool rglobal)
void CNet::newaccess (string termName, int x, int y, int z)
{
CRect rect;
if ( z >= _drgrid->Z ) return;
CRect rect;
rect.x1 = rect.x2 = x;
rect.y1 = rect.y2 = y;
@ -466,6 +473,8 @@ void CNet::newaccess (string termName, int x, int y, int z)
void CNet::newaccess (string termName, CRect &rect, int z)
{
if ( z >= _drgrid->Z ) return;
CCoord coord;
int id, mergeid;

View File

@ -1,7 +1,7 @@
// -*- C++ -*-
//
// $Id: RMBK.cpp,v 1.11 2005/10/10 15:55:45 jpc Exp $
// $Id: RMBK.cpp,v 1.12 2005/10/13 12:44:40 jpc Exp $
//
// /----------------------------------------------------------------\
// | |
@ -356,8 +356,10 @@ void CRBox::mbkload (MBK::CFig *mbkfig
// 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;
if ( (! MBK::ISVDD (pVIA->NAME)) && (! MBK::ISVSS (pVIA->NAME))) {
pNet = getnet (pVIA->NAME);
if ( pNet && !pNet->fixed ) continue;
}
for (x = 0; x < 2; x++) {
switch (x) {
@ -424,8 +426,9 @@ void CRBox::mbkload (MBK::CFig *mbkfig
cdebug << "+ - Signal \"" << sig_name << "\".\n";
// Do not process power nets.
if ( (MBK::ISVDD ((char*)sig_name.c_str ()) != 0)
|| (MBK::ISVSS ((char*)sig_name.c_str ()) != 0)) continue;
// Temporary disabled.
//if ( (MBK::ISVDD ((char*)sig_name.c_str ()) != 0)
// || (MBK::ISVSS ((char*)sig_name.c_str ()) != 0)) continue;
// In the case of external terminals, override the signal name by
// the terminal name.
@ -466,6 +469,20 @@ void CRBox::mbkload (MBK::CFig *mbkfig
pIns->flatseg (flatSeg, *pSeg);
rect->setSeg (flatSeg);
if ( MBK::IsPxLib(pModel) &&
( (pLocon->NAME == MBK::namealloc("pad" )) ||
(pLocon->NAME == MBK::namealloc("vddi")) ||
(pLocon->NAME == MBK::namealloc("vssi")) ||
(pLocon->NAME == MBK::namealloc("vdde")) ||
(pLocon->NAME == MBK::namealloc("vsse")) ) ) {
flatSeg.NAME = (char*)sig_name.c_str();
fig->addphseg (flatSeg,true,false);
continue;
}
if ( (MBK::ISVDD ((char*)sig_name.c_str ()) != 0)
|| (MBK::ISVSS ((char*)sig_name.c_str ()) != 0)) continue;
if (rect->isInGrid()) {
if ( pNet->fixed ) {
drgrid->nodes->obstacle (rect->grid, MBK::env.layer2z (pSeg->LAYER));
@ -476,15 +493,20 @@ void CRBox::mbkload (MBK::CFig *mbkfig
);
}
} else {
cerr << hwarn ("")
<< " The connector segment \"" << pSeg->NAME << "\" at ("
<< MBK::UNSCALE (pSeg->X1) << ","
<< MBK::UNSCALE (pSeg->Y1) << ") ("
<< MBK::UNSCALE (pSeg->X2) << ","
<< MBK::UNSCALE (pSeg->Y2) << ") layer "
<< MBK::layer2a (pSeg->LAYER) << "\n"
<< " is outside of the grid : ignored.";
}
//if ( MBK::IsPxLib(pModel) ) {
// flatSeg.NAME = (char*)sig_name.c_str();
// fig->addphseg (flatSeg,true,false);
//} else {
cerr << hwarn ("")
<< " The connector segment \"" << pSeg->NAME << "\" at ("
<< MBK::UNSCALE (pSeg->X1) << ","
<< MBK::UNSCALE (pSeg->Y1) << ") ("
<< MBK::UNSCALE (pSeg->X2) << ","
<< MBK::UNSCALE (pSeg->Y2) << ") layer "
<< MBK::layer2a (pSeg->LAYER) << "\n"
<< " is outside of the grid : ignored.";
}
//}
}
} // End of "pChain" (terminal) loop.

View File

@ -1,7 +1,7 @@
// -*- C++ -*-
//
// $Id: UConst.cpp,v 1.2 2002/10/13 14:22:47 jpc Exp $
// $Id: UConst.cpp,v 1.3 2005/10/13 12:44:40 jpc Exp $
//
// /-----------------------------------------------------------------\
// | |
@ -52,18 +52,25 @@ namespace D {
// MBK Routing related constants.
const long _X_GRID = 5;
const long _Y_GRID = 5;
const long _Y_SLICE = 50;
const long _WIDTH_VSS = 6;
const long _WIDTH_VDD = 6;
const long _TRACK_WIDTH_ALU1 = 2;
const long _TRACK_WIDTH_ALU2 = 2;
const long _TRACK_WIDTH_ALU3 = 2;
const long _TRACK_WIDTH_ALU4 = 2;
const long _TRACK_WIDTH_ALU5 = 2;
const long _TRACK_WIDTH_ALU6 = 2;
const long _TRACK_WIDTH_ALU7 = 2;
const long _X_GRID = 5;
const long _Y_GRID = 5;
const long _Y_SLICE = 50;
const long _WIDTH_VSS = 6;
const long _WIDTH_VDD = 6;
const long _TRACK_WIDTH_ALU1 = 2;
const long _TRACK_WIDTH_ALU2 = 2;
const long _TRACK_WIDTH_ALU3 = 2;
const long _TRACK_WIDTH_ALU4 = 2;
const long _TRACK_WIDTH_ALU5 = 2;
const long _TRACK_WIDTH_ALU6 = 2;
const long _TRACK_WIDTH_ALU7 = 2;
const long _TRACK_SPACING_ALU1 = 3;
const long _TRACK_SPACING_ALU2 = 3;
const long _TRACK_SPACING_ALU3 = 3;
const long _TRACK_SPACING_ALU4 = 3;
const long _TRACK_SPACING_ALU5 = 8;
const long _TRACK_SPACING_ALU6 = 8;
const long _TRACK_SPACING_ALU7 = 8;
long X_GRID;
long Y_GRID;
@ -77,6 +84,13 @@ namespace D {
long TRACK_WIDTH_ALU5;
long TRACK_WIDTH_ALU6;
long TRACK_WIDTH_ALU7;
long TRACK_SPACING_ALU1;
long TRACK_SPACING_ALU2;
long TRACK_SPACING_ALU3;
long TRACK_SPACING_ALU4;
long TRACK_SPACING_ALU5;
long TRACK_SPACING_ALU6;
long TRACK_SPACING_ALU7;

View File

@ -1,7 +1,7 @@
// -*- C++ -*-
//
// $Id: UDefs.h,v 1.2 2002/10/13 14:22:47 jpc Exp $
// $Id: UDefs.h,v 1.3 2005/10/13 12:44:40 jpc Exp $
//
// /-----------------------------------------------------------------\
// | |
@ -89,6 +89,13 @@ namespace D {
extern const long _TRACK_WIDTH_ALU5;
extern const long _TRACK_WIDTH_ALU6;
extern const long _TRACK_WIDTH_ALU7;
extern const long _TRACK_SPACING_ALU1;
extern const long _TRACK_SPACING_ALU2;
extern const long _TRACK_SPACING_ALU3;
extern const long _TRACK_SPACING_ALU4;
extern const long _TRACK_SPACING_ALU5;
extern const long _TRACK_SPACING_ALU6;
extern const long _TRACK_SPACING_ALU7;
extern long X_GRID;
extern long Y_GRID;
@ -102,6 +109,13 @@ namespace D {
extern long TRACK_WIDTH_ALU5;
extern long TRACK_WIDTH_ALU6;
extern long TRACK_WIDTH_ALU7;
extern long TRACK_SPACING_ALU1;
extern long TRACK_SPACING_ALU2;
extern long TRACK_SPACING_ALU3;
extern long TRACK_SPACING_ALU4;
extern long TRACK_SPACING_ALU5;
extern long TRACK_SPACING_ALU6;
extern long TRACK_SPACING_ALU7;
}