Restored the behavior of selecting and displaying labels that are
down in the hierarchy when selecting a region or net, but with a (hopefully very useful) twist: To avoid the problem of ambiguous labels in subcells, the subcell name hierarchy is generated in the same way as is done when flattening a cell, with the instance name prepended. For example, when selecting a net in a standard cell design, a terminal would highlight the name "OR2X1_1/B" instead of just "B".
This commit is contained in:
parent
f2dc4b37f0
commit
897a8064ba
|
|
@ -1792,6 +1792,7 @@ FlatCopyAllLabels(scx, mask, xMask, targetUse)
|
|||
char pathstring[FLATTERMSIZE];
|
||||
TerminalPath tpath;
|
||||
|
||||
pathstring[0] = '\0';
|
||||
tpath.tp_first = tpath.tp_next = pathstring;
|
||||
tpath.tp_last = pathstring + FLATTERMSIZE;
|
||||
|
||||
|
|
|
|||
|
|
@ -656,6 +656,9 @@ dbcUnconnectFunc(tile, clientData)
|
|||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* To do: Make the tpath entries dynamically allocated */
|
||||
#define FLATTERMSIZE 1024
|
||||
|
||||
int
|
||||
dbcConnectLabelFunc(scx, lab, tpath, csa2)
|
||||
SearchContext *scx;
|
||||
|
|
@ -667,6 +670,8 @@ dbcConnectLabelFunc(scx, lab, tpath, csa2)
|
|||
Rect r;
|
||||
Point offset;
|
||||
int pos, rotate;
|
||||
char newlabtext[FLATTERMSIZE];
|
||||
char *newlabptr;
|
||||
int dbcConnectFunc(); /* Forward declaration */
|
||||
|
||||
GeoTransRect(&scx->scx_trans, &lab->lab_rect, &r);
|
||||
|
|
@ -677,17 +682,29 @@ dbcConnectLabelFunc(scx, lab, tpath, csa2)
|
|||
/* Only add labels if they are on the search top level */
|
||||
/* (NOTE: Could add hierachical labels using tpath) */
|
||||
|
||||
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);
|
||||
DBPutFontLabel(def, &r, lab->lab_font, lab->lab_size, rotate, &offset,
|
||||
pos, lab->lab_text, lab->lab_type, lab->lab_flags);
|
||||
int newllen = tpath->tp_next - tpath->tp_first;
|
||||
newlabtext[0] = '\0';
|
||||
if (newllen > 0)
|
||||
strncpy(newlabtext, tpath->tp_first, newllen);
|
||||
sprintf(newlabtext + newllen, "%s", lab->lab_text);
|
||||
newlabptr = newlabtext;
|
||||
}
|
||||
else
|
||||
newlabptr = lab->lab_text;
|
||||
|
||||
/* 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;
|
||||
|
||||
if (DBCheckLabelsByContent(def, &r, lab->lab_type, newlabptr))
|
||||
return 0;
|
||||
|
||||
DBEraseLabelsByContent(def, &r, -1, lab->lab_text);
|
||||
DBPutFontLabel(def, &r, lab->lab_font, lab->lab_size, rotate, &offset,
|
||||
pos, newlabptr, lab->lab_type, lab->lab_flags);
|
||||
|
||||
if (lab->lab_flags & PORT_DIR_MASK)
|
||||
{
|
||||
|
|
@ -1024,6 +1041,13 @@ DBTreeCopyConnect(scx, mask, xMask, connect, area, destUse)
|
|||
DBTreeSrTiles(scx, mask, xMask, dbcConnectFunc, (ClientData) &csa2);
|
||||
while (csa2.csa2_top >= 0)
|
||||
{
|
||||
char pathstring[FLATTERMSIZE];
|
||||
TerminalPath tpath;
|
||||
|
||||
tpath.tp_first = tpath.tp_next = pathstring;
|
||||
tpath.tp_last = pathstring + FLATTERMSIZE;
|
||||
pathstring[0] = '\0';
|
||||
|
||||
newmask = csa2.csa2_list[csa2.csa2_top].connectMask;
|
||||
scx->scx_area = csa2.csa2_list[csa2.csa2_top].area;
|
||||
newtype = csa2.csa2_list[csa2.csa2_top].dinfo;
|
||||
|
|
@ -1064,7 +1088,7 @@ DBTreeCopyConnect(scx, mask, xMask, connect, area, destUse)
|
|||
searchtype |= TF_LABEL_ATTACH_NOT_SE;
|
||||
}
|
||||
}
|
||||
DBTreeSrLabels(scx, newmask, xMask, NULL, searchtype,
|
||||
DBTreeSrLabels(scx, newmask, xMask, &tpath, searchtype,
|
||||
dbcConnectLabelFunc, (ClientData) &csa2);
|
||||
}
|
||||
freeMagic((char *)csa2.csa2_list);
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@ args.o: args.c ../utils/magic.h ../utils/utils.h
|
|||
child.o: child.c ../utils/utils.h ../utils/magic.h ../utils/malloc.h
|
||||
dqueue.o: dqueue.c ../utils/magic.h ../utils/dqueue.h ../utils/malloc.h
|
||||
finddisp.o: finddisp.c ../utils/magic.h ../utils/utils.h
|
||||
flock.o: flock.c ../utils/magic.h ../utils/hash.h ../utils/geometry.h \
|
||||
../tiles/tile.h ../database/database.h ../windows/windows.h \
|
||||
../utils/malloc.h
|
||||
flock.o: flock.c
|
||||
flsbuf.o: flsbuf.c
|
||||
fraction.o: fraction.c ../utils/magic.h ../utils/geometry.h
|
||||
geometry.o: geometry.c ../utils/magic.h ../utils/geometry.h \
|
||||
|
|
|
|||
Loading…
Reference in New Issue