From 294f1701b5d37334a8c119e1246fd441a202bbf4 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 7 Jan 2019 23:57:52 +0100 Subject: [PATCH] Added a test for joining of layers through multiple global net assignment. --- .../unit_tests/dbHierNetworkProcessorTests.cc | 46 +++++++++++++++++- testdata/algo/hc_test_au17.gds | Bin 0 -> 3174 bytes testdata/algo/hc_test_au17b.gds | Bin 0 -> 2872 bytes testdata/algo/hc_test_l17.gds | Bin 0 -> 1272 bytes 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 testdata/algo/hc_test_au17.gds create mode 100644 testdata/algo/hc_test_au17b.gds create mode 100644 testdata/algo/hc_test_l17.gds diff --git a/src/db/unit_tests/dbHierNetworkProcessorTests.cc b/src/db/unit_tests/dbHierNetworkProcessorTests.cc index 8ef049e6f..06798f741 100644 --- a/src/db/unit_tests/dbHierNetworkProcessorTests.cc +++ b/src/db/unit_tests/dbHierNetworkProcessorTests.cc @@ -877,7 +877,7 @@ static void copy_cluster_shapes (const std::string *&attrs, db::Shapes &out, db: static void run_hc_test (tl::TestBase *_this, const std::string &file, const std::string &au_file) { db::Layout ly; - unsigned int l1 = 0, l2 = 0, l3 = 0, l4 = 0; + unsigned int l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0; { db::LayerProperties p; @@ -903,6 +903,16 @@ static void run_hc_test (tl::TestBase *_this, const std::string &file, const std lmap.map (db::LDPair (p.layer, p.datatype), l4 = ly.insert_layer ()); ly.set_properties (l4, p); + p.layer = 5; + p.datatype = 0; + lmap.map (db::LDPair (p.layer, p.datatype), l5 = ly.insert_layer ()); + ly.set_properties (l5, p); + + p.layer = 6; + p.datatype = 0; + lmap.map (db::LDPair (p.layer, p.datatype), l6 = ly.insert_layer ()); + ly.set_properties (l6, p); + db::LoadLayoutOptions options; options.get_options ().layer_map = lmap; options.get_options ().create_other_layers = false; @@ -920,6 +930,8 @@ static void run_hc_test (tl::TestBase *_this, const std::string &file, const std normalize_layer (ly, strings, l2); normalize_layer (ly, strings, l3); normalize_layer (ly, strings, l4); + normalize_layer (ly, strings, l5); + normalize_layer (ly, strings, l6); // connect 1 to 1, 1 to 2 and 1 to 3, but *not* 2 to 3 db::Connectivity conn; @@ -929,8 +941,13 @@ static void run_hc_test (tl::TestBase *_this, const std::string &file, const std conn.connect (l1, l2); conn.connect (l1, l3); conn.connect (l1, l4); + conn.connect (l1, l5); + conn.connect (l1, l6); conn.connect_global (l4, "BULK"); + conn.connect_global (l5, "BULK2"); + conn.connect_global (l6, "BULK"); + conn.connect_global (l6, "BULK2"); db::hier_clusters hc; hc.build (ly, ly.cell (*ly.begin_top_down ()), db::ShapeIterator::Polygons, conn); @@ -993,7 +1010,7 @@ static void run_hc_test (tl::TestBase *_this, const std::string &file, const std static void run_hc_test_with_backannotation (tl::TestBase *_this, const std::string &file, const std::string &au_file) { db::Layout ly; - unsigned int l1 = 0, l2 = 0, l3 = 0, l4 = 0; + unsigned int l1 = 0, l2 = 0, l3 = 0, l4 = 0, l5 = 0, l6 = 0; { db::LayerProperties p; @@ -1019,6 +1036,16 @@ static void run_hc_test_with_backannotation (tl::TestBase *_this, const std::str lmap.map (db::LDPair (p.layer, p.datatype), l4 = ly.insert_layer ()); ly.set_properties (l4, p); + p.layer = 5; + p.datatype = 0; + lmap.map (db::LDPair (p.layer, p.datatype), l5 = ly.insert_layer ()); + ly.set_properties (l5, p); + + p.layer = 6; + p.datatype = 0; + lmap.map (db::LDPair (p.layer, p.datatype), l6 = ly.insert_layer ()); + ly.set_properties (l6, p); + db::LoadLayoutOptions options; options.get_options ().layer_map = lmap; options.get_options ().create_other_layers = false; @@ -1036,6 +1063,8 @@ static void run_hc_test_with_backannotation (tl::TestBase *_this, const std::str normalize_layer (ly, strings, l2); normalize_layer (ly, strings, l3); normalize_layer (ly, strings, l4); + normalize_layer (ly, strings, l5); + normalize_layer (ly, strings, l6); // connect 1 to 1, 1 to 2 and 1 to 3, but *not* 2 to 3 db::Connectivity conn; @@ -1045,8 +1074,13 @@ static void run_hc_test_with_backannotation (tl::TestBase *_this, const std::str conn.connect (l1, l2); conn.connect (l1, l3); conn.connect (l1, l4); + conn.connect (l1, l5); + conn.connect (l1, l6); conn.connect_global (l4, "BULK"); + conn.connect_global (l5, "BULK2"); + conn.connect_global (l6, "BULK"); + conn.connect_global (l6, "BULK2"); db::hier_clusters hc; hc.build (ly, ly.cell (*ly.begin_top_down ()), db::ShapeIterator::Polygons, conn); @@ -1056,6 +1090,8 @@ static void run_hc_test_with_backannotation (tl::TestBase *_this, const std::str lm[l2] = ly.insert_layer (db::LayerProperties (102, 0)); lm[l3] = ly.insert_layer (db::LayerProperties (103, 0)); lm[l4] = ly.insert_layer (db::LayerProperties (104, 0)); + lm[l5] = ly.insert_layer (db::LayerProperties (105, 0)); + lm[l6] = ly.insert_layer (db::LayerProperties (106, 0)); hc.return_to_hierarchy (ly, lm); CHECKPOINT(); @@ -1158,3 +1194,9 @@ TEST(116_HierClusters) run_hc_test_with_backannotation (_this, "hc_test_l16.gds", "hc_test_au16b.gds"); } +TEST(117_HierClusters) +{ + run_hc_test (_this, "hc_test_l17.gds", "hc_test_au17.gds"); + run_hc_test_with_backannotation (_this, "hc_test_l17.gds", "hc_test_au17b.gds"); +} + diff --git a/testdata/algo/hc_test_au17.gds b/testdata/algo/hc_test_au17.gds new file mode 100644 index 0000000000000000000000000000000000000000..d4ae2eb93aa8c5587c7e0c089d3ab8395741cdd6 GIT binary patch literal 3174 zcma);J7^S96o&tu*`1we5|a2V782tt;HsDejUpydiSdONLBuMEh=_%Vg@r{58ym5( z2$~|DA{G`F79tiwEG&Xph@=n&QLzvbHO3{^|IF;kopGIb7dBt`Z_dd*&lv>pypt&9 zyy6GsP{b~!Isyq`{Rmj}U81w6yQgvaLJx~mJzD@|R`dB)oR6Szy|NHj-#{AeVxfja4qg+?1dQ_WC z`?Q47$@!xIJiTo07n--~8eUs0=ehf4W#(j`J*?gQ` zlbTTfi|r7geInj2?VQZ80&L)<#Z*0F%`G`l+;(YS>r0$=euOe@+aFr0PCEHoGs>yG z00;`tyuTpig#+O4Sx)v(Y8COE$)QwiHMD--c-P1as zoK@tLmGBv9TMK7{Tzj84JZq^snV5AHlJ*`;B0E)>?_ruRS*or#bBL^avB>^o9|pnD zF*crdX}8VIo?WRf?UEDj)z|E@o>Xi>Dz52A^Lu>Ayc-)G55jdaq<7dp73&NK1k7EWGa z+){PY$yf6e?!6n#J=xL8+*d4BC!KtOZxHhKh$+T%k@p%sX7L@X>UQrOst zg+)+{bc$G5SfmiK2x4I&Vj+@36vQHhkf<>(8P9+3{?3egP27de7tZC}nfYHk2oVIw zP)Y^44@e=0Rp>;){U7-t9N51bXh>&w_Fmh5@Y&tZU3s@46fE<|P-{_Zz-jG3=B#@qqYYk+KnQgvan|H~y~rc1^M z%U6tq{}TA}Ksdw$1n z%uK&Ab5labZpN7JPnD_*ll(v~&*$re0JD#!gG$vSy6dOy{*C#%Lt-zKeMhmbQ1vJ` ziT;@fk}vL`%#TX^Emdb;6a38gB;#F-`Qs5#TQWweI_dgPyZf)A{ycvb^>@auUse7+ ze--&VYuB$Tf1dw;@|VMcQ=$!-C7crVGB0Y2Y1ZR7P}d*l&wsM%2(#^XmXjHvc_N+) z&FrXr8Q8!MiK+S@mFfA{m)M#72&FT&J+xGvbSultOw%a4>O3GUTmm+-N|maUuHT6) z(B8^Uz7aFu0d()UNwh1$xO!q}g)pci!I9bQPPPTwQABKa6Sx8!S9X2*QyW?Y9j6%g)YzE<&lO4Uhs zec#WRHC?BlY-yvvY^ge#=r0b*{R0r@M}d|1ELA66|B%-|=UG1om@~5ZJ!8>rsXFQU m&$)i^J|K5NOtN+^F#df?)&H3K!>(WYR{M0J{^e}RWbhLyZ!?+z literal 0 HcmV?d00001 diff --git a/testdata/algo/hc_test_l17.gds b/testdata/algo/hc_test_l17.gds new file mode 100644 index 0000000000000000000000000000000000000000..4ddd3a2a7e0cdcdcfb602c721d15571a295a20cf GIT binary patch literal 1272 zcma))F>4f26ot>enSDFajjSPHGhjf=m0+@93=)Z2L=41Y3rUqi`~hN_BCY=*V2X4R zv9w5O5kd+}3kwTD5DN=oH!&t5H|Orm_052jY%zSpd7Ss|J@>-Hxo1dguJIi;G;j@V zbc+8-oL_wW02q(zbMvq7JlWm)efQD!EqmFm`D-J-r6^WdD zvk$1Xi=XLA#8>fuzifz{HbrCuh$evgxY2ZFwSWJWNG}ypo~()-9tN7;ORN2VKGDA> zqTK%ijI0Ej-dijAUFe^+{$vu*GscVb@37IFrjy0~3x1LQg2>S?C9~^`{QYP&U0LM^ z8VS#DDgjO(m%B#O2Q0oHh5AJf?rHW)t$UDlPSXdosr2{X>%3S$nXGI6fu?h=6@Je9 zEAwt;JpKSQQxT)-_!75tO!u|fikQbXFuIWW%O|&<^0j=jL)_f?ck@(s zGv}_8AGWgT^Za>b`OP)X@cL;fvpCF*d9MQ#V;OI}W8NQZ^Lo+mxGTDw%6Nux zy$m#c$j%b)yGsnxQtyOp=4MN&PwNTy>ofOhrc|3R)%F&+&wd;^|ATw67ic