diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index 3cba9b295..113c9b43a 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -957,3 +957,83 @@ TEST(21_breaking) db::compare_layouts (_this, layout, au, db::NoNormalization); } +TEST(22_opposite_filter) +{ + std::string rs = tl::testsrc (); + rs += "/testdata/drc/drcSimpleTests_22.drc"; + + std::string input = tl::testsrc (); + input += "/testdata/drc/drcSimpleTests_22.gds"; + + std::string au = tl::testsrc (); + au += "/testdata/drc/drcSimpleTests_au22.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); +} + +TEST(23_rect_filter) +{ + std::string rs = tl::testsrc (); + rs += "/testdata/drc/drcSimpleTests_23.drc"; + + std::string input = tl::testsrc (); + input += "/testdata/drc/drcSimpleTests_23.gds"; + + std::string au = tl::testsrc (); + au += "/testdata/drc/drcSimpleTests_au23.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_19.drc b/testdata/drc/drcSimpleTests_19.drc index 60d92f511..e92ef5d58 100644 --- a/testdata/drc/drcSimpleTests_19.drc +++ b/testdata/drc/drcSimpleTests_19.drc @@ -14,3 +14,13 @@ l1.space(3.0, shielded, projection).output(101, 0) l2.separation(l1, 3.0, transparent, projection).output(110, 0) l2.separation(l1, 3.0, shielded, projection).output(111, 0) +deep + +l1 = input(1, 0) +l2 = input(2, 0) + +l1.space(3.0, transparent, projection).output(200, 0) +l1.space(3.0, shielded, projection).output(201, 0) +l2.separation(l1, 3.0, transparent, projection).output(210, 0) +l2.separation(l1, 3.0, shielded, projection).output(211, 0) + diff --git a/testdata/drc/drcSimpleTests_22.drc b/testdata/drc/drcSimpleTests_22.drc new file mode 100644 index 000000000..87398645c --- /dev/null +++ b/testdata/drc/drcSimpleTests_22.drc @@ -0,0 +1,25 @@ + +# shielded/transparent + +source($drc_test_source, "TOP") +target($drc_test_target) + +l1 = input(1, 0) +l2 = input(2, 0) + +l1.output(1, 0) +l2.output(2, 0) + +l1.separation(l2, 3.0, projection).output(100, 0) +l1.separation(l2, 3.0, not_opposite, projection).output(110, 0) +l1.separation(l2, 3.0, only_opposite, projection).output(111, 0) + +deep + +l1 = input(1, 0) +l2 = input(2, 0) + +l1.separation(l2, 3.0, projection).output(200, 0) +l1.separation(l2, 3.0, not_opposite, projection).output(210, 0) +l1.separation(l2, 3.0, only_opposite, projection).output(211, 0) + diff --git a/testdata/drc/drcSimpleTests_22.gds b/testdata/drc/drcSimpleTests_22.gds new file mode 100644 index 000000000..59cf4283e Binary files /dev/null and b/testdata/drc/drcSimpleTests_22.gds differ diff --git a/testdata/drc/drcSimpleTests_23.drc b/testdata/drc/drcSimpleTests_23.drc new file mode 100644 index 000000000..a55e9771e --- /dev/null +++ b/testdata/drc/drcSimpleTests_23.drc @@ -0,0 +1,35 @@ + +# shielded/transparent + +source($drc_test_source, "TOP") +target($drc_test_target) + +l1 = input(1, 0) +l2 = input(2, 0) + +l1.output(1, 0) +l2.output(2, 0) + +l1.separation(l2, 3.0, projection).output(100, 0) +l1.separation(l2, 3.0, one_side_allowed, projection).output(110, 0) +l1.separation(l2, 3.0, two_sides_allowed, projection).output(111, 0) +l1.separation(l2, 3.0, two_opposite_sides_allowed, projection).output(112, 0) +l1.separation(l2, 3.0, two_connected_sides_allowed, projection).output(113, 0) +l1.separation(l2, 3.0, three_sides_allowed, projection).output(114, 0) +l1.separation(l2, 3.0, four_sides_allowed, projection).output(115, 0) +l1.separation(l2, 3.0, one_side_allowed, two_opposite_sides_allowed, projection).output(116, 0) + +deep + +l1 = input(1, 0) +l2 = input(2, 0) + +l1.separation(l2, 3.0, projection).output(200, 0) +l1.separation(l2, 3.0, one_side_allowed, projection).output(210, 0) +l1.separation(l2, 3.0, two_sides_allowed, projection).output(211, 0) +l1.separation(l2, 3.0, two_opposite_sides_allowed, projection).output(212, 0) +l1.separation(l2, 3.0, two_connected_sides_allowed, projection).output(213, 0) +l1.separation(l2, 3.0, three_sides_allowed, projection).output(214, 0) +l1.separation(l2, 3.0, four_sides_allowed, projection).output(215, 0) +l1.separation(l2, 3.0, one_side_allowed, two_opposite_sides_allowed, projection).output(216, 0) + diff --git a/testdata/drc/drcSimpleTests_23.gds b/testdata/drc/drcSimpleTests_23.gds new file mode 100644 index 000000000..1d93b5368 Binary files /dev/null and b/testdata/drc/drcSimpleTests_23.gds differ diff --git a/testdata/drc/drcSimpleTests_au19.gds b/testdata/drc/drcSimpleTests_au19.gds index 9365b7245..17f23c524 100644 Binary files a/testdata/drc/drcSimpleTests_au19.gds and b/testdata/drc/drcSimpleTests_au19.gds differ diff --git a/testdata/drc/drcSimpleTests_au22.gds b/testdata/drc/drcSimpleTests_au22.gds new file mode 100644 index 000000000..471a416b7 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au22.gds differ diff --git a/testdata/drc/drcSimpleTests_au23.gds b/testdata/drc/drcSimpleTests_au23.gds new file mode 100644 index 000000000..3e2854d70 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au23.gds differ