From 61714090e3e6f85c143ddde107a818d80c5ef2fd Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 14 Apr 2020 22:48:18 +0200 Subject: [PATCH 1/3] Maybe fixed performance issue: usually it's not a good idea to iterate the layout's hierarchy while deleting something from it. --- src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc b/src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc index 4b65f2ade..fb3902d48 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc @@ -1397,6 +1397,8 @@ DEFImporter::do_read (db::Layout &layout) if (! groups.empty ()) { + db::LayoutLocker locker (&layout); + others_cell = &layout.cell (layout.add_cell ("NOGROUP")); design.insert (db::CellInstArray (others_cell->cell_index (), db::Trans ())); From 921af5264327fcfb013ff7ce3d2831793b2d44dc Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 14 Apr 2020 23:15:08 +0200 Subject: [PATCH 2/3] DEF reader bugfix: wasn't reading SPECIALNETS + ROUTED + RECT --- .../lefdef/db_plugin/dbDEFImporter.cc | 101 +++++++++++------- testdata/lefdef/specialnets_geo/test.def | 3 +- 2 files changed, 62 insertions(+), 42 deletions(-) diff --git a/src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc b/src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc index fb3902d48..08edc10cc 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbDEFImporter.cc @@ -770,15 +770,70 @@ DEFImporter::read_nets (db::Layout &layout, db::Cell &design, double scale, bool nondefaultrule = get (); - } else if ((was_shield = test ("SHIELD")) == true || test ("NOSHIELD") || test ("ROUTED") || test ("FIXED") || test ("COVER")) { + } else { - if (was_shield) { - take (); + bool prefixed = false; + + if ((was_shield = test ("SHIELD")) == true || test ("NOSHIELD") || test ("ROUTED") || test ("FIXED") || test ("COVER")) { + if (was_shield) { + take (); + } + prefixed = true; } - read_single_net (nondefaultrule, layout, design, scale, prop_id, specialnets); + bool any = false; - if (in_subnet) { + if (test ("POLYGON")) { + + std::string ln = get (); + + db::Polygon p; + read_polygon (p, scale); + + std::pair dl = open_layer (layout, ln, Routing); + if (dl.first) { + if (prop_id != 0) { + design.shapes (dl.second).insert (db::object_with_properties (p, prop_id)); + } else { + design.shapes (dl.second).insert (p); + } + } + + any = true; + + } else if (test ("RECT")) { + + std::string ln = get (); + + db::Polygon p; + read_rect (p, scale); + + std::pair dl = open_layer (layout, ln, Routing); + if (dl.first) { + if (prop_id != 0) { + design.shapes (dl.second).insert (db::object_with_properties (p, prop_id)); + } else { + design.shapes (dl.second).insert (p); + } + } + + any = true; + + } else if (prefixed) { + + read_single_net (nondefaultrule, layout, design, scale, prop_id, specialnets); + any = true; + + } else { + + // lazily skip everything else + while (! peek ("+") && ! peek ("-") && ! peek (";")) { + take (); + } + + } + + if (any && in_subnet) { in_subnet = false; @@ -792,42 +847,6 @@ DEFImporter::read_nets (db::Layout &layout, db::Cell &design, double scale, bool } - } else if (test ("POLYGON")) { - - std::string ln = get (); - - db::Polygon p; - read_polygon (p, scale); - - std::pair dl = open_layer (layout, ln, Routing); - if (dl.first) { - if (prop_id != 0) { - design.shapes (dl.second).insert (db::object_with_properties (p, prop_id)); - } else { - design.shapes (dl.second).insert (p); - } - } - - } else if (test ("RECT")) { - - std::string ln = get (); - - db::Polygon p; - read_rect (p, scale); - - std::pair dl = open_layer (layout, ln, Routing); - if (dl.first) { - if (prop_id != 0) { - design.shapes (dl.second).insert (db::object_with_properties (p, prop_id)); - } else { - design.shapes (dl.second).insert (p); - } - } - - } else { - while (! peek ("+") && ! peek ("-") && ! peek (";")) { - take (); - } } } diff --git a/testdata/lefdef/specialnets_geo/test.def b/testdata/lefdef/specialnets_geo/test.def index 2874f0491..0686c4fec 100644 --- a/testdata/lefdef/specialnets_geo/test.def +++ b/testdata/lefdef/specialnets_geo/test.def @@ -16,8 +16,9 @@ VIAS 1 ; END VIAS SPECIALNETS 1 ; - dummy + + ROUTED RECT M2 ( 350 0 ) ( 200 100 ) + POLYGON M1 ( 300 0 ) ( 300 50 ) ( 350 50 ) ( 400 100 ) ( 400 0 ) - + POLYGON M2 ( 300 150 ) ( 300 200 ) ( 350 200 ) ( 400 250 ) ( 400 150 ) + + ROUTED POLYGON M2 ( 300 150 ) ( 300 200 ) ( 350 200 ) ( 400 250 ) ( 400 150 ) + RECT M1 ( 0 0 ) ( 100 200 ) + ROUTED M1 30 ( 0 0 15 ) ( 100 0 0 ) VIA1_dummy ( 100 100 10 ) + ROUTED M2 50 + SHAPE RING + STYLE 1 ( 0 100 ) ( 100 200 ) ( 200 200 ) From d4a333966b4d108530d37c2496d3aeb62d422551 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 14 Apr 2020 23:16:43 +0200 Subject: [PATCH 3/3] Updated testdata for last patch. --- testdata/lefdef/specialnets_geo/au.oas.gz | Bin 337 -> 346 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/testdata/lefdef/specialnets_geo/au.oas.gz b/testdata/lefdef/specialnets_geo/au.oas.gz index 9a20c2234753451d7489d7dc87b5c1710ecb9b94..cffe301036e98a0a255fff963ec96a3908949e8a 100644 GIT binary patch delta 62 zcmV-E0Kxy!0@?xxABzYG7bupo2POe6;KCjJ2be&@J^Z3QAjOPKCm7cN4P^kSKr(X; UlPpuiNCpfH08r9-!k+>F0HVbd-v9sr delta 53 zcmV-50LuT`0?`5oABzYGUQdd#2POd|K*C5m)-b`lL7z$9d;D2