Corrected the connectivity search function so that it does not attempt
to copy and search on a label that already exists in the flattened, copied database. Otherwise multiple labels on a single net can cause the search to go into an infinite loop, repeatedly copying and erasing the same label over and over again.
This commit is contained in:
parent
06eef6e324
commit
f2dc4b37f0
|
|
@ -679,6 +679,11 @@ dbcConnectLabelFunc(scx, lab, tpath, csa2)
|
||||||
|
|
||||||
if (scx->scx_use == csa2->csa2_topscx->scx_use)
|
if (scx->scx_use == csa2->csa2_topscx->scx_use)
|
||||||
{
|
{
|
||||||
|
/* Do not repeat a label copy; check that the label doesn't */
|
||||||
|
/* already exist in the destination def first. */
|
||||||
|
if (DBCheckLabelsByContent(def, &r, lab->lab_type, lab->lab_text))
|
||||||
|
return 0;
|
||||||
|
|
||||||
DBEraseLabelsByContent(def, &r, -1, lab->lab_text);
|
DBEraseLabelsByContent(def, &r, -1, lab->lab_text);
|
||||||
DBPutFontLabel(def, &r, lab->lab_font, lab->lab_size, rotate, &offset,
|
DBPutFontLabel(def, &r, lab->lab_font, lab->lab_size, rotate, &offset,
|
||||||
pos, lab->lab_text, lab->lab_type, lab->lab_flags);
|
pos, lab->lab_text, lab->lab_type, lab->lab_flags);
|
||||||
|
|
|
||||||
|
|
@ -313,7 +313,55 @@ DBEraseLabel(cellDef, area, mask, areaReturn)
|
||||||
cellDef->cd_flags |= CDMODIFIED|CDGETNEWSTAMP;
|
cellDef->cd_flags |= CDMODIFIED|CDGETNEWSTAMP;
|
||||||
return (erasedAny);
|
return (erasedAny);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define RECTEQUAL(r1, r2) ((r1)->r_xbot == (r2)->r_xbot \
|
||||||
|
&& (r1)->r_ybot == (r2)->r_ybot \
|
||||||
|
&& (r1)->r_xtop == (r2)->r_xtop \
|
||||||
|
&& (r1)->r_ytop == (r2)->r_ytop)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ----------------------------------------------------------------------------
|
||||||
|
*
|
||||||
|
* DBCheckLabelsByContent --
|
||||||
|
*
|
||||||
|
* Return any label found on the label list for the given
|
||||||
|
* CellDef that matches the given specification.
|
||||||
|
*
|
||||||
|
* Results:
|
||||||
|
* Returns a label if a match is found, otherwise returns NULL.
|
||||||
|
*
|
||||||
|
* Side effects:
|
||||||
|
* None.
|
||||||
|
*
|
||||||
|
* ----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
Label *
|
||||||
|
DBCheckLabelsByContent(def, rect, type, text)
|
||||||
|
CellDef *def; /* Where to look for label to delete. */
|
||||||
|
Rect *rect; /* Coordinates of label. If NULL, then
|
||||||
|
* labels are searched regardless of coords.
|
||||||
|
*/
|
||||||
|
TileType type; /* Layer label is attached to. If < 0, then
|
||||||
|
* labels are searched regardless of type.
|
||||||
|
*/
|
||||||
|
char *text; /* Text associated with label. If NULL, then
|
||||||
|
* labels are searched regardless of text.
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
Label *lab;
|
||||||
|
|
||||||
|
for (lab = def->cd_labels; lab; lab = lab->lab_next)
|
||||||
|
{
|
||||||
|
if ((rect != NULL) && !(RECTEQUAL(&lab->lab_rect, rect))) continue;
|
||||||
|
if ((type >= 0) && (type != lab->lab_type)) continue;
|
||||||
|
if ((text != NULL) && (strcmp(text, lab->lab_text) != 0)) continue;
|
||||||
|
|
||||||
|
return lab;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ----------------------------------------------------------------------------
|
* ----------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
|
|
@ -348,11 +396,6 @@ DBEraseLabelsByContent(def, rect, type, text)
|
||||||
{
|
{
|
||||||
Label *lab, *labPrev;
|
Label *lab, *labPrev;
|
||||||
|
|
||||||
#define RECTEQUAL(r1, r2) ((r1)->r_xbot == (r2)->r_xbot \
|
|
||||||
&& (r1)->r_ybot == (r2)->r_ybot \
|
|
||||||
&& (r1)->r_xtop == (r2)->r_xtop \
|
|
||||||
&& (r1)->r_ytop == (r2)->r_ytop)
|
|
||||||
|
|
||||||
for (labPrev = NULL, lab = def->cd_labels;
|
for (labPrev = NULL, lab = def->cd_labels;
|
||||||
lab != NULL;
|
lab != NULL;
|
||||||
labPrev = lab, lab = lab->lab_next)
|
labPrev = lab, lab = lab->lab_next)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue