From 0e966af9266368983d8ed450517b17a0ab86e804 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Fri, 25 Oct 2019 12:21:19 -0400 Subject: [PATCH] Modified the check for redundant label indexes in lefWrite so that it only complains about (i.e., issues an error message) ports with the same index but different text, indicating a read port number collision and a true error. --- lef/lefWrite.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lef/lefWrite.c b/lef/lefWrite.c index 69264fc3..282b1bda 100644 --- a/lef/lefWrite.c +++ b/lef/lefWrite.c @@ -638,7 +638,7 @@ lefWriteMacro(def, f, scale, hide) { bool propfound; char *propvalue, *class = NULL; - Label *lab; + Label *lab, *tlab; Rect boundary, labr; SearchContext scx; CellDef *lefFlatDef; @@ -968,15 +968,21 @@ lefWriteMacro(def, f, scale, hide) if (maxport >= 0) { - /* Sanity check to see if port number is a duplicate */ - for (lab = lab->lab_next; lab != NULL; lab = lab->lab_next) + /* Sanity check to see if port number is a duplicate. ONLY */ + /* flag this if the other index has a different text, as it */ + /* is perfectly legal to have multiple ports with the same */ + /* name and index. */ + + for (tlab = lab->lab_next; tlab != NULL; tlab = tlab->lab_next) { - if (lab->lab_flags & PORT_DIR_MASK) - if ((lab->lab_flags & PORT_NUM_MASK) == idx) - { - TxError("Port index %d is used more than once\n", idx); - idx--; - } + if (tlab->lab_flags & PORT_DIR_MASK) + if ((tlab->lab_flags & PORT_NUM_MASK) == idx) + if (strcmp(lab->lab_text, lab->lab_text)) + { + TxError("Index %d is used for ports \"%s\" and \"%s\"\n", + idx, lab->lab_text, tlab->lab_text); + idx--; + } } } else