From 8dae4161e1449cdeb584b892beff636ddff5c961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=B6fferlein?= Date: Thu, 30 Apr 2020 22:03:16 +0200 Subject: [PATCH] Fixed #548 (shield issue on space) (#549) --- src/db/db/dbRegionUtils.cc | 2 +- src/drc/unit_tests/drcSimpleTests.cc | 40 +++++++++++++++++++++++++++ testdata/drc/drcSimpleTests_15.drc | 10 +++++++ testdata/drc/drcSimpleTests_15.gds | Bin 0 -> 780 bytes testdata/drc/drcSimpleTests_au15.gds | Bin 0 -> 1420 bytes 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 testdata/drc/drcSimpleTests_15.drc create mode 100644 testdata/drc/drcSimpleTests_15.gds create mode 100644 testdata/drc/drcSimpleTests_au15.gds 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 0000000000000000000000000000000000000000..d25c39fa545bf508a00f5c192f2ff7d5c8253e99 GIT binary patch literal 780 zcma))u}Z{16h&_)vy<$G)vN?XSP?q~!A`MIR8$ZJEtW;L69fgn#7^6_(9UK*z%LNN z!phFVLQBC95aUfAk7zNn&79$qlXsaJI2dz?c3`46SWIC8DT3d7#K!IIYyeqUTU|e2 z+P%O1T;9A}xVh?e(60UCIoH`g0Bjv_O@jb##DM#mVvR>bt`Er4f+xUOB%Hp6Z4F`N zdA>;NjMihxVXc0izaG)<(|VFw@!y8?Wv64HIpE*P^b`m#Dr!!aQ+o|I$2jZzD9lnO3kyb&zIhIPUzmHzfyD3Ghcd#FT$utvcFPu o((4Dj)%q6al8q1YtD@$l-{)MJgMO4z zMA-TcWx4Y+uYkzTzN~&4o%`|q^7-V!@VDL7B~-E;zow3pMnA(-^`=;t^v}tgCUu-N`&_Sheu)?G#@SJm zI!?Cwe&dG9`Lnit#J