DEF reader bugfix: wasn't reading SPECIALNETS + ROUTED + RECT

This commit is contained in:
Matthias Koefferlein 2020-04-14 23:15:08 +02:00
parent 61714090e3
commit 921af52643
2 changed files with 62 additions and 42 deletions

View File

@ -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 <bool, unsigned int> dl = open_layer (layout, ln, Routing);
if (dl.first) {
if (prop_id != 0) {
design.shapes (dl.second).insert (db::object_with_properties<db::Polygon> (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 <bool, unsigned int> dl = open_layer (layout, ln, Routing);
if (dl.first) {
if (prop_id != 0) {
design.shapes (dl.second).insert (db::object_with_properties<db::Polygon> (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 <bool, unsigned int> dl = open_layer (layout, ln, Routing);
if (dl.first) {
if (prop_id != 0) {
design.shapes (dl.second).insert (db::object_with_properties<db::Polygon> (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 <bool, unsigned int> dl = open_layer (layout, ln, Routing);
if (dl.first) {
if (prop_id != 0) {
design.shapes (dl.second).insert (db::object_with_properties<db::Polygon> (p, prop_id));
} else {
design.shapes (dl.second).insert (p);
}
}
} else {
while (! peek ("+") && ! peek ("-") && ! peek (";")) {
take ();
}
}
}

View File

@ -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 )