diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index 8b24c918d..c0825e751 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -731,6 +731,75 @@ TEST(14_SwitchingTargets) db::compare_layouts (_this, layout2, au2, db::NoNormalization); } +TEST(14b_SideTargetsAndReports) +{ + std::string rs = tl::testdata (); + rs += "/drc/drcSimpleTests_14b.drc"; + + std::string input = tl::testdata (); + input += "/drc/drcSimpleTests_14b.gds"; + + std::string au = tl::testdata (); + au += "/drc/drcSimpleTests_au14b.gds"; + + std::string au2 = tl::testdata (); + au2 += "/drc/drcSimpleTests_au14b_2.gds"; + + std::string au_report = tl::testdata (); + au_report += "/drc/drcSimpleTests_au14b.lyrdb"; + + std::string au_report2 = tl::testdata (); + au_report2 += "/drc/drcSimpleTests_au14b_2.lyrdb"; + + std::string output = this->tmp_file ("tmp.gds"); + std::string output2 = this->tmp_file ("tmp2.gds"); + std::string report = this->tmp_file ("tmp.lydrc"); + std::string report2 = this->tmp_file ("tmp2.lydrc"); + + { + // Set some variables + lym::Macro config; + config.set_text (tl::sprintf ( + "$drc_force_gc = true\n" + "$drc_test_source = '%s'\n" + "$drc_test_target = '%s'\n" + "$drc_test_target2 = '%s'\n" + "$drc_test_report = '%s'\n" + "$drc_test_report2 = '%s'\n" + , input, output, output2, report, report2) + ); + 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); + + db::Layout layout2; + + { + tl::InputStream stream (output2); + db::Reader reader (stream); + reader.read (layout2); + } + + db::compare_layouts (_this, layout2, au2, db::NoNormalization); + + compare_text_files (report, au_report); + compare_text_files (report2, au_report2); +} + TEST(15_issue548) { std::string rs = tl::testdata (); diff --git a/testdata/drc/drcSimpleTests_14b.drc b/testdata/drc/drcSimpleTests_14b.drc new file mode 100644 index 000000000..0d4daa56a --- /dev/null +++ b/testdata/drc/drcSimpleTests_14b.drc @@ -0,0 +1,24 @@ + +source($drc_test_source) + +target($drc_test_target) + +l1 = input(1, 0) +l2 = input(2, 0) + +tcopy = new_target($drc_test_target2) +rcopy = new_report("Report 2", $drc_test_report2) + +l1.output(tcopy, 101, 0) +l2.output(tcopy, 102, 0) + +l1.output(1, 0) +l1.space(1.0.um).output(100, 0) + +report("Report 1", $drc_test_report) + +l2.space(1.0.um).output("l2 space < 1µm") +l1.width(1.0.um).output("l1 width < 1µm") + +l1.sep(l2, 1.0.um).output(rcopy, "l1 sep l2 < 1µm") + diff --git a/testdata/drc/drcSimpleTests_14b.gds b/testdata/drc/drcSimpleTests_14b.gds new file mode 100644 index 000000000..c43c2fae9 Binary files /dev/null and b/testdata/drc/drcSimpleTests_14b.gds differ diff --git a/testdata/drc/drcSimpleTests_au14b.gds b/testdata/drc/drcSimpleTests_au14b.gds new file mode 100644 index 000000000..af3ebbcfb Binary files /dev/null and b/testdata/drc/drcSimpleTests_au14b.gds differ diff --git a/testdata/drc/drcSimpleTests_au14b.lyrdb b/testdata/drc/drcSimpleTests_au14b.lyrdb new file mode 100644 index 000000000..0b6c00a9d --- /dev/null +++ b/testdata/drc/drcSimpleTests_au14b.lyrdb @@ -0,0 +1,88 @@ + + + Report 1 + + drc: script='.drc' + TOP + + + + + l2 space < 1µm + + + + + + l1 width < 1µm + + + + + + + + TOP + + + + + + + + + 'l2 space < 1\302\265m' + TOP + false + 1 + + + edge-pair: (-0.2,0.7;1,0.7)|(1,1.1;-0.2,1.1) + + + + + 'l1 width < 1\302\265m' + TOP + false + 1 + + + edge-pair: (0,0;0,0.9)|(0.3,0.9;0.3,0) + + + + + 'l1 width < 1\302\265m' + TOP + false + 1 + + + edge-pair: (0.3,0;0,0)|(0,0.9;0.3,0.9) + + + + + 'l1 width < 1\302\265m' + TOP + false + 1 + + + edge-pair: (0.5,0;0.5,0.9)|(0.8,0.9;0.8,0) + + + + + 'l1 width < 1\302\265m' + TOP + false + 1 + + + edge-pair: (0.8,0;0.5,0)|(0.5,0.9;0.8,0.9) + + + + diff --git a/testdata/drc/drcSimpleTests_au14b_2.gds b/testdata/drc/drcSimpleTests_au14b_2.gds new file mode 100644 index 000000000..b3a512645 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au14b_2.gds differ diff --git a/testdata/drc/drcSimpleTests_au14b_2.lyrdb b/testdata/drc/drcSimpleTests_au14b_2.lyrdb new file mode 100644 index 000000000..f3430532f --- /dev/null +++ b/testdata/drc/drcSimpleTests_au14b_2.lyrdb @@ -0,0 +1,49 @@ + + + Report 2 + + drc: script='.drc' + TOP + + + + + l1 sep l2 < 1µm + + + + + + + + TOP + + + + + + + + + 'l1 sep l2 < 1\302\265m' + TOP + false + 1 + + + edge-pair: (0,0.9;0.3,0.9)/(1,1.1;-0.2,1.1) + + + + + 'l1 sep l2 < 1\302\265m' + TOP + false + 1 + + + edge-pair: (0.5,0.9;0.8,0.9)/(1,1.1;-0.2,1.1) + + + +