diff --git a/src/db/db/dbHierarchyBuilder.cc b/src/db/db/dbHierarchyBuilder.cc index 8af07fc32..41ca8685f 100644 --- a/src/db/db/dbHierarchyBuilder.cc +++ b/src/db/db/dbHierarchyBuilder.cc @@ -396,13 +396,52 @@ HierarchyBuilder::new_inst (const RecursiveShapeIterator *iter, const db::CellIn // for new cells, create this instance if (m_cell_stack.back ().first || m_cm_new_entry) { - db::CellInstArray new_inst (inst, &mp_target->array_repository ()); - new_inst.object () = db::CellInst (new_cell); - new_inst.transform (always_apply); - new_inst.transform_into (m_trans); - for (std::vector::const_iterator c = m_cell_stack.back ().second.begin (); c != m_cell_stack.back ().second.end (); ++c) { - (*c)->insert (new_inst); + + // @@@ + // check if the cell array is "sparse" + bool resolve = false; + if (m_source.layout () && inst.size () > 1) { + db::box_convert bc (*m_source.layout ()); + auto a1 = bc (inst.object ()).area (); + auto aa = inst.bbox (bc).area (); + double area_ratio = 10.0; // @@@ + if (a1 * area_ratio < aa) { + resolve = true; + } } + // @@@ + + if (resolve) { + + // resolve the instances of the array + for (auto i = inst.begin (); !i.at_end (); ++i) { + + db::CellInstArray new_inst; + if (inst.is_complex ()) { + new_inst = db::CellInstArray (db::CellInst (new_cell), inst.complex_trans (*i)); + } else { + new_inst = db::CellInstArray (db::CellInst (new_cell), *i); + } + new_inst.transform (always_apply); + new_inst.transform_into (m_trans); + for (std::vector::const_iterator c = m_cell_stack.back ().second.begin (); c != m_cell_stack.back ().second.end (); ++c) { + (*c)->insert (new_inst); + } + + } + + } else { + + db::CellInstArray new_inst (inst, &mp_target->array_repository ()); + new_inst.object () = db::CellInst (new_cell); + new_inst.transform (always_apply); + new_inst.transform_into (m_trans); + for (std::vector::const_iterator c = m_cell_stack.back ().second.begin (); c != m_cell_stack.back ().second.end (); ++c) { + (*c)->insert (new_inst); + } + + } + } // To see the cell once, use NI_single. If we did see the cell already, skip the whole instance array. diff --git a/src/db/db/gsiDeclDbDeepShapeStore.cc b/src/db/db/gsiDeclDbDeepShapeStore.cc index 07137940e..552b07f2d 100644 --- a/src/db/db/gsiDeclDbDeepShapeStore.cc +++ b/src/db/db/gsiDeclDbDeepShapeStore.cc @@ -259,6 +259,9 @@ Class decl_dbDeepShapeStore ("db", "DeepShapeStore", "\n" "This method has been added in version 0.26.1\n" ) + + gsi::method ("layout", static_cast (&db::DeepShapeStore::layout), gsi::arg ("index"), + "@hide" + ) + gsi::method ("push_state", &db::DeepShapeStore::push_state, "@brief Pushes the store's state on the state state\n" "This will save the stores state (\\threads, \\max_vertex_count, \\max_area_ratio, breakout cells ...) on "