From ca388150bb84aaef5b73bcc74d2ceec8c0336fe4 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 6 Dec 2020 19:03:44 +0100 Subject: [PATCH] Added tests for opposite and rect filter. --- src/drc/unit_tests/drcSimpleTests.cc | 80 +++++++++++++++++++++++++++ testdata/drc/drcSimpleTests_19.drc | 10 ++++ testdata/drc/drcSimpleTests_22.drc | 25 +++++++++ testdata/drc/drcSimpleTests_22.gds | Bin 0 -> 458 bytes testdata/drc/drcSimpleTests_23.drc | 35 ++++++++++++ testdata/drc/drcSimpleTests_23.gds | Bin 0 -> 618 bytes testdata/drc/drcSimpleTests_au19.gds | Bin 1610 -> 2762 bytes testdata/drc/drcSimpleTests_au22.gds | Bin 0 -> 1738 bytes testdata/drc/drcSimpleTests_au23.gds | Bin 0 -> 6890 bytes 9 files changed, 150 insertions(+) create mode 100644 testdata/drc/drcSimpleTests_22.drc create mode 100644 testdata/drc/drcSimpleTests_22.gds create mode 100644 testdata/drc/drcSimpleTests_23.drc create mode 100644 testdata/drc/drcSimpleTests_23.gds create mode 100644 testdata/drc/drcSimpleTests_au22.gds create mode 100644 testdata/drc/drcSimpleTests_au23.gds diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index 3cba9b295..113c9b43a 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -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); +} + diff --git a/testdata/drc/drcSimpleTests_19.drc b/testdata/drc/drcSimpleTests_19.drc index 60d92f511..e92ef5d58 100644 --- a/testdata/drc/drcSimpleTests_19.drc +++ b/testdata/drc/drcSimpleTests_19.drc @@ -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) + diff --git a/testdata/drc/drcSimpleTests_22.drc b/testdata/drc/drcSimpleTests_22.drc new file mode 100644 index 000000000..87398645c --- /dev/null +++ b/testdata/drc/drcSimpleTests_22.drc @@ -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) + diff --git a/testdata/drc/drcSimpleTests_22.gds b/testdata/drc/drcSimpleTests_22.gds new file mode 100644 index 0000000000000000000000000000000000000000..59cf4283e963438eb9c650dace92dbb910c91af1 GIT binary patch literal 458 zcmZQzV_;&6V31*CVt>NG!@$NM#Gu3=ip*x^+>@@d2w)}&o%MSeo zv!g;7WLWX&V`B^P4`5(m;b353<7HxCWMJcCVqjqK5nyIu5HA3-fB;0R3otM!njmP9 zn9duB9Eb+Vn{7bQFnvIpMG#>=6V!Yikoh3M`~pIA?_gjMoWj5WqhaDe8n1ro2#9`V z4Tydi4HE~_IQ84~K->?aLGJfcK+qunLFMu42iXo%$G-rgA4bE(fize@JCJ5!008Ah BET#Ye literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_23.drc b/testdata/drc/drcSimpleTests_23.drc new file mode 100644 index 000000000..a55e9771e --- /dev/null +++ b/testdata/drc/drcSimpleTests_23.drc @@ -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) + diff --git a/testdata/drc/drcSimpleTests_23.gds b/testdata/drc/drcSimpleTests_23.gds new file mode 100644 index 0000000000000000000000000000000000000000..1d93b53683d25dfba9fa3d79222188fc8172c678 GIT binary patch literal 618 zcmaKoJq|%Z6orrR%#-*DA)$~cG$KMrG=eAy357ze!ZKKcMyFL;f!Y!j7NAflB;4bf z%xlIZFW=<6`R?4g&`@fLQbhSTB%zT5kPGh-S9&@g0QqRF+uyb)=fk}-JT>>b)dHp1 zA5ZJWYz}yFK&KQU&}k*r>zOE!ILS^H>0ji^jit$jUe@7Psyqdd^lMK`lM9`GVf}tT zMgaLL0_C2i$%TLXp!dQ$=)K&tt353_zu*6_?@JvIAL{T`)c^nh literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_au19.gds b/testdata/drc/drcSimpleTests_au19.gds index 9365b72459a989fdee15dee47df5b9a4a93e4b2d..17f23c5243563bd942571e4589aca2605e329640 100644 GIT binary patch delta 243 zcmZvUF%E)25JhK)1u53XgoJ_$FJPi}L@6w>up`E^cmZk5Z@h-LUm25j$@)|&eWpfy=r0n_DZ<-+_<&AT3;=sT8JO~&G2Otijg0j QcQ*qnZyL8RNOc?SJ_NNw00000 delta 135 zcmX>ldWuJhfsKKQDS|L}PBjUY%Dg$oOWHlYL(6m24@7DCdxb=G49xvE_oTeY-Z_5#tm zULmNUMQ>2&G#>7`#=Ts1Howamzd7HT`4ASyv`|c#^c$vNF^3u!^*1ucHg>mxc`voO zby3@Uy8GVP>92Kfj+-c^B6QX^4-SE32C&lx3D_9}ppo-{g){o1#VqH5<#nH2t9-dV zChu48eTt5l%=_n?!TA+FpO^RHnC%1kYd|PBlU(x*Ub^J-_zP@6GSXIT(6J?LVL&BR|i&|D<~Telhd+ufOC(awC-bP<{e>zAwqCx3{moee+~p=B69CJYRqKNTfR>lAq0_Bl)>ZpMLfH zl*sJ1e$vad*cIu$s@3bN-3tl6T(G-DOpULOYxTNnlJAek<6n10OiwO}3|4FPx@rR- z_TC?by$@DvwVtf58uMA)zwOa4+kgDyb=4$q&$r9eSX#9k9>6_gpVrty=ceQ$5 zHOZF?!9P>;uR5;P{QLX+n134gKUh)zj_zCa&@$1-?si>C9GR6x_W)0$@QzF za9?#4xTWu|UT@}$op4{V6S&#;u3m5E&39u>jWz#Wy{;PX|5?lYfhY0@p2#0~B7fkC z{DCL(2cF1(80Say4?NL7@I?Q>6Z1QY`?vl3d+I;mU%(Ud3q0XJ@Pz-s6aE8F_`ebR zPn=)i3IBj6`~#lw4|wAI0#Eq=JocZMf8dGv2cF0uc)~y63IATS^bdH#Ki~=ffG5rm z@WlB6o;W|i6Zr#A