From 4abc38a5cc21965c876673231ad3ee8009afc840 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 10 Feb 2019 08:28:48 +0100 Subject: [PATCH] Test for deep/flat collaboration --- src/db/unit_tests/dbDeepRegionTests.cc | 38 +++++++++++++++++++++++++ testdata/algo/deep_region_au101.gds | Bin 0 -> 7788 bytes 2 files changed, 38 insertions(+) create mode 100644 testdata/algo/deep_region_au101.gds diff --git a/src/db/unit_tests/dbDeepRegionTests.cc b/src/db/unit_tests/dbDeepRegionTests.cc index 8c7ddfb35..a3af73f5f 100644 --- a/src/db/unit_tests/dbDeepRegionTests.cc +++ b/src/db/unit_tests/dbDeepRegionTests.cc @@ -734,3 +734,41 @@ TEST(100_Integration) CHECKPOINT(); db::compare_layouts (_this, target, tl::testsrc () + "/testdata/algo/deep_region_au100.gds"); } + +TEST(101_DeepFlatCollaboration) +{ + db::Layout ly; + { + std::string fn (tl::testsrc ()); + fn += "/testdata/algo/deep_region_l1.gds"; + tl::InputStream stream (fn); + db::Reader reader (stream); + reader.read (ly); + } + + db::cell_index_type top_cell_index = *ly.begin_top_down (); + db::Cell &top_cell = ly.cell (top_cell_index); + + db::DeepShapeStore dss; + + unsigned int l2 = ly.get_layer (db::LayerProperties (2, 0)); + unsigned int l3 = ly.get_layer (db::LayerProperties (3, 0)); + + db::Region r2 (db::RecursiveShapeIterator (ly, top_cell, l2), dss); + db::Region r2_flat (db::RecursiveShapeIterator (ly, top_cell, l2)); + db::Region r3 (db::RecursiveShapeIterator (ly, top_cell, l3), dss); + db::Region r3_flat (db::RecursiveShapeIterator (ly, top_cell, l3)); + + db::Region r2fminus3 = r2_flat - r3; + db::Region r2minus3f = r2 - r3_flat; + + db::Layout target; + unsigned int target_top_cell_index = target.add_cell (ly.cell_name (top_cell_index)); + + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (10, 0)), r2fminus3); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (11, 0)), r2minus3f); + + CHECKPOINT(); + db::compare_layouts (_this, target, tl::testsrc () + "/testdata/algo/deep_region_au101.gds"); +} + diff --git a/testdata/algo/deep_region_au101.gds b/testdata/algo/deep_region_au101.gds new file mode 100644 index 0000000000000000000000000000000000000000..ea6abc9341f57cb25b4938a18f0fe313b73cdd68 GIT binary patch literal 7788 zcmbuDO-R*w6o!9Y?WSg7nKqb$5LQ$oeIupOB#Bn`p@bMl5VQzd1?^e|K?_&yiXdna z1g!>Q7-%)%Mp_ND30J}_0wHKu=*_3YOP;_(ofenp^8U|r@ABpSmujh0CQIkK%7%qf zDNUuJ>?qq;e=iM{>ba3WOW9Vpe(==8V`pbyeC!|kyYJbPsfp6Ler>O*TD?3nHhiI! z`i4@foA~wW=1M7Le@k7h_T~RtZMg@QvhIDYw)9C<4om%(HT>m8yIWqwTlut#$|Jv& z%BFA6S7=^+hp0UEt4Hmwdeppz)1va&Zyd0@#sTv--Vl|?e)F{5HBXzj`Ie|W_FEp< zUCRUWwmuS-$A0UK-L=k`*Y=mFJoejP*0pEd9J zf1>i(Kk?S?PP{d5@RO)K_D?R_-N{AsPJI@Y$No^e-3_&ycV?%kJobmX>~6TryphwQ z^4K38u)EO#^UjTm%42`*rrnL*H1FaaQF-iNx@~utZksp$NK_vC6Ek)3-q)4!tf$ftL?gLw3>s66uNUG5+r{VOVue0rBVh)4g5 z$|IlN0Rz1 z9{npSk9>NUJBUaBipnFO-sKMB(Z8bd$ftL?gLw3>s66uNUG5+r{VOVue0rBVh)4g5 z$|IlN-@z2b$(+1IzO?0ouAmh&QI)L=O^~B^Ar2m z`HB7O{KWoseq#SRKe2zEpV+_7PwZdkC-$%N6Z_ZsiT&&R#Qt@DV*jr4Q~THX>|X6$ zdjBW(?-@z2b$(+1IzO?0ouAmh&QI)L=O^~B z^Ar2m`HB7O{KWoseq#SRKe2zEpV+_7PwZdkC-$%N6Z_ZsiT&&R#Qt@DV*ffnv45SP V*uTzC>|f{q%KqK3@_M(vd<9zkZ({%e literal 0 HcmV?d00001