Added the ability to track the first CellDef to fail to read and
report it after "Failure to read in entire sub-tree". This will not report every failing cell (since it quits reading after the first failure) but will avoid the existing issue of printing nothing and leaving the user with no feedback as to which cell was the problem.
This commit is contained in:
parent
41e65b5214
commit
0ae54b500a
|
|
@ -302,6 +302,7 @@ CalmaWrite(rootDef, f)
|
|||
{
|
||||
int oldCount = DBWFeedbackCount, problems, nerr;
|
||||
bool good;
|
||||
CellDef *err_def;
|
||||
CellUse dummy;
|
||||
HashEntry *he;
|
||||
HashSearch hs;
|
||||
|
|
@ -327,9 +328,11 @@ CalmaWrite(rootDef, f)
|
|||
*/
|
||||
|
||||
dummy.cu_def = rootDef;
|
||||
if (DBCellReadArea(&dummy, &rootDef->cd_bbox, !CalmaAllowUndefined))
|
||||
err_def = DBCellReadArea(&dummy, &rootDef->cd_bbox, !CalmaAllowUndefined);
|
||||
if (err_def != NULL)
|
||||
{
|
||||
TxError("Failure to read entire subtree of the cell.\n");
|
||||
TxError("Failed on cell %s.\n", err_def->cd_name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -277,6 +277,7 @@ CalmaWriteZ(rootDef, f)
|
|||
{
|
||||
int oldCount = DBWFeedbackCount, problems, nerr;
|
||||
bool good;
|
||||
CellDef *err_def;
|
||||
CellUse dummy;
|
||||
HashEntry *he;
|
||||
HashSearch hs;
|
||||
|
|
@ -302,9 +303,11 @@ CalmaWriteZ(rootDef, f)
|
|||
*/
|
||||
|
||||
dummy.cu_def = rootDef;
|
||||
if (DBCellReadArea(&dummy, &rootDef->cd_bbox, !CalmaAllowUndefined))
|
||||
err_def = DBCellReadArea(&dummy, &rootDef->cd_bbox, !CalmaAllowUndefined);
|
||||
if (err_def != NULL)
|
||||
{
|
||||
TxError("Failure to read entire subtree of the cell.\n");
|
||||
TxError("Failed on cell %s.\n", err_def->cd_name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ CIFWrite(rootDef, f)
|
|||
{
|
||||
bool good;
|
||||
int oldCount = DBWFeedbackCount;
|
||||
CellDef *err_def;
|
||||
CellUse dummy;
|
||||
|
||||
/*
|
||||
|
|
@ -133,9 +134,11 @@ CIFWrite(rootDef, f)
|
|||
*/
|
||||
|
||||
dummy.cu_def = rootDef;
|
||||
if (DBCellReadArea(&dummy, &rootDef->cd_bbox, TRUE))
|
||||
err_def = DBCellReadArea(&dummy, &rootDef->cd_bbox, TRUE);
|
||||
if (err_def != NULL)
|
||||
{
|
||||
TxError("Failure to read in entire subtree of the cell.\n");
|
||||
TxError("Failed on cell %s.\n", err_def->cd_name);
|
||||
return (FALSE);
|
||||
}
|
||||
DBFixMismatch();
|
||||
|
|
|
|||
|
|
@ -274,8 +274,8 @@ dbUnexpandFunc(scx, arg)
|
|||
* the given rectangle.
|
||||
*
|
||||
* Results:
|
||||
* If "halt_on_error" is TRUE, then return 1 if any subcell could not
|
||||
* be read. Otherwise, return 0.
|
||||
* If "halt_on_error" is TRUE, then return a pointer to the first
|
||||
* subcell that could not be read. Otherwise, return NULL.
|
||||
*
|
||||
* Side effects:
|
||||
* May make new cells known to the database. Sets the CDAVAILABLE
|
||||
|
|
@ -284,7 +284,7 @@ dbUnexpandFunc(scx, arg)
|
|||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
CellDef *
|
||||
DBCellReadArea(rootUse, rootRect, halt_on_error)
|
||||
CellUse *rootUse; /* Root cell use from which search begins */
|
||||
Rect *rootRect; /* Area to be read, in root coordinates */
|
||||
|
|
@ -292,32 +292,37 @@ DBCellReadArea(rootUse, rootRect, halt_on_error)
|
|||
{
|
||||
int dbReadAreaFunc();
|
||||
SearchContext scontext;
|
||||
CellDef *err_def = NULL;
|
||||
|
||||
scontext.scx_use = rootUse;
|
||||
scontext.scx_trans = GeoIdentityTransform;
|
||||
scontext.scx_area = *rootRect;
|
||||
if (dbReadAreaFunc(&scontext, halt_on_error) == 1)
|
||||
return 1;
|
||||
if (dbReadAreaFunc(&scontext, ((halt_on_error == TRUE) ? &err_def : NULL)) == 1)
|
||||
return err_def;
|
||||
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
dbReadAreaFunc(scx, halt_on_error)
|
||||
dbReadAreaFunc(scx, err_ptr)
|
||||
SearchContext *scx; /* Pointer to context specifying
|
||||
* the cell use to be read in, and
|
||||
* an area to be recursively read in
|
||||
* coordinates of the cell use's def.
|
||||
*/
|
||||
bool halt_on_error; /* If TRUE, failure to find a cell causes a halt */
|
||||
CellDef **err_ptr; /* If non-NULL, failure to find a cell causes a halt
|
||||
* and the CellDef in error is returned in err_def.
|
||||
*/
|
||||
{
|
||||
CellDef *def = scx->scx_use->cu_def;
|
||||
|
||||
if ((def->cd_flags & CDAVAILABLE) == 0)
|
||||
{
|
||||
if (DBCellRead(def, TRUE, TRUE, NULL) == FALSE)
|
||||
if (halt_on_error)
|
||||
return 1;
|
||||
{
|
||||
*err_ptr = def;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Note: we don't have to invoke DBReComputeBbox here because
|
||||
* if the bbox changed then there was a timestamp mismatch and
|
||||
|
|
@ -325,9 +330,8 @@ dbReadAreaFunc(scx, halt_on_error)
|
|||
*/
|
||||
}
|
||||
|
||||
if (DBCellSrArea(scx, dbReadAreaFunc, (ClientData)halt_on_error))
|
||||
if (halt_on_error)
|
||||
return 1;
|
||||
if (DBCellSrArea(scx, dbReadAreaFunc, (ClientData)err_ptr))
|
||||
return 1;
|
||||
|
||||
/* Be clever about handling arrays: if the search area covers this
|
||||
* whole definition, then there's no need to look at any other
|
||||
|
|
|
|||
|
|
@ -784,7 +784,7 @@ extern bool DBCellRead();
|
|||
extern bool DBTestOpen();
|
||||
extern char *DBGetTech();
|
||||
extern bool DBCellWrite();
|
||||
extern int DBCellReadArea();
|
||||
extern CellDef *DBCellReadArea();
|
||||
extern void DBFileRecovery();
|
||||
extern bool DBWriteBackup();
|
||||
extern bool DBReadBackup();
|
||||
|
|
|
|||
|
|
@ -692,11 +692,14 @@ DRCCheck(use, area)
|
|||
*/
|
||||
{
|
||||
SearchContext scx;
|
||||
CellDef *err_def;
|
||||
extern int drcCheckFunc(); /* Forward reference. */
|
||||
|
||||
if (DBCellReadArea(use, area, TRUE))
|
||||
err_def = DBCellReadArea(use, area, TRUE);
|
||||
if (err_def != NULL)
|
||||
{
|
||||
TxError("Failure to read in entire subtree of cell.\n");
|
||||
TxError("Failed on cell %s.\n", err_def->cd_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -361,11 +361,14 @@ ExtAll(rootUse)
|
|||
CellUse *rootUse;
|
||||
{
|
||||
LinkedDef *defList = NULL;
|
||||
CellDef *err_def;
|
||||
|
||||
/* Make sure the entire subtree is read in */
|
||||
if (DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE))
|
||||
err_def = DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE);
|
||||
if (err_def != NULL)
|
||||
{
|
||||
TxError("Failure to read entire subtree of cell.\n");
|
||||
TxError("Failed on cell %s.\n", err_def->cd_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -460,15 +463,17 @@ ExtUnique(rootUse, option)
|
|||
CellUse *rootUse;
|
||||
int option;
|
||||
{
|
||||
CellDef *def;
|
||||
CellDef *def, *err_def;
|
||||
LinkedDef *defList = NULL;
|
||||
int nwarn;
|
||||
int locoption;
|
||||
|
||||
/* Make sure the entire subtree is read in */
|
||||
if (DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE))
|
||||
err_def = DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE);
|
||||
if (err_def != NULL)
|
||||
{
|
||||
TxError("Failure to read entire subtree of cell.\n");
|
||||
TxError("Failed on cell %s.\n", err_def->cd_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -857,11 +862,14 @@ ExtIncremental(rootUse)
|
|||
CellUse *rootUse;
|
||||
{
|
||||
LinkedDef *defList = NULL;
|
||||
CellDef *err_def;
|
||||
|
||||
/* Make sure the entire subtree is read in */
|
||||
if (DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE))
|
||||
err_def = DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE);
|
||||
if (err_def != NULL)
|
||||
{
|
||||
TxError("Failure to read entire subtree of cell.\n");
|
||||
TxError("Failed on cell %s.\n", err_def->cd_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -167,11 +167,14 @@ ExtTimes(rootUse, f)
|
|||
double clip, inter;
|
||||
HashSearch hs;
|
||||
HashEntry *he;
|
||||
CellDef *err_def;
|
||||
|
||||
/* Make sure this cell is read in */
|
||||
if (DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE))
|
||||
err_def = DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE);
|
||||
if (err_def != NULL)
|
||||
{
|
||||
TxError("Failure to read entire subtree of cell.\n");
|
||||
TxError("Failed on cell %s.\n", err_def->cd_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1022,11 +1025,14 @@ ExtInterCount(rootUse, halo, f)
|
|||
FILE *f;
|
||||
{
|
||||
double inter;
|
||||
CellDef *err_def;
|
||||
|
||||
/* Make sure this cell is read in */
|
||||
if (DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE))
|
||||
err_def = DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE);
|
||||
if (err_def != NULL)
|
||||
{
|
||||
TxError("Failure to read entire subtree of cell.\n");
|
||||
TxError("Failed on cell %s.\n", err_def->cd_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2178,7 +2178,7 @@ LefWriteAll(rootUse, writeTopCell, lefTech, lefHide, lefPinOnly, lefTopLayer,
|
|||
bool recurse;
|
||||
{
|
||||
HashTable propHashTbl, siteHashTbl;
|
||||
CellDef *def, *rootdef;
|
||||
CellDef *def, *rootdef, *err_def;
|
||||
FILE *f;
|
||||
char *filename;
|
||||
float scale = CIFGetOutputScale(1000); /* conversion to microns */
|
||||
|
|
@ -2186,9 +2186,11 @@ LefWriteAll(rootUse, writeTopCell, lefTech, lefHide, lefPinOnly, lefTopLayer,
|
|||
rootdef = rootUse->cu_def;
|
||||
|
||||
/* Make sure the entire subtree is read in */
|
||||
if (DBCellReadArea(rootUse, &rootdef->cd_bbox, TRUE))
|
||||
err_def = DBCellReadArea(rootUse, &rootdef->cd_bbox, TRUE);
|
||||
if (err_def != NULL)
|
||||
{
|
||||
TxError("Could not read entire subtree of the cell.\n");
|
||||
TxError("Failed on cell %s.\n", err_def->cd_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue