Added tests for shapes_of_pin

This commit is contained in:
Matthias Koefferlein 2024-06-06 20:20:35 +02:00
parent c44b8097dd
commit 3e4775aabb
4 changed files with 94 additions and 0 deletions

View File

@ -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);
}

52
testdata/drc/drcSimpleTests_120.drc vendored Normal file
View File

@ -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)

BIN
testdata/drc/drcSimpleTests_120.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au120.gds vendored Normal file

Binary file not shown.