Skip to content

Commit 0ae54b5

Browse files
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.
1 parent 41e65b5 commit 0ae54b5

File tree

10 files changed

+59
-27
lines changed

10 files changed

+59
-27
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.3.474
1+
8.3.475

calma/CalmaWrite.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ CalmaWrite(rootDef, f)
302302
{
303303
int oldCount = DBWFeedbackCount, problems, nerr;
304304
bool good;
305+
CellDef *err_def;
305306
CellUse dummy;
306307
HashEntry *he;
307308
HashSearch hs;
@@ -327,9 +328,11 @@ CalmaWrite(rootDef, f)
327328
*/
328329

329330
dummy.cu_def = rootDef;
330-
if (DBCellReadArea(&dummy, &rootDef->cd_bbox, !CalmaAllowUndefined))
331+
err_def = DBCellReadArea(&dummy, &rootDef->cd_bbox, !CalmaAllowUndefined);
332+
if (err_def != NULL)
331333
{
332334
TxError("Failure to read entire subtree of the cell.\n");
335+
TxError("Failed on cell %s.\n", err_def->cd_name);
333336
return FALSE;
334337
}
335338

calma/CalmaWriteZ.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ CalmaWriteZ(rootDef, f)
277277
{
278278
int oldCount = DBWFeedbackCount, problems, nerr;
279279
bool good;
280+
CellDef *err_def;
280281
CellUse dummy;
281282
HashEntry *he;
282283
HashSearch hs;
@@ -302,9 +303,11 @@ CalmaWriteZ(rootDef, f)
302303
*/
303304

304305
dummy.cu_def = rootDef;
305-
if (DBCellReadArea(&dummy, &rootDef->cd_bbox, !CalmaAllowUndefined))
306+
err_def = DBCellReadArea(&dummy, &rootDef->cd_bbox, !CalmaAllowUndefined);
307+
if (err_def != NULL)
306308
{
307309
TxError("Failure to read entire subtree of the cell.\n");
310+
TxError("Failed on cell %s.\n", err_def->cd_name);
308311
return FALSE;
309312
}
310313

cif/CIFwrite.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ CIFWrite(rootDef, f)
124124
{
125125
bool good;
126126
int oldCount = DBWFeedbackCount;
127+
CellDef *err_def;
127128
CellUse dummy;
128129

129130
/*
@@ -133,9 +134,11 @@ CIFWrite(rootDef, f)
133134
*/
134135

135136
dummy.cu_def = rootDef;
136-
if (DBCellReadArea(&dummy, &rootDef->cd_bbox, TRUE))
137+
err_def = DBCellReadArea(&dummy, &rootDef->cd_bbox, TRUE);
138+
if (err_def != NULL)
137139
{
138140
TxError("Failure to read in entire subtree of the cell.\n");
141+
TxError("Failed on cell %s.\n", err_def->cd_name);
139142
return (FALSE);
140143
}
141144
DBFixMismatch();

database/DBexpand.c

+17-13
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ dbUnexpandFunc(scx, arg)
274274
* the given rectangle.
275275
*
276276
* Results:
277-
* If "halt_on_error" is TRUE, then return 1 if any subcell could not
278-
* be read. Otherwise, return 0.
277+
* If "halt_on_error" is TRUE, then return a pointer to the first
278+
* subcell that could not be read. Otherwise, return NULL.
279279
*
280280
* Side effects:
281281
* May make new cells known to the database. Sets the CDAVAILABLE
@@ -284,50 +284,54 @@ dbUnexpandFunc(scx, arg)
284284
* ----------------------------------------------------------------------------
285285
*/
286286

287-
int
287+
CellDef *
288288
DBCellReadArea(rootUse, rootRect, halt_on_error)
289289
CellUse *rootUse; /* Root cell use from which search begins */
290290
Rect *rootRect; /* Area to be read, in root coordinates */
291291
bool halt_on_error; /* If TRUE, failure to find a cell causes a halt */
292292
{
293293
int dbReadAreaFunc();
294294
SearchContext scontext;
295+
CellDef *err_def = NULL;
295296

296297
scontext.scx_use = rootUse;
297298
scontext.scx_trans = GeoIdentityTransform;
298299
scontext.scx_area = *rootRect;
299-
if (dbReadAreaFunc(&scontext, halt_on_error) == 1)
300-
return 1;
300+
if (dbReadAreaFunc(&scontext, ((halt_on_error == TRUE) ? &err_def : NULL)) == 1)
301+
return err_def;
301302

302-
return 0;
303+
return NULL;
303304
}
304305

305306
int
306-
dbReadAreaFunc(scx, halt_on_error)
307+
dbReadAreaFunc(scx, err_ptr)
307308
SearchContext *scx; /* Pointer to context specifying
308309
* the cell use to be read in, and
309310
* an area to be recursively read in
310311
* coordinates of the cell use's def.
311312
*/
312-
bool halt_on_error; /* If TRUE, failure to find a cell causes a halt */
313+
CellDef **err_ptr; /* If non-NULL, failure to find a cell causes a halt
314+
* and the CellDef in error is returned in err_def.
315+
*/
313316
{
314317
CellDef *def = scx->scx_use->cu_def;
315318

316319
if ((def->cd_flags & CDAVAILABLE) == 0)
317320
{
318321
if (DBCellRead(def, TRUE, TRUE, NULL) == FALSE)
319-
if (halt_on_error)
320-
return 1;
322+
{
323+
*err_ptr = def;
324+
return 1;
325+
}
321326

322327
/* Note: we don't have to invoke DBReComputeBbox here because
323328
* if the bbox changed then there was a timestamp mismatch and
324329
* the timestamp code will take care of the bounding box later.
325330
*/
326331
}
327332

328-
if (DBCellSrArea(scx, dbReadAreaFunc, (ClientData)halt_on_error))
329-
if (halt_on_error)
330-
return 1;
333+
if (DBCellSrArea(scx, dbReadAreaFunc, (ClientData)err_ptr))
334+
return 1;
331335

332336
/* Be clever about handling arrays: if the search area covers this
333337
* whole definition, then there's no need to look at any other

database/database.h.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ extern bool DBCellRead();
784784
extern bool DBTestOpen();
785785
extern char *DBGetTech();
786786
extern bool DBCellWrite();
787-
extern int DBCellReadArea();
787+
extern CellDef *DBCellReadArea();
788788
extern void DBFileRecovery();
789789
extern bool DBWriteBackup();
790790
extern bool DBReadBackup();

drc/DRCmain.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -692,11 +692,14 @@ DRCCheck(use, area)
692692
*/
693693
{
694694
SearchContext scx;
695+
CellDef *err_def;
695696
extern int drcCheckFunc(); /* Forward reference. */
696697

697-
if (DBCellReadArea(use, area, TRUE))
698+
err_def = DBCellReadArea(use, area, TRUE);
699+
if (err_def != NULL)
698700
{
699701
TxError("Failure to read in entire subtree of cell.\n");
702+
TxError("Failed on cell %s.\n", err_def->cd_name);
700703
return;
701704
}
702705

extract/ExtMain.c

+12-4
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,14 @@ ExtAll(rootUse)
361361
CellUse *rootUse;
362362
{
363363
LinkedDef *defList = NULL;
364+
CellDef *err_def;
364365

365366
/* Make sure the entire subtree is read in */
366-
if (DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE))
367+
err_def = DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE);
368+
if (err_def != NULL)
367369
{
368370
TxError("Failure to read entire subtree of cell.\n");
371+
TxError("Failed on cell %s.\n", err_def->cd_name);
369372
return;
370373
}
371374

@@ -460,15 +463,17 @@ ExtUnique(rootUse, option)
460463
CellUse *rootUse;
461464
int option;
462465
{
463-
CellDef *def;
466+
CellDef *def, *err_def;
464467
LinkedDef *defList = NULL;
465468
int nwarn;
466469
int locoption;
467470

468471
/* Make sure the entire subtree is read in */
469-
if (DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE))
472+
err_def = DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE);
473+
if (err_def != NULL)
470474
{
471475
TxError("Failure to read entire subtree of cell.\n");
476+
TxError("Failed on cell %s.\n", err_def->cd_name);
472477
return;
473478
}
474479

@@ -857,11 +862,14 @@ ExtIncremental(rootUse)
857862
CellUse *rootUse;
858863
{
859864
LinkedDef *defList = NULL;
865+
CellDef *err_def;
860866

861867
/* Make sure the entire subtree is read in */
862-
if (DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE))
868+
err_def = DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE);
869+
if (err_def != NULL)
863870
{
864871
TxError("Failure to read entire subtree of cell.\n");
872+
TxError("Failed on cell %s.\n", err_def->cd_name);
865873
return;
866874
}
867875

extract/ExtTimes.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,14 @@ ExtTimes(rootUse, f)
167167
double clip, inter;
168168
HashSearch hs;
169169
HashEntry *he;
170+
CellDef *err_def;
170171

171172
/* Make sure this cell is read in */
172-
if (DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE))
173+
err_def = DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE);
174+
if (err_def != NULL)
173175
{
174176
TxError("Failure to read entire subtree of cell.\n");
177+
TxError("Failed on cell %s.\n", err_def->cd_name);
175178
return;
176179
}
177180

