diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index dd3d15e4a..2547f4e9b 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -876,3 +876,43 @@ TEST(19_shielding) db::compare_layouts (_this, layout, au, db::NoNormalization); } +TEST(20_interact_with_count) +{ + std::string rs = tl::testsrc (); + rs += "/testdata/drc/drcSimpleTests_20.drc"; + + std::string input = tl::testsrc (); + input += "/testdata/drc/drcSimpleTests_20.gds"; + + std::string au = tl::testsrc (); + au += "/testdata/drc/drcSimpleTests_au20.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_20.drc b/testdata/drc/drcSimpleTests_20.drc new file mode 100644 index 000000000..9bd481a5e --- /dev/null +++ b/testdata/drc/drcSimpleTests_20.drc @@ -0,0 +1,56 @@ + +# Hierarchical antenna check + +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.interacting(l2, 1).output(100, 0) +l1.interacting(l2, 2).output(101, 0) +l1.interacting(l2, 1..2).output(102, 0) +l1.interacting(l2, 2..).output(103, 0) +l1.interacting(l2, 1, 2).output(104, 0) + +l = l1.dup +l.select_interacting(l2, 1) +l.output(200, 0) +l = l1.dup +l.select_interacting(l2, 2) +l.output(201, 0) +l = l1.dup +l.select_interacting(l2, 1..2) +l.output(202, 0) +l = l1.dup +l.select_interacting(l2, 2..) +l.output(203, 0) +l = l1.dup +l.select_interacting(l2, 1, 2) +l.output(204, 0) + +l1.not_interacting(l2, 1).output(300, 0) +l1.not_interacting(l2, 2).output(301, 0) +l1.not_interacting(l2, 1..2).output(302, 0) +l1.not_interacting(l2, 2..).output(303, 0) +l1.not_interacting(l2, 1, 2).output(304, 0) + +l = l1.dup +l.select_not_interacting(l2, 1) +l.output(400, 0) +l = l1.dup +l.select_not_interacting(l2, 2) +l.output(401, 0) +l = l1.dup +l.select_not_interacting(l2, 1..2) +l.output(402, 0) +l = l1.dup +l.select_not_interacting(l2, 2..) +l.output(403, 0) +l = l1.dup +l.select_not_interacting(l2, 1, 2) +l.output(404, 0) + diff --git a/testdata/drc/drcSimpleTests_20.gds b/testdata/drc/drcSimpleTests_20.gds new file mode 100644 index 000000000..08618beb2 Binary files /dev/null and b/testdata/drc/drcSimpleTests_20.gds differ diff --git a/testdata/drc/drcSimpleTests_au20.gds b/testdata/drc/drcSimpleTests_au20.gds new file mode 100644 index 000000000..77c6d5bfc Binary files /dev/null and b/testdata/drc/drcSimpleTests_au20.gds differ