Skip to content

Commit fd2b1eb

Browse files
Added code that when running "extract unique" always prefers to
change a non-port label name instead of a port name whenever it finds one of each with the same text on different nets.
1 parent ca99d0b commit fd2b1eb

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.3.478
1+
8.3.479

extract/ExtUnique.c

+27-5
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,31 @@ extUniqueCell(def, option)
154154
}
155155
if (lastreg != lp && lastreg != &processedLabel)
156156
{
157-
nwarn += extMakeUnique(def, ll, lp, lregList,
157+
LabelList *lltest = NULL;
158+
159+
/* If the last label is a port and this label is not, then
160+
* run extMakeUnique on the port (since extMakeUnique() causes
161+
* all other nodes to be made unique). This preserves the port
162+
* name whenever a port name disagrees with an internal name.
163+
*/
164+
165+
if (!(ll->ll_label->lab_flags & PORT_DIR_MASK))
166+
for (lltest = lastreg->lreg_labels; lltest; lltest = lltest->ll_next)
167+
if (!strcmp(lltest->ll_label->lab_text, text))
168+
if (lltest->ll_label->lab_flags & PORT_DIR_MASK)
169+
break;
170+
171+
if (lltest != NULL)
172+
{
173+
nwarn += extMakeUnique(def, lltest, lastreg, lregList,
174+
&labelHash, option);
175+
}
176+
else
177+
{
178+
nwarn += extMakeUnique(def, ll, lp, lregList,
158179
&labelHash, option);
159-
HashSetValue(he, (ClientData) &processedLabel);
180+
HashSetValue(he, (ClientData) &processedLabel);
181+
}
160182
}
161183
}
162184
}
@@ -199,15 +221,15 @@ extMakeUnique(def, ll, lreg, lregList, labelHash, option)
199221
if (option == EXT_UNIQ_ALL)
200222
goto makeUnique;
201223
else if ((option == EXT_UNIQ_NOPORTS || option == EXT_UNIQ_NOTOPPORTS) &&
202-
!(ll->ll_label->lab_flags & PORT_DIR_MASK))
224+
(ll->ll_label->lab_flags & PORT_DIR_MASK))
203225
goto makeUnique;
204226

205227
cpend = strchr(text, '\0');
206228
if (cpend > text) cpend--;
207229
if (*cpend == '#') goto makeUnique;
208230
if (*cpend == '!') return 0;
209231
if (((option == EXT_UNIQ_NOPORTS) || (option == EXT_UNIQ_NOTOPPORTS))
210-
&& (ll->ll_label->lab_flags & PORT_DIR_MASK))
232+
&& !(ll->ll_label->lab_flags & PORT_DIR_MASK))
211233
return 0;
212234

213235
/* Generate a warning for each occurrence of this label */
@@ -250,7 +272,7 @@ extMakeUnique(def, ll, lreg, lregList, labelHash, option)
250272
{
251273
if (ll2->ll_label == (Label *) NULL)
252274
continue;
253-
if (strcmp(ll2->ll_label->lab_text, name) != 0)
275+
if (strcmp(ll2->ll_label->lab_text, name))
254276
continue;
255277

256278
/*

0 commit comments

Comments
 (0)