Added tests for opposite and rect filter.

This commit is contained in:
Matthias Koefferlein 2020-12-06 19:03:44 +01:00
parent a833dd57fe
commit ca388150bb
9 changed files with 150 additions and 0 deletions

View File

@ -957,3 +957,83 @@ TEST(21_breaking)
db::compare_layouts (_this, layout, au, db::NoNormalization);
}
TEST(22_opposite_filter)
{
std::string rs = tl::testsrc ();
rs += "/testdata/drc/drcSimpleTests_22.drc";
std::string input = tl::testsrc ();
input += "/testdata/drc/drcSimpleTests_22.gds";
std::string au = tl::testsrc ();
au += "/testdata/drc/drcSimpleTests_au22.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);
}
TEST(23_rect_filter)
{
std::string rs = tl::testsrc ();
rs += "/testdata/drc/drcSimpleTests_23.drc";
std::string input = tl::testsrc ();
input += "/testdata/drc/drcSimpleTests_23.gds";
std::string au = tl::testsrc ();
au += "/testdata/drc/drcSimpleTests_au23.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);
}

View File

@ -14,3 +14,13 @@ l1.space(3.0, shielded, projection).output(101, 0)
l2.separation(l1, 3.0, transparent, projection).output(110, 0)
l2.separation(l1, 3.0, shielded, projection).output(111, 0)
deep
l1 = input(1, 0)
l2 = input(2, 0)
l1.space(3.0, transparent, projection).output(200, 0)
l1.space(3.0, shielded, projection).output(201, 0)
l2.separation(l1, 3.0, transparent, projection).output(210, 0)
l2.separation(l1, 3.0, shielded, projection).output(211, 0)

25
testdata/drc/drcSimpleTests_22.drc vendored Normal file
View File

@ -0,0 +1,25 @@
# shielded/transparent
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.separation(l2, 3.0, projection).output(100, 0)
l1.separation(l2, 3.0, not_opposite, projection).output(110, 0)
l1.separation(l2, 3.0, only_opposite, projection).output(111, 0)
deep
l1 = input(1, 0)
l2 = input(2, 0)
l1.separation(l2, 3.0, projection).output(200, 0)
l1.separation(l2, 3.0, not_opposite, projection).output(210, 0)
l1.separation(l2, 3.0, only_opposite, projection).output(211, 0)

BIN
testdata/drc/drcSimpleTests_22.gds vendored Normal file

Binary file not shown.

35
testdata/drc/drcSimpleTests_23.drc vendored Normal file
View File

@ -0,0 +1,35 @@
# shielded/transparent
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.separation(l2, 3.0, projection).output(100, 0)
l1.separation(l2, 3.0, one_side_allowed, projection).output(110, 0)
l1.separation(l2, 3.0, two_sides_allowed, projection).output(111, 0)
l1.separation(l2, 3.0, two_opposite_sides_allowed, projection).output(112, 0)
l1.separation(l2, 3.0, two_connected_sides_allowed, projection).output(113, 0)
l1.separation(l2, 3.0, three_sides_allowed, projection).output(114, 0)
l1.separation(l2, 3.0, four_sides_allowed, projection).output(115, 0)
l1.separation(l2, 3.0, one_side_allowed, two_opposite_sides_allowed, projection).output(116, 0)
deep
l1 = input(1, 0)
l2 = input(2, 0)
l1.separation(l2, 3.0, projection).output(200, 0)
l1.separation(l2, 3.0, one_side_allowed, projection).output(210, 0)
l1.separation(l2, 3.0, two_sides_allowed, projection).output(211, 0)
l1.separation(l2, 3.0, two_opposite_sides_allowed, projection).output(212, 0)
l1.separation(l2, 3.0, two_connected_sides_allowed, projection).output(213, 0)
l1.separation(l2, 3.0, three_sides_allowed, projection).output(214, 0)
l1.separation(l2, 3.0, four_sides_allowed, projection).output(215, 0)
l1.separation(l2, 3.0, one_side_allowed, two_opposite_sides_allowed, projection).output(216, 0)

BIN
testdata/drc/drcSimpleTests_23.gds vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au22.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au23.gds vendored Normal file

Binary file not shown.