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 )