diff --git a/src/db/db/dbRegionUtils.cc b/src/db/db/dbRegionUtils.cc index f1e9e9c17..3214fa747 100644 --- a/src/db/db/dbRegionUtils.cc +++ b/src/db/db/dbRegionUtils.cc @@ -76,7 +76,7 @@ static inline bool shields (const db::EdgePair &ep, const db::Edge &q) std::pair ip2 = pe2.intersect_point (q); if (ip1.first && ip2.first) { - return ip1.second != ip2.second || (ip1.second != q.p1 () && ip2.second != q.p2 ()); + return ip1.second != ip2.second || (pe1.side_of (q.p1 ()) != 0 && pe2.side_of (q.p2 ()) != 0); } else { return false; } diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index b0e38fe9f..dad8bbc50 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -674,3 +674,43 @@ TEST(14_SwitchingTargets) db::compare_layouts (_this, layout2, au2, db::NoNormalization); } + +TEST(15_issue548) +{ + std::string rs = tl::testsrc (); + rs += "/testdata/drc/drcSimpleTests_15.drc"; + + std::string input = tl::testsrc (); + input += "/testdata/drc/drcSimpleTests_15.gds"; + + std::string au = tl::testsrc (); + au += "/testdata/drc/drcSimpleTests_au15.gds"; + + std::string output = this->tmp_file ("tmp.gds"); + + { + // Set some variables + lym::Macro config; + config.set_text (tl::sprintf ( + "$drc_test_source = '%s'\n" + "$drc_test_target = '%s'\n" + , input, output) + ); + config.set_interpreter (lym::Macro::Ruby); + EXPECT_EQ (config.run (), 0); + } + + lym::Macro drc; + drc.load_from (rs); + EXPECT_EQ (drc.run (), 0); + + db::Layout layout; + + { + tl::InputStream stream (output); + db::Reader reader (stream); + reader.read (layout); + } + + db::compare_layouts (_this, layout, au, db::NoNormalization); +} diff --git a/testdata/drc/drcSimpleTests_15.drc b/testdata/drc/drcSimpleTests_15.drc new file mode 100644 index 000000000..722252c68 --- /dev/null +++ b/testdata/drc/drcSimpleTests_15.drc @@ -0,0 +1,10 @@ + +source($drc_test_source, "TOP") +target($drc_test_target) + +# various shielding configurations + +l1 = input(1,0) +l1.output(1, 0) +l1.space(0.21.um, euclidian).output(10, 0) + diff --git a/testdata/drc/drcSimpleTests_15.gds b/testdata/drc/drcSimpleTests_15.gds new file mode 100644 index 000000000..d25c39fa5 Binary files /dev/null and b/testdata/drc/drcSimpleTests_15.gds differ diff --git a/testdata/drc/drcSimpleTests_au15.gds b/testdata/drc/drcSimpleTests_au15.gds new file mode 100644 index 000000000..dd81433d9 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au15.gds differ