@@ -1022,11 +1025,14 @@ ExtInterCount(rootUse, halo, f)
10221025
FILE *f;
10231026
{
10241027
double inter;
1028+
CellDef *err_def;
10251029

10261030
/* Make sure this cell is read in */
1027-
if (DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE))
1031+
err_def = DBCellReadArea(rootUse, &rootUse->cu_def->cd_bbox, TRUE);
1032+
if (err_def != NULL)
10281033
{
10291034
TxError("Failure to read entire subtree of cell.\n");
1035+
TxError("Failed on cell %s.\n", err_def->cd_name);
10301036
return;
10311037
}
10321038

lef/lefWrite.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -2178,17 +2178,19 @@ LefWriteAll(rootUse, writeTopCell, lefTech, lefHide, lefPinOnly, lefTopLayer,
21782178
bool recurse;
21792179
{
21802180
HashTable propHashTbl, siteHashTbl;
2181-
CellDef *def, *rootdef;
2181+
CellDef *def, *rootdef, *err_def;
21822182
FILE *f;
21832183
char *filename;
21842184
float scale = CIFGetOutputScale(1000); /* conversion to microns */
21852185

21862186
rootdef = rootUse->cu_def;
21872187

21882188
/* Make sure the entire subtree is read in */
2189-
if (DBCellReadArea(rootUse, &rootdef->cd_bbox, TRUE))
2189+
err_def = DBCellReadArea(rootUse, &rootdef->cd_bbox, TRUE);
2190+
if (err_def != NULL)
21902191
{
21912192
TxError("Could not read entire subtree of the cell.\n");
2193+
TxError("Failed on cell %s.\n", err_def->cd_name);
21922194
return;
21932195
}
21942196

0 commit comments

Comments
 (0)