diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index 6f5e2ddd6..e8bbcef71 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -1827,3 +1827,45 @@ TEST(112_Waiving) compare_text_files (report, au_report); } + +TEST(120_ShapesOfPin) +{ + std::string rs = tl::testdata (); + rs += "/drc/drcSimpleTests_120.drc"; + + // apart from that it's a variant of 14b ... + + std::string input = tl::testdata (); + input += "/drc/drcSimpleTests_120.gds"; + + std::string au = tl::testdata (); + au += "/drc/drcSimpleTests_au120.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_120.drc b/testdata/drc/drcSimpleTests_120.drc new file mode 100644 index 000000000..34bc398a1 --- /dev/null +++ b/testdata/drc/drcSimpleTests_120.drc @@ -0,0 +1,52 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) +l2 = input(2, 0) +l3 = input(3, 0) + +name(l1, "l1") +name(l2, "l2") +name(l3, "l3") + +connect(l1, l2) +connect(l2, l3) + +netlist + +l1_out = polygons +l2_out = polygons +l3_out = polygons + +output_layers = { + "l1" => l1_out, + "l2" => l2_out, + "l3" => l3_out +} + +[ "A", "B", "C" ].each do |n| + + net = l2n_data.netlist.circuit_by_name("TOP").net_by_name(n) + if net + + net.each_subcircuit_pin do |pin| + shapes = l2n_data.shapes_of_pin(pin) + shapes.keys.each do |li| + output_layers[l2n_data.layer_name(li)].data.insert(shapes[li]) + end + end + + end + +end + +l1.output(1, 0) +l2.output(2, 0) +l3.output(3, 0) +l1_out.output(101, 0) +l2_out.output(102, 0) +l3_out.output(103, 0) + diff --git a/testdata/drc/drcSimpleTests_120.gds b/testdata/drc/drcSimpleTests_120.gds new file mode 100644 index 000000000..93675cdcd Binary files /dev/null and b/testdata/drc/drcSimpleTests_120.gds differ diff --git a/testdata/drc/drcSimpleTests_au120.gds b/testdata/drc/drcSimpleTests_au120.gds new file mode 100644 index 000000000..2b853f6a5 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au120.gds differ