From c9955d39a618995f2a8fb2ba9c8d05d067b605a1 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 2 Mar 2020 00:09:41 +0100 Subject: [PATCH 1/3] Fixed issue-517 --- .../lefdef/db_plugin/dbLEFDEFImporter.cc | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc index 55a4e7ecc..856ab51fe 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc @@ -661,33 +661,41 @@ LEFDEFImporter::create_generated_via (std::vector &bottom, for (int r = 0; r < rows; ++r) { - if (rp == 0 && *p) { + if (rp == 0) { - // read a new row specification - rp = 0; - while (*p && is_hex_digit (*p)) { - rp = (rp * 16) + hex_value (*p++); - } - if (*p == '_') { - ++p; - } - - p0 = p; if (*p) { - while (*p && (is_hex_digit (*p) || toupper (*p) == 'R')) { + + // read a new row specification + rp = 0; + while (*p && is_hex_digit (*p)) { + rp = (rp * 16) + hex_value (*p++); + } + if (*p == '_') { ++p; } - } - p1 = p; - if (*p == '_') { - ++p; + + p0 = p; + if (*p) { + while (*p && (is_hex_digit (*p) || toupper (*p) == 'R')) { + ++p; + } + } + p1 = p; + if (*p == '_') { + ++p; + } + + } else { + rp = -1; } } - if (rp > 0) { + if (rp != 0) { - --rp; + if (rp > 0) { + --rp; + } const char *pp = p0; unsigned int d = 0; From cec1910bf0ee42aa5d5d93effe50b2800f2c81cb Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 2 Mar 2020 00:13:44 +0100 Subject: [PATCH 2/3] Added tests. --- .../lefdef/unit_tests/dbLEFDEFImport.cc | 5 +++ testdata/lefdef/issue-517/au.oas.gz | Bin 0 -> 549 bytes testdata/lefdef/issue-517/in.def | 29 ++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 testdata/lefdef/issue-517/au.oas.gz create mode 100644 testdata/lefdef/issue-517/in.def diff --git a/src/plugins/streamers/lefdef/unit_tests/dbLEFDEFImport.cc b/src/plugins/streamers/lefdef/unit_tests/dbLEFDEFImport.cc index 79f06c647..92e3eb883 100644 --- a/src/plugins/streamers/lefdef/unit_tests/dbLEFDEFImport.cc +++ b/src/plugins/streamers/lefdef/unit_tests/dbLEFDEFImport.cc @@ -260,3 +260,8 @@ TEST(22) run_test (_this, "issue-489b", "lef:in_tech.lef+lef:in.lef", "au.oas.gz", opt, false); } +TEST(23) +{ + run_test (_this, "issue-517", "def:in.def", "au.oas.gz", default_options (), false); +} + diff --git a/testdata/lefdef/issue-517/au.oas.gz b/testdata/lefdef/issue-517/au.oas.gz new file mode 100644 index 0000000000000000000000000000000000000000..429872948dcd9ed53311f7d2445b643d31a0f040 GIT binary patch literal 549 zcmY!lcJ=kt^>+;R4CduxWH!_@V0gjKfDB|rrGn#q9V6m{J>C6WUE)3cLR{TlgW|(I zT|zuKSY&u*Akv|J*c8Z!as|hS_y@#0yZZR>um<}&`uH$IDSWDYl5ZfZ$ljv+H6Py&e!6*ppLf{TOM+$" ; +DESIGN SMALL ; +UNITS DISTANCE MICRONS 100 ; + +DIEAREA ( -30 -30 ) ( 1030 1030 ) ; + +VIAS 1 ; +- via1_960x340 ++ VIARULE Via1Array-0 + + CUTSIZE 140 140 + + LAYERS metal1 via1 metal2 + + CUTSPACING 160 160 + + ENCLOSURE 110 100 110 100 + + ROWCOL 1 3 +; +END VIAS + +SPECIALNETS 1 ; +- VDD ( * VDD ) ++ ROUTED metal1 0 + SHAPE STRIPE ( 500 500 ) via1_960x340 ++ USE POWER ; +END SPECIALNETS + +END DESIGN + From 04ae4d5d2893c6610dabe79b79081302da4ccfdb Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 2 Mar 2020 00:20:15 +0100 Subject: [PATCH 3/3] Updated fix (wasn't correctly representing some via pattern) --- src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc index 856ab51fe..a60e37a89 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc @@ -656,7 +656,7 @@ LEFDEFImporter::create_generated_via (std::vector &bottom, top.push_back (db::Polygon (via_box.enlarged (te).moved (to))); const char *p = pattern.c_str (); - int rp = 0; + int rp = pattern.empty () ? -1 : 0; const char *p0 = p, *p1 = p; for (int r = 0; r < rows; ++r) { @@ -685,8 +685,6 @@ LEFDEFImporter::create_generated_via (std::vector &bottom, ++p; } - } else { - rp = -1; } }