Corrected a problem with both the "port" command and the "lef read"

command when annotating an existing layout from a LEF database, if
there is a port in the layout that is shadowed by a label with the
same name that is not a port.
This commit is contained in:
Tim Edwards 2020-09-25 22:39:50 -04:00
parent b846c45056
commit aac2c06dfd
3 changed files with 27 additions and 5 deletions

View File

@ -1 +1 @@
8.3.60
8.3.61

View File

@ -1407,7 +1407,7 @@ CmdPort(w, cmd)
if (sl && ((sl->lab_flags & PORT_DIR_MASK) != 0))
if ((sl->lab_flags & PORT_NUM_MASK) == portidx)
{
lab = sl;
lab = sl;
break;
}
}
@ -1419,7 +1419,8 @@ CmdPort(w, cmd)
if (!strcmp(portname, sl->lab_text))
{
lab = sl;
break;
if (sl && ((sl->lab_flags & PORT_DIR_MASK) != 0))
break;
}
}
if (lab == NULL)

View File

@ -1568,19 +1568,40 @@ LefReadPin(lefMacro, f, pinname, pinNum, oscale, is_imported)
if (is_imported)
{
bool needRect = TRUE;
bool hasPort = FALSE;
Label *lab;
/* Conflicting interests: One purpose of annotation */
/* is to make ports where none existed. But if the */
/* cell has both port and non-port labels with the */
/* same string, then don't mess with the non-port */
/* label. */
for (lab = firstlab; lab; lab = lab->lab_next)
if (lab->lab_flags & PORT_DIR_MASK)
if (!strcmp(lab->lab_text, testpin))
{
hasPort = TRUE;
break;
}
/* Skip the port geometry but find the pin name and */
/* annotate with the use and direction. Note that */
/* there may be multiple instances of the label. */
/* However, if the label is a point label, then */
/* replace it with the geometry from the LEF file. */
for (lab = firstlab; lab; lab = lab->lab_next)
if (hasPort == FALSE) lab = firstlab;
for (; lab; lab = lab->lab_next)
{
if (!strcmp(lab->lab_text, testpin))
{
if (GEO_RECTNULL(&lab->lab_rect))
/* If there is at least one port label with this */
/* name, then ignore all non-port labels with the */
/* same name. */
if ((hasPort) && (!(lab->lab_flags & PORT_DIR_MASK)))
break;
else if (GEO_RECTNULL(&lab->lab_rect))
break;
else
{