diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index 1c8180a8d..e08cd0a2c 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -1702,3 +1702,74 @@ TEST(102d_edge_modes) { run_test (_this, "102", true); } + +TEST(110_RDBVariantAssignment) +{ + std::string rs = tl::testdata (); + rs += "/drc/drcSimpleTests_110.drc"; + + // apart from that it's a variant of 14b ... + + std::string input = tl::testdata (); + input += "/drc/drcSimpleTests_110.gds"; + + std::string au_report = tl::testdata (); + au_report += "/drc/drcSimpleTests_au110.lyrdb"; + + std::string report = this->tmp_file ("tmp.lydrc"); + + { + // Set some variables + lym::Macro config; + config.set_text (tl::sprintf ( + "$drc_force_gc = true\n" + "$drc_test_source = '%s'\n" + "$drc_test_report = '%s'\n" + , input, report) + ); + config.set_interpreter (lym::Macro::Ruby); + EXPECT_EQ (config.run (), 0); + } + + lym::Macro drc; + drc.load_from (rs); + EXPECT_EQ (drc.run (), 0); + + compare_text_files (report, au_report); +} + +TEST(111_RDBCategoryHierarchy) +{ + std::string rs = tl::testdata (); + rs += "/drc/drcSimpleTests_111.drc"; + + // apart from that it's a variant of 14b ... + + std::string input = tl::testdata (); + input += "/drc/drcSimpleTests_111.gds"; + + std::string au_report = tl::testdata (); + au_report += "/drc/drcSimpleTests_au111.lyrdb"; + + std::string report = this->tmp_file ("tmp.lydrc"); + + { + // Set some variables + lym::Macro config; + config.set_text (tl::sprintf ( + "$drc_force_gc = true\n" + "$drc_test_source = '%s'\n" + "$drc_test_report = '%s'\n" + , input, report) + ); + config.set_interpreter (lym::Macro::Ruby); + EXPECT_EQ (config.run (), 0); + } + + lym::Macro drc; + drc.load_from (rs); + EXPECT_EQ (drc.run (), 0); + + compare_text_files (report, au_report); +} + diff --git a/testdata/drc/drcSimpleTests_110.drc b/testdata/drc/drcSimpleTests_110.drc new file mode 100644 index 000000000..f087e932e --- /dev/null +++ b/testdata/drc/drcSimpleTests_110.drc @@ -0,0 +1,16 @@ + +source($drc_test_source) +report("Report comment with\nanother line", $drc_test_report) + +deep + +l1 = input(1, 0) +l1 = l1.sized(0.1, 0.0) + +l1.output("l1", "L1 (1/0 sized by x=100nm,y=0)") +l1.drc(width < 1.0.um).output("w1um", "w < 1µm\nFrom sized input") + +l1s = l1.snapped(200.nm) +l1s.output("l1_snapped", "L1 snapped to 200nm") +l1s.drc(width < 1.0.um).output("w1um_snapped", "w < 1µm\nFrom snapped input") + diff --git a/testdata/drc/drcSimpleTests_110.gds b/testdata/drc/drcSimpleTests_110.gds new file mode 100644 index 000000000..131ac19da Binary files /dev/null and b/testdata/drc/drcSimpleTests_110.gds differ diff --git a/testdata/drc/drcSimpleTests_111.drc b/testdata/drc/drcSimpleTests_111.drc new file mode 100644 index 000000000..8ba7378dd --- /dev/null +++ b/testdata/drc/drcSimpleTests_111.drc @@ -0,0 +1,14 @@ + +source($drc_test_source) +report("Report comment with\nanother line", $drc_test_report) + +deep + +l1 = input(1, 0) +l1s = l1.sized(0.1, 0.0) + +l1.output([ "input", "L1" ], "Original layer") +l1s.output([ "input", "L1S" ], "Sized original layer") + +l1s.drc(width < 1.0.um).output("w1um", "w < 1µm\nFrom sized input") + diff --git a/testdata/drc/drcSimpleTests_111.gds b/testdata/drc/drcSimpleTests_111.gds new file mode 100644 index 000000000..131ac19da Binary files /dev/null and b/testdata/drc/drcSimpleTests_111.gds differ diff --git a/testdata/drc/drcSimpleTests_au110.lyrdb b/testdata/drc/drcSimpleTests_au110.lyrdb new file mode 100644 index 000000000..793d828a3 --- /dev/null +++ b/testdata/drc/drcSimpleTests_au110.lyrdb @@ -0,0 +1,585 @@ + + + Report comment with +another line + + drc: script='.drc' + TOP + + + + + l1 + L1 (1/0 sized by x=100nm,y=0) + + + + + w1um + w < 1µm +From sized input + + + + + l1_snapped + L1 snapped to 200nm + + + + + w1um_snapped + w < 1µm +From snapped input + + + + + + + TOP + + + + + + + A + r0 + A + + + TOP + r0 *1 0.5,1.2 + + + + + A + r90 + A$VAR1 + + + TOP + r270 *1 2,2 + + + + + A + r0;r0(-0.1,0) + A + + + TOP + r0 *1 0.5,1.2 + + + + + A + r0;r0 + A$VAR1$1 + + + TOP + r0 *1 1.2,1.2 + + + + + + + + l1 + TOP + false + 1 + + + + polygon: (3.7,3.9;3.3,4;3.6,4.6;5.1,4.9;5.3,4.9;5.2,4.2;5,4.2;3.804,4.285;3.9,3.9) + + + + + l1 + TOP + false + 1 + + + + polygon: (2.1,3;2.1,3.6;2.9,3.6;2.9,3) + + + + + l1 + A:r0 + false + 1 + + + + polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0) + + + + + l1 + A:r90 + false + 1 + + + + polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.7,3.9;3.3,4)|(3.804,4.285;3.9,3.9) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9) + + + + + w1um + A:r0 + false + 1 + + + + edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0) + + + + + w1um + A:r90 + false + 1 + + + + edge-pair: (0,-0.1;0,1.7)|(0.2,1.7;0.2,-0.1) + + + + + l1_snapped + TOP + false + 1 + + + + polygon: (3.4,4;3.6,4.6;5.2,5;5.4,5;5.2,4.2;3.8,4.2;4,4) + + + + + l1_snapped + TOP + false + 1 + + + + polygon: (2.2,3;2.2,3.6;3,3.6;3,3) + + + + + l1_snapped + A:r0;r0(-0.1,0) + false + 1 + + + + polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0) + + + + + l1_snapped + A:r90 + false + 1 + + + + polygon: (0,0;0,1.8;0.2,1.8;0.2,0) + + + + + l1_snapped + A:r0;r0 + false + 1 + + + + polygon: (0,0;0,1.6;0.4,1.6;0.4,0) + + + + + w1um_snapped + TOP + false + 1 + + + + edge-pair: (5.2,4.2;4.6,4.2)|(5.2,5;5.4,5) + + + + + w1um_snapped + TOP + false + 1 + + + + edge-pair: (4,4;3.4,4)|(3.8,4.2;4,4) + + + + + w1um_snapped + TOP + false + 1 + + + + edge-pair: (5.2,5;5.4,5)|(5.4,5;5.2,4.2) + + + + + w1um_snapped + TOP + false + 1 + + + + edge-pair: (4,4;3.4,4)|(3.6,4.6;4.547,4.837) + + + + + w1um_snapped + TOP + false + 1 + + + + edge-pair: (5.2,4.2;3.8,4.2)|(3.6,4.6;5.2,5) + + + + + w1um_snapped + TOP + false + 1 + + + + edge-pair: (4.314,4.778;5.2,5)|(5.4,5;5.2,4.2) + + + + + w1um_snapped + TOP + false + 1 + + + + edge-pair: (3.4,4;3.6,4.6)|(4,4;3.4,4) + + + + + w1um_snapped + TOP + false + 1 + + + + edge-pair: (3.4,4;3.55,4.45)|(3.8,4.2;4,4) + + + + + w1um_snapped + TOP + false + 1 + + + + edge-pair: (3.467,4.2;3.6,4.6)|(4.521,4.2;3.8,4.2) + + + + + w1um_snapped + TOP + false + 1 + + + + edge-pair: (3,3;2.2,3)|(2.2,3.6;3,3.6) + + + + + w1um_snapped + TOP + false + 1 + + + + edge-pair: (2.2,3;2.2,3.6)|(3,3.6;3,3) + + + + + w1um_snapped + A:r0;r0(-0.1,0) + false + 1 + + + + edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0) + + + + + w1um_snapped + A:r90 + false + 1 + + + + edge-pair: (0,0;0,1.8)|(0.2,1.8;0.2,0) + + + + + w1um_snapped + A:r0;r0 + false + 1 + + + + edge-pair: (0,0;0,1.6)|(0.4,1.6;0.4,0) + + + + diff --git a/testdata/drc/drcSimpleTests_au111.lyrdb b/testdata/drc/drcSimpleTests_au111.lyrdb new file mode 100644 index 000000000..63a47e6f0 --- /dev/null +++ b/testdata/drc/drcSimpleTests_au111.lyrdb @@ -0,0 +1,382 @@ + + + Report comment with +another line + + drc: script='.drc' + TOP + + + + + input + + + + L1 + Original layer + + + + + L1S + Sized original layer + + + + + + + w1um + w < 1µm +From sized input + + + + + + + TOP + + + + + + + A + r0 + A + + + TOP + r0 *1 0.5,1.2 + + + + + A + r90 + A$VAR1 + + + TOP + r270 *1 2,2 + + + + + + + + input.L1 + TOP + false + 1 + + + + polygon: (3.8,3.9;3.4,4;3.7,4.6;5.2,4.9;5.1,4.2;3.7,4.3) + + + + + input.L1 + TOP + false + 1 + + + + polygon: (2.2,3;2.2,3.6;2.8,3.6;2.8,3) + + + + + input.L1 + A:r0 + false + 1 + + + + polygon: (0,0;0,1.6;0.2,1.6;0.2,0) + + + + + input.L1 + A:r90 + false + 1 + + + + polygon: (0,0;0,1.6;0.2,1.6;0.2,0) + + + + + input.L1S + TOP + false + 1 + + + + polygon: (3.7,3.9;3.3,4;3.6,4.6;5.1,4.9;5.3,4.9;5.2,4.2;5,4.2;3.804,4.285;3.9,3.9) + + + + + input.L1S + TOP + false + 1 + + + + polygon: (2.1,3;2.1,3.6;2.9,3.6;2.9,3) + + + + + input.L1S + A:r0 + false + 1 + + + + polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0) + + + + + input.L1S + A:r90 + false + 1 + + + + polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (3.7,3.9;3.3,4)|(3.804,4.285;3.9,3.9) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2) + + + + + w1um + TOP + false + 1 + + + + edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9) + + + + + w1um + A:r0 + false + 1 + + + + edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0) + + + + + w1um + A:r90 + false + 1 + + + + edge-pair: (0,-0.1;0,1.7)|(0.2,1.7;0.2,-0.1) + + + +