From fe8e2299202298b95f708a38cc35fbab00169b6d Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 21 Mar 2020 10:16:33 -0400 Subject: [PATCH] Corrected the DEF read routine's ROWCOL parsing. It was not treated as an optional argument (which it is), and so defaults were not applied, potentially leading to the wrong number of rows/columns in a generated via if ROWCOL is not present in the DEF file. --- database/DBio.c | 11 +++++------ lef/defRead.c | 3 +++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/database/DBio.c b/database/DBio.c index 77c6ed5b..3bb2afd5 100644 --- a/database/DBio.c +++ b/database/DBio.c @@ -1054,23 +1054,22 @@ dbReadOpen(cellDef, name, setFileName, errptr) if (f != NULL) { - if (pptr != NULL) *pptr = '.'; - /* NOTE: May not want to present this as an error, as */ /* it is a common technique to read files from, say, a */ /* LEF file but not save them locally, and then expect */ /* that the layout views will be picked up from */ /* somewhere else in the search paths. */ + if (pptr != NULL) *pptr = '.'; TxError("Warning: Parent cell lists instance of \"%s\" at bad file " "path %s.\n", cellDef->cd_name, cellDef->cd_file); - TxError("The cell exists in the search paths at %s.\n", filename); - TxError("The discovered version will be used.\n"); /* Write the new path to cd_file or else magic will */ /* generate another error later. */ - cellDef->cd_file = StrDup(&cellDef->cd_file, filename); + + TxError("The cell exists in the search paths at %s.\n", filename); + TxError("The discovered version will be used.\n"); } } @@ -2732,7 +2731,7 @@ DBCellWrite(cellDef, fileName) /* surprises can occur after saving a file as a different */ /* filename. */ - cellDef->cd_file = StrDup(&cellDef->cd_file, realname); + cellDef->cd_file = StrDup(&cellDef->cd_file, fileName); } else if (cellDef->cd_file) { diff --git a/lef/defRead.c b/lef/defRead.c index a62a5099..3b91e14a 100644 --- a/lef/defRead.c +++ b/lef/defRead.c @@ -1220,6 +1220,9 @@ DefReadVias(f, sname, oscale, total) LefEstimate(processed++, total, "vias"); + /* If not otherwise specified, rows and columns default to 1 */ + rows = cols = 1; + /* Get via name */ token = LefNextToken(f, TRUE); if (sscanf(token, "%2047s", vianame) != 1)