Corrected LEF annotation so that it does not try to change or any

port indexes, or create duplicated port indexes.
This commit is contained in:
Tim Edwards 2020-05-26 17:58:05 -04:00
parent 582539e95d
commit 8b159a07cd
1 changed files with 25 additions and 1 deletions

View File

@ -1284,7 +1284,7 @@ LefReadPort(lefMacro, f, pinName, pinNum, pinDir, pinUse, oscale, lanno)
while (rectList != NULL) while (rectList != NULL)
{ {
if (pinNum >= 0) if ((pinNum >= 0) || (lanno != NULL))
{ {
/* Label this area */ /* Label this area */
if (lanno != NULL) if (lanno != NULL)
@ -1292,6 +1292,30 @@ LefReadPort(lefMacro, f, pinName, pinNum, pinDir, pinUse, oscale, lanno)
/* Modify an existing label */ /* Modify an existing label */
lanno->lab_rect = rectList->r_r; lanno->lab_rect = rectList->r_r;
lanno->lab_type = rectList->r_type; lanno->lab_type = rectList->r_type;
/* Pin number is not meaninful in LEF files, so keep */
/* any existing pin number. If original label was not */
/* a port, then find a non-conflicting port number for */
/* it. */
if (lanno->lab_flags & PORT_DIR_MASK)
pinNum = lanno->lab_flags & PORT_NUM_MASK;
else
{
Label *sl;
int idx;
pinNum = -1;
for (sl = lefMacro->cd_labels; sl != NULL; sl = sl->lab_next)
{
if (sl->lab_flags & PORT_DIR_MASK)
{
idx = sl->lab_flags & PORT_NUM_MASK;
if (idx > pinNum) pinNum = idx;
}
}
pinNum++;
}
} }
else else
/* Create a new label (non-rendered) */ /* Create a new label (non-rendered) */