Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ config.log
scripts/config.log
config.status
scripts/config.status
python/lvs_manager.py
*.o
*.so
*~
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.215
1.5.215-P1
64 changes: 35 additions & 29 deletions base/flatten.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void flattenCell(char *name, int file)
else
ThisCell = LookupCellFile(name, file);
if (ThisCell == NULL) {
Printf("No cell %s found.\n", name);
Printf("No cell %s (%d) found.\n", name, file);
return;
}
FreeNodeNames(ThisCell);
Expand Down Expand Up @@ -278,13 +278,13 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
}
else {
if (Debug)
Printf("Flattening instances of %s within cell: %s\n", instance, name);
Printf("Flattening instances of %s within cell: %s (%d)\n", instance, name, fnum);
if (fnum == -1)
ThisCell = LookupCell(name);
else
ThisCell = LookupCellFile(name, fnum);
if (ThisCell == NULL) {
Printf("No cell %s found.\n", name);
Printf("No cell %s (%d) found.\n", name, fnum);
return 0;
}
}
Expand Down Expand Up @@ -370,23 +370,30 @@ int flattenInstancesOf(char *name, int fnum, char *instance)

if (ChildListEnd == NULL) ChildListEnd = ChildEnd;

/* update node numbers in child to unique numbers */
/* update node numbers in child to unique numbers
by adding previous greatest node number. */
oldmax = 0;
for (tmp = ChildStart; tmp != NULL; tmp = tmp->next)
for (tmp = ChildStart; tmp != NULL; tmp = tmp->next) {
if (tmp->node > oldmax) oldmax = tmp->node;
if (nextnode <= oldmax) nextnode = oldmax + 1;
if (tmp->node > 0) tmp->node += (nextnode - 1);
}
//if (nextnode <= oldmax) nextnode = oldmax + 1;
nextnode += oldmax;

/* This block is unnecessary
for (tmp = ChildStart; tmp != NULL; tmp = tmp->next)
if (tmp->node <= oldmax && tmp->node > 0) {
if (Debug) Printf("Update node %d --> %d\n", tmp->node, nextnode);
UpdateNodeNumbers(ChildStart, tmp->node, nextnode);
nextnode++;
}
*/

