Corrected an issue with the "-noflatten" switch to "lvs", which is
also a problem with the underlying "flatten prohibit" command option; in one place, the cell's subcircuits were being prohibited from being flattened, causing issues including a potential infinite loop.
This commit is contained in:
parent
04163aedcc
commit
72d7d55bbe
|
|
@ -300,8 +300,6 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Placeholder cells must not be flattened */
|
|
||||||
if (ThisCell->flags & CELL_PLACEHOLDER) return 0;
|
|
||||||
|
|
||||||
FreeNodeNames(ThisCell);
|
FreeNodeNames(ThisCell);
|
||||||
|
|
||||||
|
|
@ -339,6 +337,10 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
|
||||||
LastObj = ParentParams;
|
LastObj = ParentParams;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (ChildCell->flags & CELL_PLACEHOLDER) {
|
||||||
|
LastObj = ParentParams;
|
||||||
|
continue; // Placeholder cells must not be flattened
|
||||||
|
}
|
||||||
if (ChildCell == ThisCell) {
|
if (ChildCell == ThisCell) {
|
||||||
LastObj = ParentParams;
|
LastObj = ParentParams;
|
||||||
continue; // Avoid infinite loop
|
continue; // Avoid infinite loop
|
||||||
|
|
@ -1753,8 +1755,8 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
||||||
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
||||||
" makes a better match\n", ecomp->cell1->name,
|
" makes a better match\n", ecomp->cell1->name,
|
||||||
name1, file1);
|
name1, file1);
|
||||||
flattenInstancesOf(name1, file1, ecomp->cell1->name);
|
if (flattenInstancesOf(name1, file1, ecomp->cell1->name) > 0)
|
||||||
modified1++;
|
modified1++;
|
||||||
}
|
}
|
||||||
else if (ecomp->cell1 && (ecomp->num1 > 0)) {
|
else if (ecomp->cell1 && (ecomp->num1 > 0)) {
|
||||||
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
||||||
|
|
@ -1766,8 +1768,8 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
||||||
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
||||||
" makes a better match\n", ecomp->cell2->name,
|
" makes a better match\n", ecomp->cell2->name,
|
||||||
name2, file2);
|
name2, file2);
|
||||||
flattenInstancesOf(name2, file2, ecomp->cell2->name);
|
if (flattenInstancesOf(name2, file2, ecomp->cell2->name) > 0)
|
||||||
modified2++;
|
modified2++;
|
||||||
}
|
}
|
||||||
else if (ecomp->cell2 && (ecomp->num2 > 0)) {
|
else if (ecomp->cell2 && (ecomp->num2 > 0)) {
|
||||||
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
||||||
|
|
@ -1861,8 +1863,8 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
||||||
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
||||||
" makes a better match\n", ecomp->cell2->name,
|
" makes a better match\n", ecomp->cell2->name,
|
||||||
name2, file2);
|
name2, file2);
|
||||||
flattenInstancesOf(name2, file2, ecomp->cell2->name);
|
if (flattenInstancesOf(name2, file2, ecomp->cell2->name) > 0)
|
||||||
modified2++;
|
modified2++;
|
||||||
}
|
}
|
||||||
else if (ecomp->cell2) {
|
else if (ecomp->cell2) {
|
||||||
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
||||||
|
|
@ -1932,8 +1934,8 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
||||||
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
||||||
" makes a better match\n", ecomp->cell1->name,
|
" makes a better match\n", ecomp->cell1->name,
|
||||||
name1, file1);
|
name1, file1);
|
||||||
flattenInstancesOf(name1, file1, ecomp->cell1->name);
|
if (flattenInstancesOf(name1, file1, ecomp->cell1->name) > 0)
|
||||||
modified1++;
|
modified1++;
|
||||||
}
|
}
|
||||||
else if (ecomp->cell1) {
|
else if (ecomp->cell1) {
|
||||||
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
|
||||||
|
|
@ -2295,11 +2297,12 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
||||||
Fprintf(stdout, "Flattening instances of %s in cell"
|
Fprintf(stdout, "Flattening instances of %s in cell"
|
||||||
" %s (%d) makes a better match\n",
|
" %s (%d) makes a better match\n",
|
||||||
ecompX0->cell1->name, name1, file1);
|
ecompX0->cell1->name, name1, file1);
|
||||||
flattenInstancesOf(name1, file1,
|
if (flattenInstancesOf(name1, file1,
|
||||||
ecompX0->cell1->name);
|
ecompX0->cell1->name) > 0) {
|
||||||
ecompX0->num1 = 0;
|
ecompX0->num1 = 0;
|
||||||
ecomp0X->num1 += ecompX0->num1;
|
ecomp0X->num1 += ecompX0->num1;
|
||||||
modified1++;
|
modified1++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2331,11 +2334,12 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
|
||||||
Fprintf(stdout, "Flattening instances of %s in cell"
|
Fprintf(stdout, "Flattening instances of %s in cell"
|
||||||
" %s (%d) makes a better match\n",
|
" %s (%d) makes a better match\n",
|
||||||
ecomp0X->cell2->name, name2, file2);
|
ecomp0X->cell2->name, name2, file2);
|
||||||
flattenInstancesOf(name2, file2,
|
if (flattenInstancesOf(name2, file2,
|
||||||
ecomp0X->cell2->name);
|
ecomp0X->cell2->name) > 0) {
|
||||||
ecomp0X->num2 = 0;
|
ecomp0X->num2 = 0;
|
||||||
ecompX0->num2 += ecomp0X->num2;
|
ecompX0->num2 += ecomp0X->num2;
|
||||||
modified2++;
|
modified2++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Fprintf(stdout, "Flattening instances of %s in "
|
Fprintf(stdout, "Flattening instances of %s in "
|
||||||
|
|
|
||||||
|
|
@ -3582,7 +3582,7 @@ int FlattenUnmatched(struct nlist *tc, char *parent, int stoplevel, int loclevel
|
||||||
tc->name, parent, tc->file);
|
tc->name, parent, tc->file);
|
||||||
changed = flattenInstancesOf(parent, tc->file, tc->name);
|
changed = flattenInstancesOf(parent, tc->file, tc->name);
|
||||||
Fprintf(stdout, "(%d instance%s)\n", changed, ((changed == 1) ? "" : "s"));
|
Fprintf(stdout, "(%d instance%s)\n", changed, ((changed == 1) ? "" : "s"));
|
||||||
return 1;
|
return (changed != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tc->cell == NULL) return 0;
|
if (tc->cell == NULL) return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue