diff --git a/src/db/db/dbDeepShapeStore.cc b/src/db/db/dbDeepShapeStore.cc index 93c74ffba..bc9dc11d2 100644 --- a/src/db/db/dbDeepShapeStore.cc +++ b/src/db/db/dbDeepShapeStore.cc @@ -867,7 +867,9 @@ void DeepShapeStore::remove_ref (unsigned int layout, unsigned int layer) unsigned int DeepShapeStore::layout_for_iter (const db::RecursiveShapeIterator &si, const db::ICplxTrans &trans) { - layout_map_type::iterator l = m_layout_map.find (std::make_pair (si, trans)); + size_t gen_id = si.layout () ? si.layout ()->hier_generation_id () : 0; + + layout_map_type::iterator l = m_layout_map.find (std::make_pair (si, std::make_pair (gen_id, trans))); if (l == m_layout_map.end () || m_layouts[l->second] == 0) { unsigned int layout_index; @@ -886,7 +888,7 @@ DeepShapeStore::layout_for_iter (const db::RecursiveShapeIterator &si, const db: layout.dbu (si.layout ()->dbu () / trans.mag ()); } - m_layout_map[std::make_pair (si, trans)] = layout_index; + m_layout_map[std::make_pair (si, std::make_pair (gen_id, trans))] = layout_index; return layout_index; } else { @@ -896,7 +898,8 @@ DeepShapeStore::layout_for_iter (const db::RecursiveShapeIterator &si, const db: void DeepShapeStore::make_layout (unsigned int layout_index, const db::RecursiveShapeIterator &si, const db::ICplxTrans &trans) { - tl_assert (m_layout_map.find (std::make_pair (si, trans)) == m_layout_map.end ()); + size_t gen_id = si.layout () ? si.layout ()->hier_generation_id () : 0; + tl_assert (m_layout_map.find (std::make_pair (si, std::make_pair (gen_id, trans))) == m_layout_map.end ()); while (m_layouts.size () <= layout_index) { m_layouts.push_back (0); @@ -909,7 +912,7 @@ void DeepShapeStore::make_layout (unsigned int layout_index, const db::Recursive layout.dbu (si.layout ()->dbu () / trans.mag ()); } - m_layout_map[std::make_pair (si, trans)] = layout_index; + m_layout_map[std::make_pair (si, std::make_pair (gen_id, trans))] = layout_index; } DeepLayer DeepShapeStore::create_polygon_layer (const db::RecursiveShapeIterator &si, double max_area_ratio, size_t max_vertex_count, const db::ICplxTrans &trans) diff --git a/src/db/db/dbDeepShapeStore.h b/src/db/db/dbDeepShapeStore.h index be6e838c0..1f12063b5 100644 --- a/src/db/db/dbDeepShapeStore.h +++ b/src/db/db/dbDeepShapeStore.h @@ -298,7 +298,7 @@ private: struct DB_PUBLIC RecursiveShapeIteratorCompareForTargetHierarchy { - bool operator () (const std::pair &a, const std::pair &b) const + bool operator () (const std::pair > &a, const std::pair > &b) const { int cmp_iter = db::compare_iterators_with_respect_to_target_hierarchy (a.first, b.first); if (cmp_iter != 0) { @@ -865,7 +865,7 @@ private: void issue_variants (unsigned int layout, const std::map > &var_map); - typedef std::map, unsigned int, RecursiveShapeIteratorCompareForTargetHierarchy> layout_map_type; + typedef std::map >, unsigned int, RecursiveShapeIteratorCompareForTargetHierarchy> layout_map_type; // no copying DeepShapeStore (const DeepShapeStore &); diff --git a/src/drc/drc/built-in-macros/_drc_layer.rb b/src/drc/drc/built-in-macros/_drc_layer.rb index dd6297364..e434c9d1d 100644 --- a/src/drc/drc/built-in-macros/_drc_layer.rb +++ b/src/drc/drc/built-in-macros/_drc_layer.rb @@ -5148,9 +5148,6 @@ CODE m = with_left ? "fill_with_left" : "fill" - # generation of new cells not tested in deep mode - @deep && raise("#{m} command not supported in deep mode currently") - (@engine._output_layout && @engine._output_cell) || raise("#{m} command needs an output layout and output cell") source = @engine.source diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index 107aa58de..8b24c918d 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -1302,6 +1302,16 @@ TEST(47_fillWithOverlappingBoxesTiled) run_test (_this, "47", false); } +TEST(47b_fillWithUsingOutput) +{ + run_test (_this, "47b", false); +} + +TEST(47bd_fillWithUsingOutputDeep) +{ + run_test (_this, "47b", true); +} + TEST(48_drcWithFragments) { run_test (_this, "48", false); diff --git a/testdata/drc/drcSimpleTests_47b.drc b/testdata/drc/drcSimpleTests_47b.drc new file mode 100644 index 000000000..b20d4c81b --- /dev/null +++ b/testdata/drc/drcSimpleTests_47b.drc @@ -0,0 +1,23 @@ + +source $drc_test_source + +if $drc_test_deep + deep +end + +to_fill = input(1, 0) + +# Create a fill pattern with a 0.025x0.025 µm box at 2/0 +pattern = fill_pattern("FILL_CELL").shape(2, 0, box(0, 0, 0.025, 0.025)) + +# place every 25 nm +to_fill.fill(pattern, hstep(0.025), vstep(0.025)) + +# compute remaining parts +l2 = input(2, 0) +(to_fill - l2).output(100, 0) + +# we cannot use input(..) on the fill output if we use +# a separate target layout, so wo do this: +layout.layout.write($drc_test_target) + diff --git a/testdata/drc/drcSimpleTests_47b.gds b/testdata/drc/drcSimpleTests_47b.gds new file mode 100644 index 000000000..89ba5d7df Binary files /dev/null and b/testdata/drc/drcSimpleTests_47b.gds differ diff --git a/testdata/drc/drcSimpleTests_au47b.gds b/testdata/drc/drcSimpleTests_au47b.gds new file mode 100644 index 000000000..d4dff937b Binary files /dev/null and b/testdata/drc/drcSimpleTests_au47b.gds differ diff --git a/testdata/drc/drcSimpleTests_au47bd.gds b/testdata/drc/drcSimpleTests_au47bd.gds new file mode 100644 index 000000000..ba8325cc3 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au47bd.gds differ