/* copy nodenumbers of ports from parent */
ob2 = ParentParams;
for (tmp = ChildStart; tmp != NULL; tmp = tmp->next) {
if (IsPort(tmp)) {
// Since ports are grouped at the front of the list and only ports are processed
// quit loop when non port is found
for (tmp = ChildStart; tmp && IsPort(tmp); tmp = tmp->next) {
if (tmp->node > 0) {
if (ob2->node == -1) {

Expand Down Expand Up @@ -423,7 +430,6 @@ int flattenInstancesOf(char *name, int fnum, char *instance)
if (ob2 != NULL) ob2 = ob2->next;

if (ob2 == NULL) break;
}
}

/* Using name == NULL to indicate that a .ext file is being */
Expand Down Expand Up @@ -688,7 +694,7 @@ void convertGlobalsOf(char *name, int fnum, char *instance)
else
ThisCell = LookupCellFile(name, fnum);
if (ThisCell == NULL) {
Printf("No cell %s found.\n", name);
Printf("No cell %s (%d) found.\n", name, fnum);
return;
}
}
Expand Down Expand Up @@ -1118,7 +1124,7 @@ int UniquePins(char *name, int filenum)
ThisCell = LookupCellFile(name, filenum);

if (ThisCell == NULL) {
Printf("No cell %s found.\n", name);
Printf("No cell %s (%d) found.\n", name, filenum);
return 0;
}

Expand All @@ -1140,7 +1146,7 @@ int UniquePins(char *name, int filenum)
if (ob->node > 0) {
nodecount[ob->node]++;
if (nodecount[ob->node] == 2) {
Printf("Duplicate pin %s in cell %s\n", ob->name, ThisCell->name);
Printf("Duplicate pin %s in cell %s (%d)\n", ob->name, ThisCell->name, filenum);
}
if (nodecount[ob->node] > 1) {
/* Remove this node; prep for removal by marking with UNKNOWN */
Expand Down Expand Up @@ -1339,7 +1345,7 @@ int CleanupPins(char *name, int filenum)
ThisCell = LookupCellFile(name, filenum);

if (ThisCell == NULL) {
Printf("No cell %s found.\n", name);
Printf("No cell %s (%d) found.\n", name, filenum);
return 0;
}

Expand Down Expand Up @@ -1607,15 +1613,15 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
}
if (match) {
if (ecomp->cell1 && (ecomp->num1 > 0)) {
Fprintf(stdout, "Flattening instances of %s in cell %s"
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
" makes a better match\n", ecomp->cell1->name,
name1);
name1, file1);
flattenInstancesOf(name1, file1, ecomp->cell1->name);
}
if (ecomp->cell2 && (ecomp->num2 > 0)) {
Fprintf(stdout, "Flattening instances of %s in cell %s"
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
" makes a better match\n", ecomp->cell2->name,
name2);
name2, file2);
flattenInstancesOf(name2, file2, ecomp->cell2->name);
}
modified++;
Expand Down Expand Up @@ -1696,9 +1702,9 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
}
if (match) {
if (ecomp->cell2) {
Fprintf(stdout, "Flattening instances of %s in cell %s"
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
" makes a better match\n", ecomp->cell2->name,
name2);
name2, file2);
flattenInstancesOf(name2, file2, ecomp->cell2->name);
}
modified++;
Expand Down Expand Up @@ -1754,9 +1760,9 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
}
if (match) {
if (ecomp->cell1) {
Fprintf(stdout, "Flattening instances of %s in cell %s"
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
" makes a better match\n", ecomp->cell1->name,
name1);
name1, file1);
flattenInstancesOf(name1, file1, ecomp->cell1->name);
}
modified++;
Expand Down Expand Up @@ -1837,9 +1843,9 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
}
if (found) {
Fprintf(stdout, "Removing zero-valued device "
"%s from cell %s makes a better match\n",
"%s from cell %s (%d) makes a better match\n",
tsub1->name,
tc1->name);
tc1->name, tc1->file);

/* A current source is an open, while a */
/* resistor or voltage source is a short. */
Expand Down Expand Up @@ -1948,9 +1954,9 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
}
if (found) {
Fprintf(stdout, "Removing zero-valued device "
"%s from cell %s makes a better match\n",
"%s from cell %s (%d) makes a better match\n",
tsub2->name,
tc2->name);
tc2->name, tc2->file);

/* merge node of endpoints */
if (ecomp->cell2->class != CLASS_ISOURCE) {
Expand Down Expand Up @@ -2040,9 +2046,9 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
ecompX0->cell1->file, &compdict);
if (dstr) *dstr = '[';
if ((ncomp == ecomp0X) && (ecomp0X->num2 <= ecompX0->num1)) {
Fprintf(stdout, "Flattening instances of %s in cell %s"
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
" makes a better match\n", ecompX0->cell1->name,
name1);
name1, file1);
flattenInstancesOf(name1, file1, ecompX0->cell1->name);
ecompX0->num1 = 0;
ecomp0X->num1 += ecompX0->num1;
Expand All @@ -2066,9 +2072,9 @@ PrematchLists(char *name1, int file1, char *name2, int file2)
ecomp0X->cell2->file, &compdict);
if (dstr) *dstr = '[';
if ((ncomp == ecompX0) && (ecompX0->num1 <= ecomp0X->num2)) {
Fprintf(stdout, "Flattening instances of %s in cell %s"
Fprintf(stdout, "Flattening instances of %s in cell %s (%d)"
" makes a better match\n", ecomp0X->cell2->name,
name2);
name2, file2);
flattenInstancesOf(name2, file2, ecomp0X->cell2->name);
ecomp0X->num2 = 0;
ecompX0->num2 += ecomp0X->num2;
Expand Down
Loading