From 795aeba322fbe087bb9b650c06bd998ac52a7b60 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 17 Nov 2023 00:09:56 +0100 Subject: [PATCH 01/14] WIP --- src/db/db/dbCompoundOperation.cc | 212 +++++----- src/db/db/dbCompoundOperation.h | 471 +++++++++++----------- src/db/db/dbDeepEdges.cc | 10 +- src/db/db/dbDeepRegion.cc | 47 ++- src/db/db/dbDeepTexts.cc | 4 +- src/db/db/dbEdgePairRelations.h | 16 + src/db/db/dbEdgesLocalOperations.cc | 4 +- src/db/db/dbEdgesLocalOperations.h | 4 +- src/db/db/dbHierProcessor.cc | 107 +++-- src/db/db/dbHierProcessor.h | 80 +++- src/db/db/dbLocalOperation.cc | 10 +- src/db/db/dbLocalOperation.h | 5 +- src/db/db/dbRegionLocalOperations.cc | 54 +-- src/db/db/dbRegionLocalOperations.h | 32 +- src/db/unit_tests/dbHierProcessorTests.cc | 8 +- 15 files changed, 592 insertions(+), 472 deletions(-) diff --git a/src/db/db/dbCompoundOperation.cc b/src/db/db/dbCompoundOperation.cc index f63ca361d..a9c232ed0 100644 --- a/src/db/db/dbCompoundOperation.cc +++ b/src/db/db/dbCompoundOperation.cc @@ -106,20 +106,20 @@ static void translate (db::Layout *, const std::vector &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionOperationNode::compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > intermediate; intermediate.push_back (std::unordered_set ()); - implement_compute_local (cache, layout, interactions, intermediate, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, intermediate, proc); translate (layout, intermediate, results); } void -CompoundRegionOperationNode::compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionOperationNode::compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > intermediate; intermediate.push_back (std::unordered_set ()); - implement_compute_local (cache, layout, interactions, intermediate, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, intermediate, proc); translate (layout, intermediate, results); } @@ -142,14 +142,14 @@ std::vector CompoundRegionOperationPrimaryNode::inputs () const return is; } -void CompoundRegionOperationPrimaryNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const +void CompoundRegionOperationPrimaryNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, db::Cell *, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *) const { for (shape_interactions::subject_iterator i = interactions.begin_subjects (); i != interactions.end_subjects (); ++i) { results.front ().insert (i->second); } } -void CompoundRegionOperationPrimaryNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const +void CompoundRegionOperationPrimaryNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, db::Cell *, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *) const { for (shape_interactions::subject_iterator i = interactions.begin_subjects (); i != interactions.end_subjects (); ++i) { results.front ().insert (i->second); @@ -177,14 +177,14 @@ std::vector CompoundRegionOperationSecondaryNode::inputs () const return iv; } -void CompoundRegionOperationSecondaryNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const +void CompoundRegionOperationSecondaryNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, db::Cell *, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *) const { for (shape_interactions::intruder_iterator i = interactions.begin_intruders (); i != interactions.end_intruders (); ++i) { results.front ().insert (i->second.second); } } -void CompoundRegionOperationSecondaryNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const +void CompoundRegionOperationSecondaryNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, db::Cell *, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *) const { for (shape_interactions::intruder_iterator i = interactions.begin_intruders (); i != interactions.end_intruders (); ++i) { results.front ().insert (i->second.second); @@ -211,14 +211,14 @@ std::vector CompoundRegionOperationForeignNode::inputs () const return iv; } -void CompoundRegionOperationForeignNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const +void CompoundRegionOperationForeignNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, db::Cell *, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *) const { for (shape_interactions::intruder_iterator i = interactions.begin_intruders (); i != interactions.end_intruders (); ++i) { results.front ().insert (i->second.second); } } -void CompoundRegionOperationForeignNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t, double) const +void CompoundRegionOperationForeignNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *, db::Cell *, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *) const { for (shape_interactions::intruder_iterator i = interactions.begin_intruders (); i != interactions.end_intruders (); ++i) { results.front ().insert (i->second.second); @@ -446,7 +446,7 @@ std::string CompoundRegionLogicalBoolOperationNode::generated_description () con } template -void CompoundRegionLogicalBoolOperationNode::implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +void CompoundRegionLogicalBoolOperationNode::implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { bool ok = (m_op == And ? true : false); @@ -459,7 +459,7 @@ void CompoundRegionLogicalBoolOperationNode::implement_compute_local (CompoundRe const CompoundRegionOperationNode *node = child (ci); - bool any = node->compute_local_bool (cache, layout, child_interactions, max_vertex_count, area_ratio); + bool any = node->compute_local_bool (cache, layout, cell, child_interactions, proc); if (m_op == And) { if (! any) { @@ -743,13 +743,13 @@ static void copy_results (std::vector > &, const std::vect template void -CompoundRegionGeometricalBoolOperationNode::implement_bool (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionGeometricalBoolOperationNode::implement_bool (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one_a; one_a.push_back (std::unordered_set ()); shape_interactions computed_a; - child (0)->compute_local (cache, layout, interactions_for_child (interactions, 0, computed_a), one_a, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions_for_child (interactions, 0, computed_a), one_a, proc); if (one_a.front ().empty ()) { @@ -763,7 +763,7 @@ CompoundRegionGeometricalBoolOperationNode::implement_bool (CompoundRegionOperat one_b.push_back (std::unordered_set ()); shape_interactions computed_b; - child (1)->compute_local (cache, layout, interactions_for_child (interactions, 1, computed_b), one_b, max_vertex_count, area_ratio); + child (1)->compute_local (cache, layout, cell, interactions_for_child (interactions, 1, computed_b), one_b, proc); copy_results (results, one_b); @@ -775,7 +775,7 @@ CompoundRegionGeometricalBoolOperationNode::implement_bool (CompoundRegionOperat one_b.push_back (std::unordered_set ()); shape_interactions computed_b; - child (1)->compute_local (cache, layout, interactions_for_child (interactions, 1, computed_b), one_b, max_vertex_count, area_ratio); + child (1)->compute_local (cache, layout, cell, interactions_for_child (interactions, 1, computed_b), one_b, proc); if (one_b.front ().empty ()) { @@ -794,44 +794,44 @@ CompoundRegionGeometricalBoolOperationNode::implement_bool (CompoundRegionOperat template void -CompoundRegionGeometricalBoolOperationNode::implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionGeometricalBoolOperationNode::implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { ResultType res_a = child (0)->result_type (); ResultType res_b = child (1)->result_type (); if (res_a == Region && res_b == Region) { - implement_bool (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_bool (cache, layout, cell, interactions, results, proc); } else if (res_a == Region && res_b == Edges) { - implement_bool (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_bool (cache, layout, cell, interactions, results, proc); } else if (res_a == Edges && res_b == Region) { - implement_bool (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_bool (cache, layout, cell, interactions, results, proc); } else if (res_a == Edges && res_b == Edges) { - implement_bool (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_bool (cache, layout, cell, interactions, results, proc); } } void -CompoundRegionGeometricalBoolOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionGeometricalBoolOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionGeometricalBoolOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionGeometricalBoolOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionGeometricalBoolOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionGeometricalBoolOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionGeometricalBoolOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionGeometricalBoolOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } // --------------------------------------------------------------------------------------------- @@ -900,7 +900,7 @@ namespace template template -void compound_region_generic_operation_node::implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +void compound_region_generic_operation_node::implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { generic_result_adaptor adaptor (&results); @@ -917,7 +917,7 @@ void compound_region_generic_operation_node::implement_compute_local shape_interactions self_interactions_heap; const shape_interactions &self_interactions = interactions_for_child (interactions, 0, self_interactions_heap); - self->compute_local (cache, layout, self_interactions, self_result, max_vertex_count, area_ratio); + self->compute_local (cache, layout, cell, self_interactions, self_result, proc); db::generic_shape_iterator is (self_result.front ().begin (), self_result.front ().end ()); @@ -934,7 +934,7 @@ void compound_region_generic_operation_node::implement_compute_local shape_interactions intruder_interactions_heap; const shape_interactions &intruder_interactions = interactions_for_child (interactions, ci, intruder_interactions_heap); - intruder->compute_local (cache, layout, intruder_interactions, intruder_result, max_vertex_count, area_ratio); + intruder->compute_local (cache, layout, cell, intruder_interactions, intruder_result, proc); intruder_results.push_back (std::unordered_set ()); intruder_results.back ().swap (intruder_result.front ()); @@ -943,21 +943,21 @@ void compound_region_generic_operation_node::implement_compute_local } - db::local_processor proc (layout); - proc.run_flat (is, iiv, std::vector (), m_op, adaptor.results ()); + db::local_processor lproc (layout); + lproc.run_flat (is, iiv, std::vector (), m_op, adaptor.results ()); adaptor.finish (layout); } // explicit instantiations -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template DB_PUBLIC void compound_region_generic_operation_node::implement_compute_local (db::CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; // --------------------------------------------------------------------------------------------- @@ -990,7 +990,7 @@ CompoundRegionLogicalCaseSelectOperationNode::result_type () const } template -void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { bool ok = false; @@ -1005,7 +1005,7 @@ void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db:: if (ci + 1 < children ()) { - ok = node->compute_local_bool (cache, layout, child_interactions, max_vertex_count, area_ratio); + ok = node->compute_local_bool (cache, layout, cell, child_interactions, proc); continue; } else { @@ -1021,12 +1021,12 @@ void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db:: std::vector > one; one.push_back (std::unordered_set ()); - node->compute_local (cache, layout, child_interactions, one, max_vertex_count, area_ratio); + node->compute_local (cache, layout, cell, child_interactions, one, proc); results[ci / 2].swap (one.front ()); } else { - node->compute_local (cache, layout, child_interactions, results, max_vertex_count, area_ratio); + node->compute_local (cache, layout, cell, child_interactions, results, proc); } @@ -1038,12 +1038,12 @@ void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (db:: } -template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template void CompoundRegionLogicalCaseSelectOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; // --------------------------------------------------------------------------------------------- @@ -1145,24 +1145,24 @@ CompoundRegionJoinOperationNode::result_type () const } template -void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { for (unsigned int ci = 0; ci < children (); ++ci) { shape_interactions computed; const shape_interactions &child_interactions = interactions_for_child (interactions, ci, computed); - child (ci)->compute_local (cache, layout, child_interactions, results, max_vertex_count, area_ratio); + child (ci)->compute_local (cache, layout, cell, child_interactions, results, proc); } } -template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; -template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, const shape_interactions &, std::vector > &, size_t, double) const; +template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; +template void CompoundRegionJoinOperationNode::implement_compute_local (CompoundRegionOperationCache *, db::Layout *, db::Cell *, const shape_interactions &, std::vector > &, const db::LocalProcessorBase *) const; // --------------------------------------------------------------------------------------------- @@ -1181,15 +1181,15 @@ CompoundRegionFilterOperationNode::~CompoundRegionFilterOperationNode () } void -CompoundRegionFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } // --------------------------------------------------------------------------------------------- @@ -1209,15 +1209,15 @@ CompoundRegionEdgeFilterOperationNode::~CompoundRegionEdgeFilterOperationNode () } void -CompoundRegionEdgeFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgeFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionEdgeFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgeFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } // --------------------------------------------------------------------------------------------- @@ -1237,15 +1237,15 @@ CompoundRegionEdgePairFilterOperationNode::~CompoundRegionEdgePairFilterOperatio } void -CompoundRegionEdgePairFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgePairFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionEdgePairFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgePairFilterOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } bool @@ -1271,15 +1271,15 @@ CompoundRegionProcessingOperationNode::~CompoundRegionProcessingOperationNode () } void -CompoundRegionProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void @@ -1315,15 +1315,15 @@ CompoundRegionToEdgeProcessingOperationNode::~CompoundRegionToEdgeProcessingOper } void -CompoundRegionToEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionToEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionToEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionToEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void @@ -1355,15 +1355,15 @@ CompoundRegionEdgeProcessingOperationNode::~CompoundRegionEdgeProcessingOperatio } void -CompoundRegionEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void CompoundRegionEdgeProcessingOperationNode::processed (db::Layout *, const db::Edge &p, std::vector &res) const @@ -1388,15 +1388,15 @@ CompoundRegionEdgeToPolygonProcessingOperationNode::~CompoundRegionEdgeToPolygon } void -CompoundRegionEdgeToPolygonProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgeToPolygonProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionEdgeToPolygonProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgeToPolygonProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void @@ -1433,15 +1433,15 @@ CompoundRegionToEdgePairProcessingOperationNode::~CompoundRegionToEdgePairProces } void -CompoundRegionToEdgePairProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionToEdgePairProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionToEdgePairProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionToEdgePairProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void @@ -1473,15 +1473,15 @@ CompoundRegionEdgePairToPolygonProcessingOperationNode::~CompoundRegionEdgePairT } void -CompoundRegionEdgePairToPolygonProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgePairToPolygonProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionEdgePairToPolygonProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgePairToPolygonProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void @@ -1518,15 +1518,15 @@ CompoundRegionEdgePairToEdgeProcessingOperationNode::~CompoundRegionEdgePairToEd } void -CompoundRegionEdgePairToEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgePairToEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } void -CompoundRegionEdgePairToEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionEdgePairToEdgeProcessingOperationNode::do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } // --------------------------------------------------------------------------------------------- @@ -1591,7 +1591,7 @@ CompoundRegionCheckOperationNode::computed_dist () const } void -CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { // TODO: needs a concept to deal with merged/non-merged inputs bool is_merged = true; @@ -1599,17 +1599,17 @@ CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache tl_assert (results.size () == 1); if (results.front ().empty ()) { - op.do_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + op.do_compute_local (layout, cell, interactions, results, proc); } else { std::vector > r; r.resize (1); - op.do_compute_local (layout, interactions, r, max_vertex_count, area_ratio); + op.do_compute_local (layout, cell, interactions, r, proc); results.front ().insert (r.front ().begin (), r.front ().end ()); } } void -CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { // TODO: needs a concept to deal with merged/non-merged inputs bool is_merged = true; @@ -1617,11 +1617,11 @@ CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache tl_assert (results.size () == 1); if (results.front ().empty ()) { - op.do_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + op.do_compute_local (layout, cell, interactions, results, proc); } else { std::vector > r; r.resize (1); - op.do_compute_local (layout, interactions, r, max_vertex_count, area_ratio); + op.do_compute_local (layout, cell, interactions, r, proc); results.front ().insert (r.front ().begin (), r.front ().end ()); } } diff --git a/src/db/db/dbCompoundOperation.h b/src/db/db/dbCompoundOperation.h index 5c3c63c9d..d65b96ec7 100644 --- a/src/db/db/dbCompoundOperation.h +++ b/src/db/db/dbCompoundOperation.h @@ -191,62 +191,62 @@ public: */ virtual bool wants_variants () const { return false; } - void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; - void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; - void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } template - bool compute_local_bool (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, size_t max_vertex_count, double area_ratio) const + bool compute_local_bool (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, const db::LocalProcessorBase *proc) const { if (result_type () == Region) { std::vector > res; res.push_back (std::unordered_set ()); - compute_local (cache, layout, interactions, res, max_vertex_count, area_ratio); + compute_local (cache, layout, cell, interactions, res, proc); return ! res.front ().empty (); } else if (result_type () == Edges) { std::vector > res; res.push_back (std::unordered_set ()); - compute_local (cache, layout, interactions, res, max_vertex_count, area_ratio); + compute_local (cache, layout, cell, interactions, res, proc); return ! res.front ().empty (); } else if (result_type () == EdgePairs) { std::vector > res; res.push_back (std::unordered_set ()); - compute_local (cache, layout, interactions, res, max_vertex_count, area_ratio); + compute_local (cache, layout, cell, interactions, res, proc); return ! res.front ().empty (); } else { @@ -256,12 +256,12 @@ public: protected: // the different computation slots - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } virtual db::Coord computed_dist () const = 0; @@ -272,7 +272,7 @@ private: db::Coord m_dist; template - void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { // TODO: confine caching to those nodes which need it. @@ -283,7 +283,7 @@ private: std::vector > uncached_results; uncached_results.resize (results.size ()); - do_compute_local (cache, layout, interactions, uncached_results, max_vertex_count, area_ratio); + do_compute_local (cache, layout, cell, interactions, uncached_results, proc); cp.second->swap (uncached_results); @@ -360,14 +360,14 @@ public: virtual db::Coord computed_dist () const { return 0; } virtual ResultType result_type () const { return Region; } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } }; class DB_PUBLIC CompoundRegionOperationForeignNode @@ -381,14 +381,14 @@ public: virtual db::Coord computed_dist () const { return 0; } virtual ResultType result_type () const { return Region; } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } }; class DB_PUBLIC CompoundRegionOperationSecondaryNode @@ -402,14 +402,14 @@ public: virtual db::Coord computed_dist () const { return 0; } virtual ResultType result_type () const { return Region; } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: db::Region *mp_input; @@ -532,28 +532,28 @@ public: virtual ResultType result_type () const; // the different computation slots - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: LogicalOp m_op; bool m_invert; template - void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; }; @@ -573,34 +573,34 @@ public: } // the different computation slots - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } private: @@ -608,12 +608,12 @@ private: bool m_invert; template - void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions, one, proc); if ((one.front ().size () >= m_min_count && one.front ().size () < m_max_count) != m_invert) { results.front ().insert (one.front ().begin (), one.front ().end ()); @@ -637,22 +637,22 @@ public: virtual db::Coord computed_dist () const; // the different computation slots - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: GeometricalOp m_op; template - void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; template - void implement_bool (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void implement_bool (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; }; template @@ -725,7 +725,7 @@ protected: } template - void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; private: const db::local_operation *m_op; @@ -745,21 +745,21 @@ public: std::string generated_description () const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: typedef db::interacting_local_operation op_type; @@ -774,21 +774,21 @@ public: std::string generated_description () const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: db::interacting_with_edge_local_operation m_op; @@ -803,21 +803,21 @@ public: std::string generated_description () const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: db::pull_local_operation m_op; @@ -831,21 +831,21 @@ public: std::string generated_description () const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: db::pull_with_edge_local_operation m_op; @@ -870,39 +870,39 @@ public: virtual ResultType result_type () const; // the different computation slots - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } private: template - void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; }; /** @@ -927,39 +927,39 @@ public: virtual ResultType result_type () const; // the different computation slots - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } private: template - void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; bool m_multi_layer; }; @@ -975,14 +975,14 @@ public: // specifies the result type virtual ResultType result_type () const { return Region; } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } virtual const TransformationReducer *vars () const { return mp_filter->vars (); } virtual bool wants_variants () const { return mp_filter->wants_variants (); } @@ -993,12 +993,12 @@ private: bool m_sum_of_set; template - void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions, one, proc); if (m_sum_of_set) { if (mp_filter->selected_set (one.front ())) { @@ -1024,14 +1024,14 @@ public: // specifies the result type virtual ResultType result_type () const { return Edges; } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } virtual const TransformationReducer *vars () const { return mp_filter->vars (); } virtual bool wants_variants () const { return mp_filter->wants_variants (); } @@ -1042,12 +1042,12 @@ private: bool m_sum_of; template - void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions, one, proc); if (m_sum_of) { if (mp_filter->selected (one.front ())) { @@ -1073,14 +1073,14 @@ public: // specifies the result type virtual ResultType result_type () const { return EdgePairs; } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } virtual const TransformationReducer *vars () const { return mp_filter->vars (); } virtual bool wants_variants () const { return mp_filter->wants_variants (); } @@ -1092,12 +1092,12 @@ private: bool is_selected (const db::EdgePair &p) const; template - void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions, one, proc); for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { if (is_selected (*p)) { @@ -1122,29 +1122,30 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + private: PolygonProcessorBase *mp_proc; bool m_owns_proc; db::Coord m_dist_adder; void processed (db::Layout *, const db::Polygon &p, std::vector &res) const; - void processed (db::Layout *layout, const db::PolygonRef &p, std::vector &res) const; + void processed (db::Layout *, const db::PolygonRef &p, std::vector &res) const; template - void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions, one, proc); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1194,33 +1195,33 @@ public: return std::string ("merged") + CompoundRegionMultiInputOperationNode::generated_description (); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - implement_compute_local (cache, layout, interactions, results, max_vertex_count, area_ratio); + implement_compute_local (cache, layout, cell, interactions, results, proc); } // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: bool m_min_coherence; unsigned int m_min_wc; template - void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions, one, proc); db::EdgeProcessor ep; @@ -1259,14 +1260,14 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: EdgeToPolygonProcessorBase *mp_proc; @@ -1276,12 +1277,12 @@ private: void processed (db::Layout *layout, const db::Edge &p, std::vector &res) const; template - void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions, one, proc); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1305,14 +1306,14 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: EdgeProcessorBase *mp_proc; @@ -1321,12 +1322,12 @@ private: void processed (db::Layout *, const db::Edge &p, std::vector &res) const; template - void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions, one, proc); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1350,14 +1351,14 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: EdgePairToPolygonProcessorBase *mp_proc; @@ -1367,12 +1368,12 @@ private: void processed (db::Layout *layout, const db::EdgePair &p, std::vector &res) const; template - void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions, one, proc); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1396,26 +1397,26 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: EdgePairToEdgeProcessorBase *mp_proc; bool m_owns_proc; template - void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions, one, proc); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1439,14 +1440,14 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: PolygonToEdgeProcessorBase *mp_proc; @@ -1456,12 +1457,12 @@ private: void processed (db::Layout *layout, const db::PolygonRef &p, std::vector &res) const; template - void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions, one, proc); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1495,14 +1496,14 @@ public: virtual const TransformationReducer *vars () const { return mp_proc->vars (); } virtual bool wants_variants () const { return mp_proc->wants_variants (); } - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: PolygonToEdgePairProcessorBase *mp_proc; @@ -1512,12 +1513,12 @@ private: void processed (db::Layout *layout, const db::PolygonRef &p, std::vector &res) const; template - void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector > one; one.push_back (std::unordered_set ()); - child (0)->compute_local (cache, layout, interactions, one, max_vertex_count, area_ratio); + child (0)->compute_local (cache, layout, cell, interactions, one, proc); std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { @@ -1559,14 +1560,14 @@ public: virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual db::Coord computed_dist () const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; - virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const LocalProcessorBase *proc) const; + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const LocalProcessorBase *proc) const; // non-implemented - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } - virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, size_t /*max_vertex_count*/, double /*area_ratio*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } + virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: db::EdgeRelationFilter m_check; @@ -1599,10 +1600,10 @@ public: { } protected: - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { CompoundRegionOperationCache cache; - mp_node->compute_local (&cache, layout, interactions, results, max_vertex_count, area_ratio); + mp_node->compute_local (&cache, layout, cell, interactions, results, proc); } virtual db::Coord dist () const { return mp_node->dist (); } @@ -1645,7 +1646,7 @@ public: } protected: - virtual void do_compute_local (db::Layout *layout, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (db::Layout *layout, db::Cell *cell, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &results, const db::LocalProcessorBase *proc) const { auto interactions_by_prop_id = separate_interactions_to_interactions_by_properties (interactions, m_prop_constraint, m_pms, m_pmis); for (auto s2p = interactions_by_prop_id.begin (); s2p != interactions_by_prop_id.end (); ++s2p) { @@ -1654,7 +1655,7 @@ protected: results_wo_props.resize (results.size ()); CompoundRegionOperationCache cache; - mp_node->compute_local (&cache, layout, s2p->second, results_wo_props, max_vertex_count, area_ratio); + mp_node->compute_local (&cache, layout, cell, s2p->second, results_wo_props, proc); for (size_t n = 0; n < results.size (); ++n) { for (auto i = results_wo_props [n].begin (); i != results_wo_props [n].end (); ++i) { diff --git a/src/db/db/dbDeepEdges.cc b/src/db/db/dbDeepEdges.cc index 4c80d42ae..38428d3fc 100644 --- a/src/db/db/dbDeepEdges.cc +++ b/src/db/db/dbDeepEdges.cc @@ -1367,7 +1367,7 @@ public: return 1; } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const + virtual void do_compute_local (db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == (m_output_mode == Both ? 2 : 1)); @@ -1460,7 +1460,7 @@ public: return 1; } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const + virtual void do_compute_local (db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == 1); std::unordered_set &result = results.front (); @@ -1517,7 +1517,7 @@ public: return 1; } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const + virtual void do_compute_local (db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == size_t (m_output_mode == Both ? 2 : 1)); @@ -1657,7 +1657,7 @@ public: return 1; } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const + virtual void do_compute_local (db::Layout *layout, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == 1); std::unordered_set &result = results.front (); @@ -1941,7 +1941,7 @@ public: // .. nothing yet .. } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const + virtual void do_compute_local (db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == 1); std::unordered_set &result = results.front (); diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index 6c2e2fe53..df87000ae 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -1953,6 +1953,30 @@ DeepRegion::run_check (db::edge_relation_type rel, bool different_polygons, cons const db::DeepLayer &polygons = needs_merged_primary ? merged_deep_layer () : deep_layer (); + { + // create cell variants for magnification if needed + + db::cell_variants_collector vars; + vars.collect (polygons.layout (), polygons.initial_cell ()); + + // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? + const_cast (polygons).separate_variants (vars); + } + + if (other_deep && &other_deep->deep_layer ().layout () != &polygons.layout ()) { + + // create cell variants for magnification for the other input if needed + + const db::DeepLayer &other_layer = other_deep->deep_layer (); + + db::cell_variants_collector vars; + vars.collect (other_layer.layout (), other_layer.initial_cell ()); + + // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? + const_cast (other_layer).separate_variants (vars); + + } + EdgeRelationFilter check (rel, d, options.metrics); check.set_include_zero (false); check.set_whole_edges (options.whole_edges); @@ -2009,18 +2033,29 @@ DeepRegion::run_single_polygon_check (db::edge_relation_type rel, db::Coord d, c const db::DeepLayer &polygons = merged_deep_layer (); - EdgeRelationFilter check (rel, d, options.metrics); - check.set_include_zero (false); - check.set_whole_edges (options.whole_edges); - check.set_ignore_angle (options.ignore_angle); - check.set_min_projection (options.min_projection); - check.set_max_projection (options.max_projection); + db::cell_variants_collector vars; + vars.collect (polygons.layout (), polygons.initial_cell ()); + + // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? + const_cast (polygons).separate_variants (vars); db::Layout &layout = const_cast (polygons.layout ()); std::unique_ptr res (new db::DeepEdgePairs (polygons.derived ())); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { + const std::map &v = vars.variants (c->cell_index ()); + tl_assert (v.size () == size_t (1)); + double mag = v.begin ()->first.mag (); + db::Coord d_with_mag = db::coord_traits::rounded (d / mag); + + EdgeRelationFilter check (rel, d_with_mag, options.metrics); + check.set_include_zero (false); + check.set_whole_edges (options.whole_edges); + check.set_ignore_angle (options.ignore_angle); + check.set_min_projection (options.min_projection); + check.set_max_projection (options.max_projection); + const db::Shapes &shapes = c->shapes (polygons.layer ()); db::Shapes &result = c->shapes (res->deep_layer ().layer ()); diff --git a/src/db/db/dbDeepTexts.cc b/src/db/db/dbDeepTexts.cc index e5e282f87..0c1cc30e7 100644 --- a/src/db/db/dbDeepTexts.cc +++ b/src/db/db/dbDeepTexts.cc @@ -571,7 +571,7 @@ public: return 1; } - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const + virtual void do_compute_local (db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == 1); std::unordered_set &result = results.front (); @@ -670,7 +670,7 @@ public: return 1; } - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const + virtual void do_compute_local (db::Layout *layout, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == 1); std::unordered_set &result = results.front (); diff --git a/src/db/db/dbEdgePairRelations.h b/src/db/db/dbEdgePairRelations.h index 1d9edf7e9..6a4041764 100644 --- a/src/db/db/dbEdgePairRelations.h +++ b/src/db/db/dbEdgePairRelations.h @@ -228,6 +228,14 @@ struct DB_PUBLIC EdgeRelationFilter return m_max_projection; } + /** + * @brief sets the check distance + */ + void set_distance (distance_type d) + { + m_d = d; + } + /** * @brief Gets the check distance */ @@ -236,6 +244,14 @@ struct DB_PUBLIC EdgeRelationFilter return m_d; } + /** + * @brief Sets the relation + */ + void set_relation (edge_relation_type r) + { + m_r = r; + } + /** * @brief Gets the relation */ diff --git a/src/db/db/dbEdgesLocalOperations.cc b/src/db/db/dbEdgesLocalOperations.cc index cd69d034f..9a43060a7 100644 --- a/src/db/db/dbEdgesLocalOperations.cc +++ b/src/db/db/dbEdgesLocalOperations.cc @@ -57,7 +57,7 @@ EdgeBoolAndOrNotLocalOperation::description () const } void -EdgeBoolAndOrNotLocalOperation::do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +EdgeBoolAndOrNotLocalOperation::do_compute_local (db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == size_t (m_op == EdgeAndNot ? 2 : 1)); @@ -140,7 +140,7 @@ EdgeToPolygonLocalOperation::description () const } void -EdgeToPolygonLocalOperation::do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +EdgeToPolygonLocalOperation::do_compute_local (db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == size_t (m_op == EdgePolygonOp::Both ? 2 : 1)); diff --git a/src/db/db/dbEdgesLocalOperations.h b/src/db/db/dbEdgesLocalOperations.h index 163bf5a59..a57a2e020 100644 --- a/src/db/db/dbEdgesLocalOperations.h +++ b/src/db/db/dbEdgesLocalOperations.h @@ -44,7 +44,7 @@ class DB_PUBLIC EdgeBoolAndOrNotLocalOperation public: EdgeBoolAndOrNotLocalOperation (db::EdgeBoolOp op); - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &result, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &result, const db::LocalProcessorBase *proc) const; virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual std::string description () const; @@ -67,7 +67,7 @@ class DB_PUBLIC EdgeToPolygonLocalOperation public: EdgeToPolygonLocalOperation (EdgePolygonOp::mode_t op, bool include_borders); - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &result, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &result, const db::LocalProcessorBase *proc) const; virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual std::string description () const; diff --git a/src/db/db/dbHierProcessor.cc b/src/db/db/dbHierProcessor.cc index 9987451e2..3529db310 100644 --- a/src/db/db/dbHierProcessor.cc +++ b/src/db/db/dbHierProcessor.cc @@ -30,6 +30,7 @@ #include "dbPolygonGenerators.h" #include "dbLocalOperationUtils.h" #include "dbShapeFlags.h" +#include "dbCellVariants.h" #include "tlLog.h" #include "tlTimer.h" #include "tlInternational.h" @@ -1258,7 +1259,7 @@ private: db::ICplxTrans tn1 = inst1->complex_trans (*n); db::ICplxTrans tni1 = tn1.inverted (); - db::Box ibox1 = tn1 * cell1.bbox (m_subject_layer).enlarged (db::Vector (m_dist, m_dist)); + db::Box ibox1 = (tn1 * cell1.bbox (m_subject_layer)).enlarged (db::Vector (m_dist, m_dist)); std::set *insts = 0; @@ -1276,7 +1277,7 @@ private: db::ICplxTrans tn2 = inst2->complex_trans (*k); // NOTE: we need to enlarge both subject *and* intruder boxes - either object comes close to intruder or the other way around - db::Box ibox2 = tn2 * cell2.bbox (m_intruder_layer).enlarged (db::Vector (m_dist, m_dist)); + db::Box ibox2 = (tn2 * cell2.bbox (m_intruder_layer)).enlarged (db::Vector (m_dist, m_dist)); db::Box cbox = ibox1 & ibox2; if (! cbox.empty () && (cbox == ibox1 || cell1.has_shapes_touching (m_subject_layer, safe_box_enlarged (tni1 * cbox, -1, -1)))) { @@ -1332,7 +1333,7 @@ private: db::ICplxTrans it = i->complex_trans (*ia); - db::Box ibox2 = tni2.inverted () * it * ic.bbox (m_intruder_layer).enlarged (db::Vector (m_dist, m_dist)); + db::Box ibox2 = (tni2.inverted () * it * ic.bbox (m_intruder_layer)).enlarged (db::Vector (m_dist, m_dist)); db::Box ccbox = cbox & ibox2; if (! ccbox.empty ()) { @@ -1469,6 +1470,38 @@ local_processor_result_computation_task::perform () } } +// --------------------------------------------------------------------------------------------- +// LocalProcessorBase implementation + +LocalProcessorBase::LocalProcessorBase () + : m_report_progress (true), m_nthreads (0), m_max_vertex_count (0), m_area_ratio (0.0), m_boolean_core (false), + m_base_verbosity (30), mp_vars (0), mp_current_cell (0) +{ + // .. nothing yet .. +} + +db::Coord +LocalProcessorBase::dist_for_cell (const db::Cell *cell, db::Coord dist) const +{ + return cell ? dist_for_cell (cell->cell_index (), dist) : dist; +} + +db::Coord +LocalProcessorBase::dist_for_cell (db::cell_index_type cell_index, db::Coord dist) const +{ + if (mp_vars) { + + const std::map &v = mp_vars->variants (cell_index); + tl_assert (v.size () == size_t (1)); + + double mag = v.begin ()->first.mag (); + return db::coord_traits::rounded (dist / mag); + + } else { + return dist; + } +} + // --------------------------------------------------------------------------------------------- // LocalProcessor implementation @@ -1477,9 +1510,9 @@ local_processor::local_processor (db::Layout *layout, db::Cell *top, : mp_subject_layout (layout), mp_intruder_layout (layout), mp_subject_top (top), mp_intruder_top (top), mp_subject_breakout_cells (breakout_cells), mp_intruder_breakout_cells (breakout_cells), - m_report_progress (true), m_nthreads (0), m_max_vertex_count (0), m_area_ratio (0.0), m_boolean_core (default_boolean_core () ()), m_base_verbosity (30), m_progress (0), mp_progress (0) + m_progress (0), mp_progress (0) { - // .. nothing yet .. + set_boolean_core (default_boolean_core () ()); } template @@ -1487,19 +1520,9 @@ local_processor::local_processor (db::Layout *subject_layout, db::Ce : mp_subject_layout (subject_layout), mp_intruder_layout (intruder_layout), mp_subject_top (subject_top), mp_intruder_top (intruder_top), mp_subject_breakout_cells (subject_breakout_cells), mp_intruder_breakout_cells (intruder_breakout_cells), - m_report_progress (true), m_nthreads (0), m_max_vertex_count (0), m_area_ratio (0.0), m_boolean_core (default_boolean_core () ()), m_base_verbosity (30), m_progress (0), mp_progress (0) + m_progress (0), mp_progress (0) { - // .. nothing yet .. -} - -template -std::string local_processor::description (const local_operation *op) const -{ - if (op && m_description.empty ()) { - return op->description (); - } else { - return m_description; - } + set_boolean_core (default_boolean_core () ()); } template @@ -1555,7 +1578,7 @@ void local_processor::run (local_operation *op, unsigned template void local_processor::run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, const std::vector &output_layers) { - tl::SelfTimer timer (tl::verbosity () > m_base_verbosity, tl::to_string (tr ("Executing ")) + description (op)); + tl::SelfTimer timer (tl::verbosity () > base_verbosity (), tl::to_string (tr ("Executing ")) + description (op)); local_processor_contexts contexts; compute_contexts (contexts, op, subject_layer, intruder_layers); @@ -1576,10 +1599,10 @@ void local_processor::compute_contexts (local_processor_contexts m_base_verbosity + 10, tl::to_string (tr ("Computing contexts for ")) + description (op)); + tl::SelfTimer timer (tl::verbosity () > base_verbosity () + 10, tl::to_string (tr ("Computing contexts for ")) + description (op)); - if (m_nthreads > 0) { - mp_cc_job.reset (new tl::Job > (m_nthreads)); + if (threads () > 0) { + mp_cc_job.reset (new tl::Job > (threads ())); } else { mp_cc_job.reset (0); } @@ -1629,11 +1652,11 @@ void local_processor::compute_contexts (local_processor_contexts::context_key_type &intruders, - db::Coord dist) const + db::Coord dist_top) const { CRONOLOGY_COLLECTION_BRACKET(event_compute_contexts) - if (tl::verbosity () >= m_base_verbosity + 20) { + if (tl::verbosity () >= base_verbosity () + 20) { if (! subject_parent) { tl::log << tr ("Computing context for top cell ") << mp_subject_layout->cell_name (subject_cell->cell_index ()); } else { @@ -1641,6 +1664,8 @@ void local_processor::compute_contexts (local_processor_contextscell_index (), dist_top); + db::local_processor_cell_context *cell_context = 0; // prepare a new cell context: this has to happen in a thread-safe way as we share the contexts @@ -1821,7 +1846,7 @@ local_processor::compute_results (local_processor_contexts m_base_verbosity + 10, tl::to_string (tr ("Computing results for ")) + description (op)); + tl::SelfTimer timer (tl::verbosity () > base_verbosity () + 10, tl::to_string (tr ("Computing results for ")) + description (op)); // avoids updates while we work on the layout mp_subject_layout->update (); @@ -1829,7 +1854,7 @@ local_processor::compute_results (local_processor_contexts::iterator c = contexts.begin (); c != contexts.end (); ++c) { comp_effort += c->second.size (); } @@ -1839,9 +1864,9 @@ local_processor::compute_results (local_processor_contexts 0) { + if (threads () > 0) { - std::unique_ptr > > rc_job (new tl::Job > (m_nthreads)); + std::unique_ptr > > rc_job (new tl::Job > (threads ())); // schedule computation jobs in "waves": we need to make sure they are executed // bottom-up. So we identify a new bunch of cells each time we pass through the cell set @@ -1857,7 +1882,7 @@ local_processor::compute_results (local_processor_contexts m_base_verbosity + 10, tl::sprintf (tl::to_string (tr ("Computing results iteration #%d")), iter)); + tl::SelfTimer timer (tl::verbosity () > base_verbosity () + 10, tl::sprintf (tl::to_string (tr ("Computing results iteration #%d")), iter)); bool any = false; std::unordered_set later; @@ -1917,7 +1942,7 @@ local_processor::compute_results (local_processor_contextsbegin_bottom_up (); bu != mp_subject_layout->end_bottom_up (); ++bu) { @@ -2045,6 +2070,8 @@ template void local_processor::compute_local_cell (const db::local_processor_contexts &contexts, db::Cell *subject_cell, const db::Cell *intruder_cell, const local_operation *op, const typename local_processor_cell_contexts::context_key_type &intruders, std::vector > &result) const { + db::Coord dist = dist_for_cell (subject_cell->cell_index (), op->dist ()); + const db::Shapes *subject_shapes = &subject_cell->shapes (contexts.subject_layer ()); db::shape_to_object s2o; @@ -2091,12 +2118,12 @@ local_processor::compute_local_cell (const db::local_processor_conte if (subject_cell == intruder_cell && contexts.subject_layer () == ail && !foreign) { - scan_shape2shape_same_layer () (subject_shapes, subject_id0, ipl == intruders.second.end () ? empty_intruders : ipl->second, il_index, interactions, op->dist ()); + scan_shape2shape_same_layer () (subject_shapes, subject_id0, ipl == intruders.second.end () ? empty_intruders : ipl->second, il_index, interactions, dist); } else { db::Layout *target_layout = (mp_subject_layout == mp_intruder_layout ? 0 : mp_subject_layout); - scan_shape2shape_different_layers () (target_layout, subject_shapes, intruder_shapes, subject_id0, &(ipl == intruders.second.end () ? empty_intruders : ipl->second), il_index, interactions, op->dist ()); + scan_shape2shape_different_layers () (target_layout, subject_shapes, intruder_shapes, subject_id0, &(ipl == intruders.second.end () ? empty_intruders : ipl->second), il_index, interactions, dist); } @@ -2106,7 +2133,7 @@ local_processor::compute_local_cell (const db::local_processor_conte db::box_scanner2 scanner; db::addressable_object_from_shape heap; - interaction_registration_shape2inst rec (mp_subject_layout, mp_intruder_layout, ail, il_index, op->dist (), &interactions); + interaction_registration_shape2inst rec (mp_subject_layout, mp_intruder_layout, ail, il_index, dist, &interactions); unsigned int id = subject_id0; for (db::Shapes::shape_iterator i = subject_shapes->begin (shape_flags ()); !i.at_end (); ++i) { @@ -2137,7 +2164,7 @@ local_processor::compute_local_cell (const db::local_processor_conte } } - scanner.process (rec, op->dist (), db::box_convert (), inst_bci); + scanner.process (rec, dist, db::box_convert (), inst_bci); } @@ -2154,7 +2181,7 @@ local_processor::compute_local_cell (const db::local_processor_conte } - op->compute_local (mp_subject_layout, interactions, result, m_max_vertex_count, m_area_ratio); + op->compute_local (mp_subject_layout, subject_cell, interactions, result, this); } } @@ -2264,7 +2291,7 @@ local_processor::run_flat (const generic_shape_iterator &subject std::string process_description, scan_description; - if (m_report_progress) { + if (report_progress ()) { process_description = description (op); if (process_description.empty ()) { @@ -2327,7 +2354,7 @@ local_processor::run_flat (const generic_shape_iterator &subject if (*il == subjects && ! ff) { - interaction_registration_shape1_scanner_combo scanner (&interactions, il_index, m_report_progress, scan_description); + interaction_registration_shape1_scanner_combo scanner (&interactions, il_index, report_progress (), scan_description); for (typename shape_interactions::subject_iterator s = interactions.begin_subjects (); s != interactions.end_subjects (); ++s) { scanner.insert (&s->second, s->first); @@ -2337,7 +2364,7 @@ local_processor::run_flat (const generic_shape_iterator &subject } else { - db::box_scanner2 scanner (m_report_progress, scan_description); + db::box_scanner2 scanner (report_progress (), scan_description); interaction_registration_shape2shape rec (0 /*layout*/, &interactions, il_index); for (typename shape_interactions::subject_iterator s = interactions.begin_subjects (); s != interactions.end_subjects (); ++s) { @@ -2393,7 +2420,7 @@ local_processor::run_flat (const generic_shape_iterator &subject if (*il == subjects && ! ff) { - interaction_registration_shape1_scanner_combo scanner (&interactions, il_index, m_report_progress, scan_description); + interaction_registration_shape1_scanner_combo scanner (&interactions, il_index, report_progress (), scan_description); addressable_shape_delivery is (subjects.confined (common_box, false)); unsigned int id = id_first; @@ -2406,7 +2433,7 @@ local_processor::run_flat (const generic_shape_iterator &subject } else { - db::box_scanner2 scanner (m_report_progress, scan_description); + db::box_scanner2 scanner (report_progress (), scan_description); interaction_registration_shape2shape rec (0 /*layout*/, &interactions, il_index); if (*il == subjects) { @@ -2463,7 +2490,7 @@ local_processor::run_flat (const generic_shape_iterator &subject std::vector > result; result.resize (result_shapes.size ()); - op->compute_local (mp_subject_layout, interactions, result, m_max_vertex_count, m_area_ratio, m_report_progress, process_description); + op->compute_local (mp_subject_layout, 0, interactions, result, this); for (std::vector::const_iterator r = result_shapes.begin (); r != result_shapes.end (); ++r) { if (*r) { diff --git a/src/db/db/dbHierProcessor.h b/src/db/db/dbHierProcessor.h index 9bb95f18f..416b2612f 100644 --- a/src/db/db/dbHierProcessor.h +++ b/src/db/db/dbHierProcessor.h @@ -44,6 +44,8 @@ namespace db { +class VariantsCollectorBase; + template class local_processor; template class local_processor_cell_context; template class local_processor_contexts; @@ -413,22 +415,10 @@ public: } }; -template -class DB_PUBLIC local_processor +class DB_PUBLIC LocalProcessorBase { public: - local_processor (db::Layout *layout = 0, db::Cell *top = 0, const std::set *breakout_cells = 0); - local_processor (db::Layout *subject_layout, db::Cell *subject_top, const db::Layout *intruder_layout, const db::Cell *intruder_cell, const std::set *subject_breakout_cells = 0, const std::set *intruder_breakout_cells = 0); - void run (local_operation *op, unsigned int subject_layer, unsigned int intruder_layer, unsigned int output_layers); - void run (local_operation *op, unsigned int subject_layer, unsigned int intruder_layer, const std::vector &output_layers); - void run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, const std::vector &output_layers); - void run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, unsigned int output_layer); - void compute_contexts (local_processor_contexts &contexts, const local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers) const; - void compute_results (local_processor_contexts &contexts, const local_operation *op, const std::vector &output_layers) const; - - void run_flat (const db::Shapes *subject_shapes, const db::Shapes *intruders, const local_operation *op, db::Shapes *result_shapes) const; - void run_flat (const db::Shapes *subjects, const std::vector &intruders, const local_operation *op, const std::vector &result_shapes) const; - void run_flat (const generic_shape_iterator &subjects, const std::vector > &intruders, const std::vector &foreign, const local_operation *op, const std::vector &result_shapes) const; + LocalProcessorBase (); void set_description (const std::string &d) { @@ -440,6 +430,11 @@ public: m_report_progress = rp; } + bool report_progress () const + { + return m_report_progress; + } + void set_base_verbosity (int vb) { m_base_verbosity = vb; @@ -490,6 +485,55 @@ public: return m_boolean_core; } + void set_vars (const db::VariantsCollectorBase *vars) + { + mp_vars = vars; + } + + db::Coord dist_for_cell (db::cell_index_type cell_index, db::Coord dist) const; + db::Coord dist_for_cell (const db::Cell *cell, db::Coord dist) const; + + template + std::string description (const local_operation *op) const + { + if (op && m_description.empty ()) { + return op->description (); + } else { + return m_description; + } + } + +private: + std::string m_description; + bool m_report_progress; + unsigned int m_nthreads; + size_t m_max_vertex_count; + double m_area_ratio; + bool m_boolean_core; + int m_base_verbosity; + const db::VariantsCollectorBase *mp_vars; + mutable const db::Cell *mp_current_cell; +}; + +template +class DB_PUBLIC local_processor + : public LocalProcessorBase +{ +public: + local_processor (db::Layout *layout = 0, db::Cell *top = 0, const std::set *breakout_cells = 0); + local_processor (db::Layout *subject_layout, db::Cell *subject_top, const db::Layout *intruder_layout, const db::Cell *intruder_cell, const std::set *subject_breakout_cells = 0, const std::set *intruder_breakout_cells = 0); + + void run (local_operation *op, unsigned int subject_layer, unsigned int intruder_layer, unsigned int output_layers); + void run (local_operation *op, unsigned int subject_layer, unsigned int intruder_layer, const std::vector &output_layers); + void run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, const std::vector &output_layers); + void run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, unsigned int output_layer); + void compute_contexts (local_processor_contexts &contexts, const local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers) const; + void compute_results (local_processor_contexts &contexts, const local_operation *op, const std::vector &output_layers) const; + + void run_flat (const db::Shapes *subject_shapes, const db::Shapes *intruders, const local_operation *op, db::Shapes *result_shapes) const; + void run_flat (const db::Shapes *subjects, const std::vector &intruders, const local_operation *op, const std::vector &result_shapes) const; + void run_flat (const generic_shape_iterator &subjects, const std::vector > &intruders, const std::vector &foreign, const local_operation *op, const std::vector &result_shapes) const; + private: template friend class local_processor_cell_contexts; template friend class local_processor_context_computation_task; @@ -500,18 +544,10 @@ private: const db::Cell *mp_intruder_top; const std::set *mp_subject_breakout_cells; const std::set *mp_intruder_breakout_cells; - std::string m_description; - bool m_report_progress; - unsigned int m_nthreads; - size_t m_max_vertex_count; - double m_area_ratio; - bool m_boolean_core; - int m_base_verbosity; mutable std::unique_ptr > > mp_cc_job; mutable size_t m_progress; mutable tl::Progress *mp_progress; - std::string description (const local_operation *op) const; void next () const; size_t get_progress () const; void compute_contexts (db::local_processor_contexts &contexts, db::local_processor_cell_context *parent_context, db::Cell *subject_parent, db::Cell *subject_cell, const db::ICplxTrans &subject_cell_inst, const db::Cell *intruder_cell, const typename local_processor_cell_contexts::context_key_type &intruders, db::Coord dist) const; diff --git a/src/db/db/dbLocalOperation.cc b/src/db/db/dbLocalOperation.cc index 94eb19e29..5e7a98d1d 100644 --- a/src/db/db/dbLocalOperation.cc +++ b/src/db/db/dbLocalOperation.cc @@ -30,17 +30,17 @@ namespace db // local_operations implementation template -void local_operation::compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio, bool report_progress, const std::string &progress_desc) const +void local_operation::compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { if (interactions.num_subjects () <= 1 || ! requests_single_subjects ()) { - do_compute_local (layout, interactions, results, max_vertex_count, area_ratio); + do_compute_local (layout, subject_cell, interactions, results, proc); } else { std::unique_ptr progress; - if (report_progress) { - progress.reset (new tl::RelativeProgress (progress_desc, interactions.size ())); + if (proc->report_progress ()) { + progress.reset (new tl::RelativeProgress (proc->description (this), interactions.size ())); } for (typename shape_interactions::iterator i = interactions.begin (); i != interactions.end (); ++i) { @@ -62,7 +62,7 @@ void local_operation::compute_local (db::Layout *layout, const shape single_interactions.add_interaction (i->first, *ii); } - do_compute_local (layout, single_interactions, results, max_vertex_count, area_ratio); + do_compute_local (layout, subject_cell, single_interactions, results, proc); if (progress.get ()) { ++*progress; diff --git a/src/db/db/dbLocalOperation.h b/src/db/db/dbLocalOperation.h index 87161fd20..faccd6bf1 100644 --- a/src/db/db/dbLocalOperation.h +++ b/src/db/db/dbLocalOperation.h @@ -37,6 +37,7 @@ namespace db { template class shape_interactions; +class LocalProcessorBase; /** * @brief Indicates the desired behaviour for subject shapes for which there is no intruder @@ -93,7 +94,7 @@ public: * * If the operation requests single subject mode, the interactions will be split into single subject/intruder clusters */ - void compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio, bool report_progress = false, const std::string &progress_desc = std::string ()) const; + void compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; /** * @brief Indicates the desired behaviour when a shape does not have an intruder @@ -123,7 +124,7 @@ protected: * @param interactions The interaction set * @param result The container to which the results are written */ - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &result, size_t max_vertex_count, double area_ratio) const = 0; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &result, const db::LocalProcessorBase *proc) const = 0; }; } diff --git a/src/db/db/dbRegionLocalOperations.cc b/src/db/db/dbRegionLocalOperations.cc index aaaa73cf3..915763b5d 100644 --- a/src/db/db/dbRegionLocalOperations.cc +++ b/src/db/db/dbRegionLocalOperations.cc @@ -199,12 +199,16 @@ check_local_operation_base::check_local_operation_base (const EdgeRelati template void -check_local_operation_base::compute_results (db::Layout *layout, const std::vector &subjects, const std::set &intruders, std::unordered_set &result, std::unordered_set &intra_polygon_result) const +check_local_operation_base::compute_results (db::Layout *layout, db::Cell *subject_cell, const std::vector &subjects, const std::set &intruders, std::unordered_set &result, std::unordered_set &intra_polygon_result, const db::LocalProcessorBase *proc) const { // NOTE: the rectangle and opposite filters are unsymmetric bool symmetric_edge_pairs = ! m_has_other && m_options.opposite_filter == db::NoOppositeFilter && m_options.rect_filter == RectFilter::NoRectFilter; - edge2edge_check_negative_or_positive > edge_check (m_check, result, intra_polygon_result, m_options.negative, m_different_polygons, m_has_other, m_options.shielded, symmetric_edge_pairs); + // modify the check to take into account scaled cells + EdgeRelationFilter check = m_check; + check.set_distance (proc->dist_for_cell (subject_cell, check.distance ())); + + edge2edge_check_negative_or_positive > edge_check (check, result, intra_polygon_result, m_options.negative, m_different_polygons, m_has_other, m_options.shielded, symmetric_edge_pairs); poly2poly_check poly_check (edge_check); std::unordered_set polygons; @@ -677,7 +681,7 @@ check_local_operation::check_local_operation (const EdgeRelationFilter & template void -check_local_operation::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +check_local_operation::do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { std::vector subjects; subjects.reserve (interactions.size ()); @@ -696,7 +700,7 @@ check_local_operation::do_compute_local (db::Layout *layout, const shape std::unordered_set result, intra_polygon_result; // perform the basic check - check_local_operation_base::compute_results (layout, subjects, intruders, result, intra_polygon_result); + check_local_operation_base::compute_results (layout, subject_cell, subjects, intruders, result, intra_polygon_result, proc); // detect and remove parts of the result which have or do not have results "opposite" // ("opposite" is defined by the projection of edges "through" the subject shape) @@ -752,7 +756,7 @@ check_local_operation_with_properties::check_local_operation_with_proper template void -check_local_operation_with_properties::do_compute_local (db::Layout *layout, const shape_interactions, db::object_with_properties > &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +check_local_operation_with_properties::do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions, db::object_with_properties > &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { tl_assert (results.size () == 1); @@ -766,7 +770,7 @@ check_local_operation_with_properties::do_compute_local (db::Layout *lay const std::set &intruders = s2p->second.second; // perform the basic check - check_local_operation_base::compute_results (layout, subjects, intruders, result, intra_polygon_result); + check_local_operation_base::compute_results (layout, subject_cell, subjects, intruders, result, intra_polygon_result, proc); // detect and remove parts of the result which have or do not have results "opposite" // ("opposite" is defined by the projection of edges "through" the subject shape) @@ -852,7 +856,7 @@ db::Coord interacting_local_operation::dist () const } template -void interacting_local_operation::do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +void interacting_local_operation::do_compute_local (db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { if (m_output_mode == None) { return; @@ -1031,7 +1035,7 @@ db::Coord contained_local_operation::dist () const } template -void contained_local_operation::do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +void contained_local_operation::do_compute_local (db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { if (m_output_mode == None) { return; @@ -1106,7 +1110,7 @@ db::Coord pull_local_operation::dist () const } template -void pull_local_operation::do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +void pull_local_operation::do_compute_local (db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == 1); std::unordered_set &result = results.front (); @@ -1186,7 +1190,7 @@ db::Coord interacting_with_edge_local_operation::dist () const } template -void interacting_with_edge_local_operation::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +void interacting_with_edge_local_operation::do_compute_local (db::Layout *layout, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { if (m_output_mode == None) { return; @@ -1313,7 +1317,7 @@ db::Coord pull_with_edge_local_operation::dist () const } template -void pull_with_edge_local_operation::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +void pull_with_edge_local_operation::do_compute_local (db::Layout *layout, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == 1); std::unordered_set &result = results.front (); @@ -1374,7 +1378,7 @@ db::Coord pull_with_text_local_operation::dist () const } template -void pull_with_text_local_operation::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +void pull_with_text_local_operation::do_compute_local (db::Layout *layout, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == 1); std::unordered_set &result = results.front (); @@ -1443,7 +1447,7 @@ db::Coord interacting_with_text_local_operation::dist () const template -void interacting_with_text_local_operation::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +void interacting_with_text_local_operation::do_compute_local (db::Layout *layout, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { if (m_output_mode == None) { return; @@ -1555,7 +1559,7 @@ bool_and_or_not_local_operation::description () const template void -bool_and_or_not_local_operation::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +bool_and_or_not_local_operation::do_compute_local (db::Layout *layout, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { tl_assert (results.size () == 1); std::unordered_set &result = results.front (); @@ -1603,7 +1607,7 @@ bool_and_or_not_local_operation::do_compute_local (db::Layout *layou db::BooleanOp op (m_is_and ? db::BooleanOp::And : db::BooleanOp::ANotB); db::polygon_ref_generator pr (layout, result); - db::PolygonSplitter splitter (pr, area_ratio, max_vertex_count); + db::PolygonSplitter splitter (pr, proc->area_ratio (), proc->max_vertex_count ()); db::PolygonGenerator pg (splitter, true, true); ep.set_base_verbosity (50); ep.process (pg, op); @@ -1640,7 +1644,7 @@ bool_and_or_not_local_operation_with_properties::description () cons template void -bool_and_or_not_local_operation_with_properties::do_compute_local (db::Layout *layout, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &results, size_t max_vertex_count, double area_ratio) const +bool_and_or_not_local_operation_with_properties::do_compute_local (db::Layout *layout, db::Cell * /*cell*/, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &results, const db::LocalProcessorBase *proc) const { tl_assert (results.size () == 1); std::unordered_set > &result = results.front (); @@ -1717,7 +1721,7 @@ bool_and_or_not_local_operation_with_properties::do_compute_local (d db::BooleanOp op (m_is_and ? db::BooleanOp::And : db::BooleanOp::ANotB); db::polygon_ref_generator_with_properties > pr (layout, result, prop_id); - db::PolygonSplitter splitter (pr, area_ratio, max_vertex_count); + db::PolygonSplitter splitter (pr, proc->area_ratio (), proc->max_vertex_count ()); db::PolygonGenerator pg (splitter, true, true); ep.set_base_verbosity (50); ep.process (pg, op); @@ -1742,7 +1746,7 @@ two_bool_and_not_local_operation::two_bool_and_not_local_operation ( template void -two_bool_and_not_local_operation::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const +two_bool_and_not_local_operation::do_compute_local (db::Layout *layout, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { tl_assert (results.size () == 2); @@ -1788,12 +1792,12 @@ two_bool_and_not_local_operation::do_compute_local (db::Layout *layo db::BooleanOp op0 (db::BooleanOp::And); db::polygon_ref_generator pr0 (layout, result0); - db::PolygonSplitter splitter0 (pr0, area_ratio, max_vertex_count); + db::PolygonSplitter splitter0 (pr0, proc->area_ratio (), proc->max_vertex_count ()); db::PolygonGenerator pg0 (splitter0, true, true); db::BooleanOp op1 (db::BooleanOp::ANotB); db::polygon_ref_generator pr1 (layout, result1); - db::PolygonSplitter splitter1 (pr1, area_ratio, max_vertex_count); + db::PolygonSplitter splitter1 (pr1, proc->area_ratio (), proc->max_vertex_count ()); db::PolygonGenerator pg1 (splitter1, true, true); ep.set_base_verbosity (50); @@ -1829,7 +1833,7 @@ two_bool_and_not_local_operation_with_properties::two_bool_and_not_l template void -two_bool_and_not_local_operation_with_properties::do_compute_local (db::Layout *layout, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &results, size_t max_vertex_count, double area_ratio) const +two_bool_and_not_local_operation_with_properties::do_compute_local (db::Layout *layout, db::Cell * /*cell*/, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &results, const db::LocalProcessorBase *proc) const { tl_assert (results.size () == 2); std::unordered_set > &result0 = results [0]; @@ -1904,12 +1908,12 @@ two_bool_and_not_local_operation_with_properties::do_compute_local ( db::BooleanOp op0 (db::BooleanOp::And); db::polygon_ref_generator pr0 (layout, result0_wo_props); - db::PolygonSplitter splitter0 (pr0, area_ratio, max_vertex_count); + db::PolygonSplitter splitter0 (pr0, proc->area_ratio (), proc->max_vertex_count ()); db::PolygonGenerator pg0 (splitter0, true, true); db::BooleanOp op1 (db::BooleanOp::ANotB); db::polygon_ref_generator pr1 (layout, result1_wo_props); - db::PolygonSplitter splitter1 (pr1, area_ratio, max_vertex_count); + db::PolygonSplitter splitter1 (pr1, proc->area_ratio (), proc->max_vertex_count ()); db::PolygonGenerator pg1 (splitter1, true, true); ep.set_base_verbosity (50); @@ -1949,7 +1953,7 @@ SelfOverlapMergeLocalOperation::SelfOverlapMergeLocalOperation (unsigned int wra } void -SelfOverlapMergeLocalOperation::do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +SelfOverlapMergeLocalOperation::do_compute_local (db::Layout *layout, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { tl_assert (results.size () == 1); std::unordered_set &result = results.front (); @@ -2021,7 +2025,7 @@ PolygonToEdgeLocalOperation::description () const } void -PolygonToEdgeLocalOperation::do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const +PolygonToEdgeLocalOperation::do_compute_local (db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const { db::EdgeProcessor ep; ep.set_base_verbosity (50); diff --git a/src/db/db/dbRegionLocalOperations.h b/src/db/db/dbRegionLocalOperations.h index f5e4a238a..76166715b 100644 --- a/src/db/db/dbRegionLocalOperations.h +++ b/src/db/db/dbRegionLocalOperations.h @@ -236,7 +236,7 @@ protected: bool m_other_is_merged; db::RegionCheckOptions m_options; - void compute_results (db::Layout *layout, const std::vector &subjects, const std::set &intruders, std::unordered_set &result, std::unordered_set &intra_polygon_result) const; + void compute_results (db::Layout *layout, db::Cell *subject_cell, const std::vector &subjects, const std::set &intruders, std::unordered_set &result, std::unordered_set &intra_polygon_result, const LocalProcessorBase *proc) const; void apply_opposite_filter (const std::vector &subjects, std::unordered_set &result, std::unordered_set &intra_polygon_result) const; void apply_rectangle_filter (const std::vector &subjects, std::unordered_set &result) const; }; @@ -253,7 +253,7 @@ public: virtual bool requests_single_subjects () const { return true; } virtual std::string description () const; - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const; }; template @@ -268,7 +268,7 @@ public: virtual bool requests_single_subjects () const { return true; } virtual std::string description () const; - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions, db::object_with_properties > &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions, db::object_with_properties > &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const; private: mutable db::PropertyMapper m_pms, m_pmi; @@ -288,7 +288,7 @@ public: interacting_local_operation (int mode, bool touching, InteractingOutputMode output_mode, size_t min_count, size_t max_count, bool other_is_merged); virtual db::Coord dist () const; - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const; virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual std::string description () const; @@ -310,7 +310,7 @@ public: pull_local_operation (int mode, bool touching); virtual db::Coord dist () const; - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const; virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual std::string description () const; @@ -329,7 +329,7 @@ public: interacting_with_edge_local_operation (InteractingOutputMode output_mode, size_t min_count, size_t max_count, bool other_is_merged); virtual db::Coord dist () const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const; virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual std::string description () const; @@ -349,7 +349,7 @@ public: pull_with_edge_local_operation (); virtual db::Coord dist () const; - virtual void do_compute_local (db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const; virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual std::string description () const; }; @@ -364,7 +364,7 @@ public: interacting_with_text_local_operation (InteractingOutputMode output_mode, size_t min_count, size_t max_count); virtual db::Coord dist () const; - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const; virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual std::string description () const; @@ -383,7 +383,7 @@ public: pull_with_text_local_operation (); virtual db::Coord dist () const; - virtual void do_compute_local (db::Layout *, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const; virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual std::string description () const; }; @@ -398,7 +398,7 @@ public: contained_local_operation (InteractingOutputMode output_mode); virtual db::Coord dist () const; - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const LocalProcessorBase * /*proc*/) const; virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual std::string description () const; @@ -421,7 +421,7 @@ class DB_PUBLIC bool_and_or_not_local_operation public: bool_and_or_not_local_operation (bool is_and); - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &result, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &result, const db::LocalProcessorBase *proc) const; virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual std::string description () const; @@ -441,7 +441,7 @@ class DB_PUBLIC bool_and_or_not_local_operation_with_properties public: bool_and_or_not_local_operation_with_properties (bool is_and, db::PropertiesRepository *target_pr, const db::PropertiesRepository *subject_pr, const db::PropertiesRepository *intruder_pr, db::PropertyConstraint property_constraint); - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &result, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &result, const db::LocalProcessorBase *proc) const; virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual std::string description () const; @@ -468,7 +468,7 @@ class DB_PUBLIC two_bool_and_not_local_operation public: two_bool_and_not_local_operation (); - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &result, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &result, const db::LocalProcessorBase *proc) const; virtual std::string description () const; }; @@ -487,7 +487,7 @@ class DB_PUBLIC two_bool_and_not_local_operation_with_properties public: two_bool_and_not_local_operation_with_properties (db::PropertiesRepository *target1_pr, db::PropertiesRepository *target2_pr, const db::PropertiesRepository *subject_pr, const db::PropertiesRepository *intruder_pr, db::PropertyConstraint property_constraint); - virtual void do_compute_local (db::Layout *layout, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &result, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &result, const db::LocalProcessorBase *proc) const; virtual std::string description () const; private: @@ -508,7 +508,7 @@ class DB_PUBLIC SelfOverlapMergeLocalOperation public: SelfOverlapMergeLocalOperation (unsigned int wrap_count); - virtual void do_compute_local (db::Layout *layout, const shape_interactions &interactions, std::vector > &result, size_t max_vertex_count, double area_ratio) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &result, const db::LocalProcessorBase *proc) const; virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual std::string description () const; @@ -529,7 +529,7 @@ public: virtual bool requests_single_subjects () const { return true; } virtual std::string description () const; - virtual void do_compute_local (db::Layout * /*layout*/, const shape_interactions &interactions, std::vector > &results, size_t /*max_vertex_count*/, double /*area_ratio*/) const; + virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const; private: mutable db::PropertyMapper m_pm; diff --git a/src/db/unit_tests/dbHierProcessorTests.cc b/src/db/unit_tests/dbHierProcessorTests.cc index 504f36c2e..452b092c5 100644 --- a/src/db/unit_tests/dbHierProcessorTests.cc +++ b/src/db/unit_tests/dbHierProcessorTests.cc @@ -61,7 +61,7 @@ public: // .. nothing yet .. } - virtual void do_compute_local (db::Layout *layout, const db::shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (db::Layout *layout, const db::shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { db::shape_interactions sized_interactions = interactions; for (db::shape_interactions::iterator i = sized_interactions.begin (); i != sized_interactions.end (); ++i) { @@ -73,7 +73,7 @@ public: } } - db::BoolAndOrNotLocalOperation::do_compute_local (layout, sized_interactions, results, max_vertex_count, area_ratio); + db::BoolAndOrNotLocalOperation::do_compute_local (layout, sized_interactions, results, proc); } db::Coord dist () const @@ -98,7 +98,7 @@ public: // .. nothing yet .. } - virtual void do_compute_local (db::Layout *layout, const db::shape_interactions &interactions, std::vector > &results, size_t max_vertex_count, double area_ratio) const + virtual void do_compute_local (db::Layout *layout, const db::shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { db::shape_interactions sized_interactions = interactions; for (db::shape_interactions::iterator i = sized_interactions.begin (); i != sized_interactions.end (); ++i) { @@ -119,7 +119,7 @@ public: } - SelfOverlapMergeLocalOperation::do_compute_local (layout, sized_interactions, results, max_vertex_count, area_ratio); + SelfOverlapMergeLocalOperation::do_compute_local (layout, sized_interactions, results, proc); } db::Coord dist () const From 01b65d3699763643e8e2b77c85131cb69cd27196 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 17 Nov 2023 00:13:20 +0100 Subject: [PATCH 02/14] WIP --- src/db/unit_tests/dbHierProcessorTests.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/db/unit_tests/dbHierProcessorTests.cc b/src/db/unit_tests/dbHierProcessorTests.cc index 452b092c5..36fe6b904 100644 --- a/src/db/unit_tests/dbHierProcessorTests.cc +++ b/src/db/unit_tests/dbHierProcessorTests.cc @@ -61,7 +61,7 @@ public: // .. nothing yet .. } - virtual void do_compute_local (db::Layout *layout, const db::shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const + virtual void do_compute_local (db::Layout *layout, db::Cell *cell, const db::shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { db::shape_interactions sized_interactions = interactions; for (db::shape_interactions::iterator i = sized_interactions.begin (); i != sized_interactions.end (); ++i) { @@ -73,7 +73,7 @@ public: } } - db::BoolAndOrNotLocalOperation::do_compute_local (layout, sized_interactions, results, proc); + db::BoolAndOrNotLocalOperation::do_compute_local (layout, cell, sized_interactions, results, proc); } db::Coord dist () const @@ -98,7 +98,7 @@ public: // .. nothing yet .. } - virtual void do_compute_local (db::Layout *layout, const db::shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const + virtual void do_compute_local (db::Layout *layout, db::Cell *cell, const db::shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { db::shape_interactions sized_interactions = interactions; for (db::shape_interactions::iterator i = sized_interactions.begin (); i != sized_interactions.end (); ++i) { @@ -119,7 +119,7 @@ public: } - SelfOverlapMergeLocalOperation::do_compute_local (layout, sized_interactions, results, proc); + SelfOverlapMergeLocalOperation::do_compute_local (layout, cell, sized_interactions, results, proc); } db::Coord dist () const From 1b01d6e20a703036963206e41609b982f7f877ca Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 17 Nov 2023 00:21:15 +0100 Subject: [PATCH 03/14] First version that works with the test case --- src/db/db/dbDeepRegion.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index df87000ae..e33e40468 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -1953,15 +1953,13 @@ DeepRegion::run_check (db::edge_relation_type rel, bool different_polygons, cons const db::DeepLayer &polygons = needs_merged_primary ? merged_deep_layer () : deep_layer (); - { - // create cell variants for magnification if needed + // create cell variants for magnification if needed - db::cell_variants_collector vars; - vars.collect (polygons.layout (), polygons.initial_cell ()); + db::cell_variants_collector vars; + vars.collect (polygons.layout (), polygons.initial_cell ()); - // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? - const_cast (polygons).separate_variants (vars); - } + // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? + const_cast (polygons).separate_variants (vars); if (other_deep && &other_deep->deep_layer ().layout () != &polygons.layout ()) { @@ -2002,6 +2000,7 @@ DeepRegion::run_check (db::edge_relation_type rel, bool different_polygons, cons subject_breakout_cells, intruder_breakout_cells); configure_proc (proc); + proc.set_vars (&vars); proc.set_threads (polygons.store ()->threads ()); proc.run (&op, polygons.layer (), other_layer, res->deep_layer ().layer ()); @@ -2015,6 +2014,7 @@ DeepRegion::run_check (db::edge_relation_type rel, bool different_polygons, cons subject_breakout_cells, intruder_breakout_cells); configure_proc (proc); + proc.set_vars (&vars); proc.set_threads (polygons.store ()->threads ()); proc.run (&op, polygons.layer (), other_layer, res->deep_layer ().layer ()); From 37334d40b973151156de1865e4f10ca4a07f57ca Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 18 Nov 2023 11:09:31 +0100 Subject: [PATCH 04/14] WIP --- src/db/db/dbCompoundOperation.cc | 34 ++++- src/db/db/dbCompoundOperation.h | 216 ++++++++++++++++++++++++++++--- src/db/db/dbDeepEdges.cc | 33 ++++- src/db/db/dbDeepRegion.cc | 20 +++ src/db/db/dbHierProcessor.cc | 2 +- src/db/db/dbHierProcessor.h | 5 + src/db/db/dbRegionUtils.h | 3 + 7 files changed, 287 insertions(+), 26 deletions(-) diff --git a/src/db/db/dbCompoundOperation.cc b/src/db/db/dbCompoundOperation.cc index a9c232ed0..64a31a17b 100644 --- a/src/db/db/dbCompoundOperation.cc +++ b/src/db/db/dbCompoundOperation.cc @@ -1298,6 +1298,16 @@ CompoundRegionProcessingOperationNode::processed (db::Layout *layout, const db:: } } +void +CompoundRegionProcessingOperationNode::processed (db::Layout *layout, const db::polygon_ref &p, std::vector &res) const +{ + std::vector poly; + mp_proc->process (p.obj ().transformed (p.trans ()), poly); + for (std::vector::const_iterator p = poly.begin (); p != poly.end (); ++p) { + res.push_back (db::PolygonRef (*p, layout->shape_repository ())); + } +} + // --------------------------------------------------------------------------------------------- CompoundRegionToEdgeProcessingOperationNode::CompoundRegionToEdgeProcessingOperationNode (PolygonToEdgeProcessorBase *proc, CompoundRegionOperationNode *input, bool owns_proc) @@ -1338,6 +1348,12 @@ CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db:: mp_proc->process (p.obj ().transformed (p.trans ()), res); } +void +CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const +{ + mp_proc->process (p.obj ().transformed (p.trans ()), res); +} + // --------------------------------------------------------------------------------------------- CompoundRegionEdgeProcessingOperationNode::CompoundRegionEdgeProcessingOperationNode (EdgeProcessorBase *proc, CompoundRegionOperationNode *input, bool owns_proc) @@ -1456,6 +1472,12 @@ CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const mp_proc->process (p.obj ().transformed (p.trans ()), res); } +void +CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const +{ + mp_proc->process (p.obj ().transformed (p.trans ()), res); +} + // --------------------------------------------------------------------------------------------- CompoundRegionEdgePairToPolygonProcessingOperationNode::CompoundRegionEdgePairToPolygonProcessingOperationNode (EdgePairToPolygonProcessorBase *proc, CompoundRegionOperationNode *input, bool owns_proc) @@ -1593,9 +1615,13 @@ CompoundRegionCheckOperationNode::computed_dist () const void CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { + // consider magnification variants + db::EdgeRelationFilter check = m_check; + check.set_distance (proc->dist_for_cell (cell, check.distance ())); + // TODO: needs a concept to deal with merged/non-merged inputs bool is_merged = true; - db::check_local_operation op (m_check, m_different_polygons, is_merged, m_has_other, m_is_other_merged, m_options); + db::check_local_operation op (check, m_different_polygons, is_merged, m_has_other, m_is_other_merged, m_options); tl_assert (results.size () == 1); if (results.front ().empty ()) { @@ -1611,9 +1637,13 @@ CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache void CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { + // consider magnification variants + db::EdgeRelationFilter check = m_check; + check.set_distance (proc->dist_for_cell (cell, check.distance ())); + // TODO: needs a concept to deal with merged/non-merged inputs bool is_merged = true; - db::check_local_operation op (m_check, m_different_polygons, is_merged, m_has_other, m_is_other_merged, m_options); + db::check_local_operation op (check, m_different_polygons, is_merged, m_has_other, m_is_other_merged, m_options); tl_assert (results.size () == 1); if (results.front ().empty ()) { diff --git a/src/db/db/dbCompoundOperation.h b/src/db/db/dbCompoundOperation.h index d65b96ec7..04872fa9e 100644 --- a/src/db/db/dbCompoundOperation.h +++ b/src/db/db/dbCompoundOperation.h @@ -1138,6 +1138,7 @@ private: void processed (db::Layout *, const db::Polygon &p, std::vector &res) const; void processed (db::Layout *, const db::PolygonRef &p, std::vector &res) const; + void processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const; template void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const @@ -1149,9 +1150,33 @@ private: std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { + res.clear (); - processed (layout, *p, res); - results.front ().insert (res.begin (), res.end ()); + + if (proc->vars ()) { + + // in the presence of variants, handle the object in top level space + + const std::map &vv = proc->vars ()->variants (cell->cell_index ()); + tl_assert (vv.size () == 1); + const db::ICplxTrans &tr = vv.begin ()->first; + processed (layout, tr * *p, res); + + if (! res.empty ()) { + db::ICplxTrans tri = tr.inverted (); + for (auto r = res.begin (); r != res.end (); ++r) { + results.front ().insert (tri * *r); + } + } + + } else { + + processed (layout, *p, res); + + results.front ().insert (res.begin (), res.end ()); + + } + } } }; @@ -1175,7 +1200,6 @@ public: private: db::PolygonSizer m_proc; - CompoundTransformationReducer m_vars; }; class DB_PUBLIC CompoundRegionMergeOperationNode @@ -1286,9 +1310,33 @@ private: std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { + res.clear (); - processed (layout, *p, res); - results.front ().insert (res.begin (), res.end ()); + + if (proc->vars ()) { + + // in the presence of variants, handle the object in top level space + + const std::map &vv = proc->vars ()->variants (cell->cell_index ()); + tl_assert (vv.size () == 1); + const db::ICplxTrans &tr = vv.begin ()->first; + processed (layout, tr * *p, res); + + if (! res.empty ()) { + db::ICplxTrans tri = tr.inverted (); + for (auto r = res.begin (); r != res.end (); ++r) { + results.front ().insert (tri * *r); + } + } + + } else { + + processed (layout, *p, res); + + results.front ().insert (res.begin (), res.end ()); + + } + } } }; @@ -1331,9 +1379,33 @@ private: std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { + res.clear (); - processed (layout, *p, res); - results.front ().insert (res.begin (), res.end ()); + + if (proc->vars ()) { + + // in the presence of variants, handle the object in top level space + + const std::map &vv = proc->vars ()->variants (cell->cell_index ()); + tl_assert (vv.size () == 1); + const db::ICplxTrans &tr = vv.begin ()->first; + processed (layout, tr * *p, res); + + if (! res.empty ()) { + db::ICplxTrans tri = tr.inverted (); + for (auto r = res.begin (); r != res.end (); ++r) { + results.front ().insert (tri * *r); + } + } + + } else { + + processed (layout, *p, res); + + results.front ().insert (res.begin (), res.end ()); + + } + } } }; @@ -1377,9 +1449,33 @@ private: std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { + res.clear (); - processed (layout, *p, res); - results.front ().insert (res.begin (), res.end ()); + + if (proc->vars ()) { + + // in the presence of variants, handle the object in top level space + + const std::map &vv = proc->vars ()->variants (cell->cell_index ()); + tl_assert (vv.size () == 1); + const db::ICplxTrans &tr = vv.begin ()->first; + processed (layout, tr * *p, res); + + if (! res.empty ()) { + db::ICplxTrans tri = tr.inverted (); + for (auto r = res.begin (); r != res.end (); ++r) { + results.front ().insert (tri * *r); + } + } + + } else { + + processed (layout, *p, res); + + results.front ().insert (res.begin (), res.end ()); + + } + } } }; @@ -1420,9 +1516,33 @@ private: std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { + res.clear (); - mp_proc->process (*p, res); - results.front ().insert (res.begin (), res.end ()); + + if (proc->vars ()) { + + // in the presence of variants, handle the object in top level space + + const std::map &vv = proc->vars ()->variants (cell->cell_index ()); + tl_assert (vv.size () == 1); + const db::ICplxTrans &tr = vv.begin ()->first; + mp_proc->process (tr * *p, res); + + if (! res.empty ()) { + db::ICplxTrans tri = tr.inverted (); + for (auto r = res.begin (); r != res.end (); ++r) { + results.front ().insert (tri * *r); + } + } + + } else { + + mp_proc->process (*p, res); + + results.front ().insert (res.begin (), res.end ()); + + } + } } }; @@ -1455,6 +1575,7 @@ private: void processed (db::Layout *, const db::Polygon &p, std::vector &res) const; void processed (db::Layout *layout, const db::PolygonRef &p, std::vector &res) const; + void processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const; template void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const @@ -1466,9 +1587,33 @@ private: std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { + res.clear (); - processed (layout, *p, res); - results.front ().insert (res.begin (), res.end ()); + + if (proc->vars ()) { + + // in the presence of variants, handle the object in top level space + + const std::map &vv = proc->vars ()->variants (cell->cell_index ()); + tl_assert (vv.size () == 1); + const db::ICplxTrans &tr = vv.begin ()->first; + processed (layout, tr * *p, res); + + if (! res.empty ()) { + db::ICplxTrans tri = tr.inverted (); + for (auto r = res.begin (); r != res.end (); ++r) { + results.front ().insert (tri * *r); + } + } + + } else { + + processed (layout, *p, res); + + results.front ().insert (res.begin (), res.end ()); + + } + } } }; @@ -1506,11 +1651,12 @@ public: virtual void do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions & /*interactions*/, std::vector > & /*results*/, const db::LocalProcessorBase * /*proc*/) const { } private: - PolygonToEdgePairProcessorBase *mp_proc; + PolygonToEdgePairProcessorBase *mp_proc; bool m_owns_proc; void processed (db::Layout *, const db::Polygon &p, std::vector &res) const; void processed (db::Layout *layout, const db::PolygonRef &p, std::vector &res) const; + void processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const; template void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const @@ -1522,9 +1668,33 @@ private: std::vector res; for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { + res.clear (); - processed (layout, *p, res); - results.front ().insert (res.begin (), res.end ()); + + if (proc->vars ()) { + + // in the presence of variants, handle the object in top level space + + const std::map &vv = proc->vars ()->variants (cell->cell_index ()); + tl_assert (vv.size () == 1); + const db::ICplxTrans &tr = vv.begin ()->first; + processed (layout, tr * *p, res); + + if (! res.empty ()) { + db::ICplxTrans tri = tr.inverted (); + for (auto r = res.begin (); r != res.end (); ++r) { + results.front ().insert (tri * *r); + } + } + + } else { + + processed (layout, *p, res); + + results.front ().insert (res.begin (), res.end ()); + + } + } } }; @@ -1560,6 +1730,9 @@ public: virtual OnEmptyIntruderHint on_empty_intruder_hint () const; virtual db::Coord computed_dist () const; + virtual const TransformationReducer *vars () const { return &m_vars; } + virtual bool wants_variants () const { return true; } + virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const LocalProcessorBase *proc) const; virtual void do_compute_local (CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const LocalProcessorBase *proc) const; @@ -1575,6 +1748,7 @@ private: db::RegionCheckOptions m_options; bool m_has_other; bool m_is_other_merged; + db::MagnificationReducer m_vars; }; @@ -1599,6 +1773,9 @@ public: : mp_node (node) { } + const TransformationReducer *vars () const { return mp_node->vars (); } + bool wants_variants () const { return mp_node->wants_variants (); } + protected: virtual void do_compute_local (db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { @@ -1611,8 +1788,6 @@ protected: virtual bool requests_single_subjects () const { return true; } virtual std::string description () const { return mp_node->description (); } - const TransformationReducer *vars () const { return mp_node->vars (); } - bool wants_variants () const { return mp_node->wants_variants (); } std::vector inputs () const { return mp_node->inputs (); } private: @@ -1645,6 +1820,9 @@ public: } } + const TransformationReducer *vars () const { return mp_node->vars (); } + bool wants_variants () const { return mp_node->wants_variants (); } + protected: virtual void do_compute_local (db::Layout *layout, db::Cell *cell, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &results, const db::LocalProcessorBase *proc) const { @@ -1671,8 +1849,6 @@ protected: virtual bool requests_single_subjects () const { return true; } virtual std::string description () const { return mp_node->description (); } - const TransformationReducer *vars () const { return mp_node->vars (); } - bool wants_variants () const { return mp_node->wants_variants (); } std::vector inputs () const { return mp_node->inputs (); } private: diff --git a/src/db/db/dbDeepEdges.cc b/src/db/db/dbDeepEdges.cc index 38428d3fc..ae584c443 100644 --- a/src/db/db/dbDeepEdges.cc +++ b/src/db/db/dbDeepEdges.cc @@ -1941,12 +1941,16 @@ public: // .. nothing yet .. } - virtual void do_compute_local (db::Layout * /*layout*/, db::Cell * /*cell*/, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const + virtual void do_compute_local (db::Layout * /*layout*/, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { tl_assert (results.size () == 1); std::unordered_set &result = results.front (); - edge2edge_check_for_edges > edge_check (m_check, result, m_has_other); + // implement check in local coordinates in the presence of magnification variants + EdgeRelationFilter check = m_check; + check.set_distance (proc->dist_for_cell (cell, check.distance ())); + + edge2edge_check_for_edges > edge_check (check, result, m_has_other); db::box_scanner scanner; std::set others; @@ -1989,7 +1993,7 @@ public: } - scanner.process (edge_check, m_check.distance (), db::box_convert ()); + scanner.process (edge_check, check.distance (), db::box_convert ()); } virtual db::Coord dist () const @@ -2028,6 +2032,28 @@ DeepEdges::run_check (db::edge_relation_type rel, const Edges *other, db::Coord const db::DeepLayer &edges = merged_deep_layer (); + // create cell variants for magnification if needed + + db::cell_variants_collector vars; + vars.collect (edges.layout (), edges.initial_cell ()); + + // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? + const_cast (edges).separate_variants (vars); + + if (other_deep && &other_deep->deep_layer ().layout () != &edges.layout ()) { + + // create cell variants for magnification for the other input if needed + + const db::DeepLayer &other_layer = other_deep->deep_layer (); + + db::cell_variants_collector vars; + vars.collect (other_layer.layout (), other_layer.initial_cell ()); + + // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? + const_cast (other_layer).separate_variants (vars); + + } + EdgeRelationFilter check (rel, d, options.metrics); check.set_include_zero (false); check.set_whole_edges (options.whole_edges); @@ -2045,6 +2071,7 @@ DeepEdges::run_check (db::edge_relation_type rel, const Edges *other, db::Coord other_deep ? &other_deep->deep_layer ().initial_cell () : const_cast (&edges.initial_cell ())); proc.set_base_verbosity (base_verbosity ()); + proc.set_vars (&vars); proc.set_threads (edges.store ()->threads ()); proc.run (&op, edges.layer (), other_deep ? other_deep->deep_layer ().layer () : edges.layer (), res->deep_layer ().layer ()); diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index e33e40468..cb8510e93 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -1799,6 +1799,16 @@ Output *region_cop_impl (DeepRegion *region, db::CompoundRegionOperationNode &no } compound_local_operation op (&node); + + // Prepare cell variants if needed + db::VariantsCollectorBase vc (op.vars ()); + if (op.wants_variants ()) { + vc.collect (polygons.layout (), polygons.initial_cell ()); + // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? + const_cast (polygons).separate_variants (vc); + proc.set_vars (&vc); + } + proc.run (&op, polygons.layer (), other_layers, res->deep_layer ().layer ()); return res.release (); @@ -1852,6 +1862,16 @@ Output *region_cop_with_properties_impl (DeepRegion *region, db::CompoundRegionO } compound_local_operation_with_properties op (&node, prop_constraint, res->properties_repository (), subject_pr, intruder_prs); + + // Prepare cell variants if needed + db::VariantsCollectorBase vc (op.vars ()); + if (op.wants_variants ()) { + vc.collect (polygons.layout (), polygons.initial_cell ()); + // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? + const_cast (polygons).separate_variants (vc); + proc.set_vars (&vc); + } + proc.run (&op, polygons.layer (), other_layers, res->deep_layer ().layer ()); return res.release (); diff --git a/src/db/db/dbHierProcessor.cc b/src/db/db/dbHierProcessor.cc index 3529db310..b93f96f35 100644 --- a/src/db/db/dbHierProcessor.cc +++ b/src/db/db/dbHierProcessor.cc @@ -1143,7 +1143,7 @@ public: db::Box ref_box = db::box_convert () (*ref); for (db::CellInstArray::iterator n = inst->begin_touching (safe_box_enlarged (ref_box, m_dist - 1, m_dist - 1), inst_bc); !n.at_end (); ++n) { db::ICplxTrans tn = inst->complex_trans (*n); - db::Box region = ref_box.transformed (tn.inverted ()).enlarged (db::Vector (m_dist, m_dist)) & intruder_cell.bbox (m_intruder_layer).enlarged (db::Vector (m_dist, m_dist)); + db::Box region = ref_box.enlarged (db::Vector (m_dist, m_dist)).transformed (tn.inverted ()) & intruder_cell.bbox (m_intruder_layer) /*.enlarged (db::Vector (m_dist, m_dist))@@@*/; if (! region.empty ()) { add_shapes_from_intruder_inst (id1, intruder_cell, tn, inst_id, region); } diff --git a/src/db/db/dbHierProcessor.h b/src/db/db/dbHierProcessor.h index 416b2612f..e0f6a9778 100644 --- a/src/db/db/dbHierProcessor.h +++ b/src/db/db/dbHierProcessor.h @@ -490,6 +490,11 @@ public: mp_vars = vars; } + const db::VariantsCollectorBase *vars () const + { + return mp_vars; + } + db::Coord dist_for_cell (db::cell_index_type cell_index, db::Coord dist) const; db::Coord dist_for_cell (const db::Cell *cell, db::Coord dist) const; diff --git a/src/db/db/dbRegionUtils.h b/src/db/db/dbRegionUtils.h index cd423fc0f..a213f26c2 100644 --- a/src/db/db/dbRegionUtils.h +++ b/src/db/db/dbRegionUtils.h @@ -593,11 +593,14 @@ public: SinglePolygonCheck (db::edge_relation_type rel, db::Coord d, const RegionCheckOptions &options); virtual void process (const db::Polygon &polygon, std::vector &res) const; + virtual const TransformationReducer *vars () const { return &m_vars; } + virtual bool wants_variants () const { return true; } private: db::edge_relation_type m_relation; db::Coord m_d; db::RegionCheckOptions m_options; + db::MagnificationReducer m_vars; }; } // namespace db From c36871025349827e5b7ad6469e5288b13ab0773a Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 18 Nov 2023 12:35:34 +0100 Subject: [PATCH 05/14] Further bug fixes in generic DRC domain --- src/db/db/dbCompoundOperation.cc | 10 +++++----- src/db/db/dbDeepRegion.cc | 5 +++-- src/db/db/dbRegionUtils.h | 4 ++-- testdata/drc/drcGenericTests_au12d.gds | Bin 8916 -> 9370 bytes testdata/drc/drcGenericTests_au14d.gds | Bin 2752 -> 2952 bytes 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/db/db/dbCompoundOperation.cc b/src/db/db/dbCompoundOperation.cc index 64a31a17b..1a8c68732 100644 --- a/src/db/db/dbCompoundOperation.cc +++ b/src/db/db/dbCompoundOperation.cc @@ -245,7 +245,7 @@ CompoundTransformationReducer::reduce_trans (const db::Trans &trans) const { db::Trans t = trans; for (std::vector::const_iterator v = m_vars.begin (); v != m_vars.end (); ++v) { - (*v)->reduce_trans (t); + t = (*v)->reduce_trans (t); } return t; } @@ -255,7 +255,7 @@ CompoundTransformationReducer::reduce_trans (const db::ICplxTrans &trans) const { db::ICplxTrans t = trans; for (std::vector::const_iterator v = m_vars.begin (); v != m_vars.end (); ++v) { - (*v)->reduce_trans (t); + t = (*v)->reduce_trans (t); } return t; } @@ -265,7 +265,7 @@ CompoundTransformationReducer::reduce (const db::Trans &trans) const { db::Trans t = trans; for (std::vector::const_iterator v = m_vars.begin (); v != m_vars.end (); ++v) { - (*v)->reduce (t); + t = (*v)->reduce (t); } return t; } @@ -275,7 +275,7 @@ CompoundTransformationReducer::reduce (const db::ICplxTrans &trans) const { db::ICplxTrans t = trans; for (std::vector::const_iterator v = m_vars.begin (); v != m_vars.end (); ++v) { - (*v)->reduce (t); + t = (*v)->reduce (t); } return t; } @@ -403,7 +403,7 @@ CompoundRegionMultiInputOperationNode::child (unsigned int index) const const TransformationReducer * CompoundRegionMultiInputOperationNode::vars () const { - return (m_vars.is_empty () ? &m_vars : 0); + return (m_vars.is_empty () ? 0 : &m_vars); } bool diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index cb8510e93..897a14ec6 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -1801,8 +1801,9 @@ Output *region_cop_impl (DeepRegion *region, db::CompoundRegionOperationNode &no compound_local_operation op (&node); // Prepare cell variants if needed - db::VariantsCollectorBase vc (op.vars ()); - if (op.wants_variants ()) { + auto op_vars = op.vars (); + db::VariantsCollectorBase vc (op_vars); + if (op.wants_variants () && op_vars) { vc.collect (polygons.layout (), polygons.initial_cell ()); // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? const_cast (polygons).separate_variants (vc); diff --git a/src/db/db/dbRegionUtils.h b/src/db/db/dbRegionUtils.h index a213f26c2..71fd00daf 100644 --- a/src/db/db/dbRegionUtils.h +++ b/src/db/db/dbRegionUtils.h @@ -402,7 +402,7 @@ private: bool m_inverse; parameter_type m_parameter; db::MagnificationReducer m_isotropic_vars; - db::MagnificationAndOrientationReducer m_anisotropic_vars; + db::XYAnisotropyAndMagnificationReducer m_anisotropic_vars; bool check (const db::Box &box) const; }; @@ -472,7 +472,7 @@ private: bool m_inverse; parameter_type m_parameter; db::MagnificationReducer m_isotropic_vars; - db::MagnificationAndOrientationReducer m_anisotropic_vars; + db::XYAnisotropyAndMagnificationReducer m_anisotropic_vars; }; /** diff --git a/testdata/drc/drcGenericTests_au12d.gds b/testdata/drc/drcGenericTests_au12d.gds index 9a0de1bf29c1f8591d029c9b30346ec994335b7e..b4412a56ef6ca568d92087b0e10dc8fe9eb009a7 100644 GIT binary patch literal 9370 zcmbW7v2Ptk5XQ&%p3l$Diw#Lo2r@!QE|EwogcKn;q)3D%qR2vsio!q>fkTxd1x1R` zrBCAy3d$7u10rhv04jupg-{eB6d{DN?A+YEx3_oScWY8)?7RED+1s7@W_F*Yma6(# zwpXgP-{h2>k-5Afou6e^)qB^kh@6|OzPJ1BJ0JY`-LrSEK7RY?;V1jDz1n#;{S2Aa z^^M(|`!b!0)Tb+1k$STdk+)u&#Q&3juiO=x9E-S3ZcSennXU=-vtfRAE{#69**^Kv z?#)X@pZor`>w8z@lN%zlGxj#~Wc1DG`u9Tk{hkcm3*n!g=G~fmL$fkDZrC^*A^f>7 zvURky@iUw2{@Hy#gcoz=&HjB+eTCrGuVY?h?I)2_kIkOFFLL?^5x0Il+I0L?x~i)` zi>yBpQLC%Db+oj8JzBzt@ay-=hw$uE^}n=!J=%sJiHdn$H>(%JqFKKUTfg}0& zYb)P~%(qvsJc>c3|Kjr&oAKvnJ>t8~+vj!8%ZT_U$^7)jkj40p=HB{~5dMAD;!@-6 z^*#H&y`IKaqBtS^bxmW@?1cl%3%7nf#w_HY-V!-~7=l{m^z+>M_49{_*POEXQv3X} z<+fYR_4YpWuiByGRD0pT6w|F=XX8J9pt&7_+OzjV_~Xvf`gNS!nwOf3W}jbHUf;v4 zUynJPjz7@`(=}Zq)iE8f&ZAquo@v9Rt1UL>A#Koi(d*GR{@1PI9JGA>W+j!(wyf@) z)5z7;Q*~79t2R!lmU_&1+>cW)=Juv)%PFfBi}fygFa3B|eDzs68&7X(Z2Fp%QE3D= zkzF)G%K=??^%v(er9Q*!}@7Y;OsqSj+(B8~z$JlJR=9DWtSoY9+Gz-0}4V(hZtlkn#-iSt;}7PY=!^@kO$7gaQ!-sooAToq0lK z`^+NBtHNMxe2Lb}yCGAZxZtTTLXmz0Qp0CQvZ@Cu)oZBOUm*pc{rn-KTrbRKT?(Pd4iQoo^WIfvJsYIFSF_$X+er~BJ0nc> z5K?rn2Putp8=dX-I}t@F(h(7g>^LAr>ldVGB_fp00_a5{WeVULm1PQ{vQx66RrWr^ zY}QpmU*12tew3}UX0q4j-bn@Y)jc)K_LY!wMO!F$IvcnDmjV!qC;+6W0zir?0HKHi zK#D2=q^JTAiYNe~hyp;0DgdOY0uYKQ0Hmk_K#Jxvp~zV!q-ZV^ikxCWistgyIG4$3 z5245|fKa5<8==67G@(c?6N>a~kkVC#-4~?jjssG3Cj}|5TfW=wR3bu=eF~&#B^seX zXHF0CcboU?mMZhXM+^o`4WnpV?%1ubq(#82}RB-M<_qji*l8AdW0f%nNZ}c5>i&p t{j4(U=OIN;dmu%>tsqqPS09CQNWQNmzVz>Y>|5-nn{9l>zp0o`;y_$9{{OjPT$s)|-~avZ?>rs(d}Ts2v|w;t%LIbv zcP*fWwWM}R%m07ZLP2A6wr@-`J3e`|Q>S>9uhQu2oF&~=6wQh-g zmxSF_#Cpa+Iq48CaMyF`l-P2aC$QG*zgw1$dXIy1;XC*dk(f+MJdO&~vj!TDLzqB2 zQpP^{owvlIbQP_7Ovj&afoS{|Shan;Wt~MeRzPFGf8UNv#ZP2(By2z2vg6yfTpi1i z0=D`L9H$bV$7)zod`@X#PWb$j5f@|eN3aq@$n{COOAJRPcH;sZYb>tH+9kMUNxYy5 zOeRY-iK6Nv(>;U&b;dY%@jD^mm+#QsLo~{#-vZnGi4-swc5&0LVL4euE^JV#%=1$- zztvM(lm>O{yYqnAJVV2;&=3zherL~OhpLUGgj(LM-U{BQUG;8+{ByzLQ&K7&JD!7A zbhmm-;OX(5m&W#7pRT47OI7gYz_*^I1*V2*q1TzS=#(gR5ou9YXV1AIP4Esy;sGJ4MP}1}~i8Wg)*X?Xc zN&Q65Lp$x@Q%*0X8N{hm<|DjeGO_F8qm)16I!_+ig G*Zu;93|8a- diff --git a/testdata/drc/drcGenericTests_au14d.gds b/testdata/drc/drcGenericTests_au14d.gds index 1b0f1b8edfbc909322d1f6bb5c346b53a321df72..82510fd53e0ef62833159632a733de2ba585be25 100644 GIT binary patch delta 341 zcmX>g+94jrz{bGD6u}_F$i)7fftx{yfrmknK@FMBz`?}kjG18Sojxzz0gpH4qt8l I#C(no0Co^B+yDRo delta 160 zcmeAWKOh>#z{bGD6u}_F$i)7Xfsuh12w50}kl73zOl&@$P7Dkp%&c~fo#x)hmVdBx o*`dE+c2o$13@c836Qd@I<1lh^6l2k58>Vz7TnaYtVmZeK02@sjEdT%j From 877646d9595a853927041b2405bb66d30024d0e4 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 18 Nov 2023 13:40:50 +0100 Subject: [PATCH 06/14] Debugging sized operator for generic DRC, new tests --- src/db/db/dbCompoundOperation.cc | 78 +++++++++++++++++++++++--- src/db/db/dbCompoundOperation.h | 48 +++++----------- src/drc/unit_tests/drcSimpleTests.cc | 51 +++++++++++++++++ testdata/drc/drcSimpleTests_80.drc | 14 +++++ testdata/drc/drcSimpleTests_80.gds | Bin 0 -> 2138 bytes testdata/drc/drcSimpleTests_81.drc | 14 +++++ testdata/drc/drcSimpleTests_81.gds | Bin 0 -> 2138 bytes testdata/drc/drcSimpleTests_82.drc | 14 +++++ testdata/drc/drcSimpleTests_82.gds | Bin 0 -> 2138 bytes testdata/drc/drcSimpleTests_83.drc | 14 +++++ testdata/drc/drcSimpleTests_83.gds | Bin 0 -> 2138 bytes testdata/drc/drcSimpleTests_84.drc | 14 +++++ testdata/drc/drcSimpleTests_84.gds | Bin 0 -> 2138 bytes testdata/drc/drcSimpleTests_85.drc | 14 +++++ testdata/drc/drcSimpleTests_85.gds | Bin 0 -> 2138 bytes testdata/drc/drcSimpleTests_86.drc | 13 +++++ testdata/drc/drcSimpleTests_86.gds | Bin 0 -> 2138 bytes testdata/drc/drcSimpleTests_87.drc | 15 +++++ testdata/drc/drcSimpleTests_87.gds | Bin 0 -> 2138 bytes testdata/drc/drcSimpleTests_88.drc | 13 +++++ testdata/drc/drcSimpleTests_88.gds | Bin 0 -> 2138 bytes testdata/drc/drcSimpleTests_89.drc | 15 +++++ testdata/drc/drcSimpleTests_89.gds | Bin 0 -> 2138 bytes testdata/drc/drcSimpleTests_au80d.gds | Bin 0 -> 9682 bytes testdata/drc/drcSimpleTests_au81d.gds | Bin 0 -> 15890 bytes testdata/drc/drcSimpleTests_au82d.gds | Bin 0 -> 9682 bytes testdata/drc/drcSimpleTests_au83d.gds | Bin 0 -> 15890 bytes testdata/drc/drcSimpleTests_au84d.gds | Bin 0 -> 20242 bytes testdata/drc/drcSimpleTests_au85d.gds | Bin 0 -> 20690 bytes testdata/drc/drcSimpleTests_au86d.gds | Bin 0 -> 7634 bytes testdata/drc/drcSimpleTests_au87d.gds | Bin 0 -> 16808 bytes testdata/drc/drcSimpleTests_au88d.gds | Bin 0 -> 7634 bytes testdata/drc/drcSimpleTests_au89d.gds | Bin 0 -> 16808 bytes 33 files changed, 276 insertions(+), 41 deletions(-) create mode 100644 testdata/drc/drcSimpleTests_80.drc create mode 100644 testdata/drc/drcSimpleTests_80.gds create mode 100644 testdata/drc/drcSimpleTests_81.drc create mode 100644 testdata/drc/drcSimpleTests_81.gds create mode 100644 testdata/drc/drcSimpleTests_82.drc create mode 100644 testdata/drc/drcSimpleTests_82.gds create mode 100644 testdata/drc/drcSimpleTests_83.drc create mode 100644 testdata/drc/drcSimpleTests_83.gds create mode 100644 testdata/drc/drcSimpleTests_84.drc create mode 100644 testdata/drc/drcSimpleTests_84.gds create mode 100644 testdata/drc/drcSimpleTests_85.drc create mode 100644 testdata/drc/drcSimpleTests_85.gds create mode 100644 testdata/drc/drcSimpleTests_86.drc create mode 100644 testdata/drc/drcSimpleTests_86.gds create mode 100644 testdata/drc/drcSimpleTests_87.drc create mode 100644 testdata/drc/drcSimpleTests_87.gds create mode 100644 testdata/drc/drcSimpleTests_88.drc create mode 100644 testdata/drc/drcSimpleTests_88.gds create mode 100644 testdata/drc/drcSimpleTests_89.drc create mode 100644 testdata/drc/drcSimpleTests_89.gds create mode 100644 testdata/drc/drcSimpleTests_au80d.gds create mode 100644 testdata/drc/drcSimpleTests_au81d.gds create mode 100644 testdata/drc/drcSimpleTests_au82d.gds create mode 100644 testdata/drc/drcSimpleTests_au83d.gds create mode 100644 testdata/drc/drcSimpleTests_au84d.gds create mode 100644 testdata/drc/drcSimpleTests_au85d.gds create mode 100644 testdata/drc/drcSimpleTests_au86d.gds create mode 100644 testdata/drc/drcSimpleTests_au87d.gds create mode 100644 testdata/drc/drcSimpleTests_au88d.gds create mode 100644 testdata/drc/drcSimpleTests_au89d.gds diff --git a/src/db/db/dbCompoundOperation.cc b/src/db/db/dbCompoundOperation.cc index 1a8c68732..0efbde07a 100644 --- a/src/db/db/dbCompoundOperation.cc +++ b/src/db/db/dbCompoundOperation.cc @@ -1299,12 +1299,30 @@ CompoundRegionProcessingOperationNode::processed (db::Layout *layout, const db:: } void -CompoundRegionProcessingOperationNode::processed (db::Layout *layout, const db::polygon_ref &p, std::vector &res) const +CompoundRegionProcessingOperationNode::processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector &res) const +{ + size_t n = res.size (); + mp_proc->process (tr * p, res); + + if (res.size () > n) { + db::ICplxTrans tri = tr.inverted (); + for (auto p = res.begin () + n; p != res.end (); ++p) { + p->transform (tri); + } + } +} + +void +CompoundRegionProcessingOperationNode::processed (db::Layout *layout, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector &res) const { std::vector poly; - mp_proc->process (p.obj ().transformed (p.trans ()), poly); - for (std::vector::const_iterator p = poly.begin (); p != poly.end (); ++p) { - res.push_back (db::PolygonRef (*p, layout->shape_repository ())); + mp_proc->process (p.obj ().transformed (p.trans ()).transformed (tr), poly); + + if (! poly.empty ()) { + db::ICplxTrans tri = tr.inverted (); + for (std::vector::const_iterator p = poly.begin (); p != poly.end (); ++p) { + res.push_back (db::PolygonRef (tri * *p, layout->shape_repository ())); + } } } @@ -1349,9 +1367,31 @@ CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db:: } void -CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const +CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector &res) const { - mp_proc->process (p.obj ().transformed (p.trans ()), res); + size_t n = res.size (); + mp_proc->process (tr * p, res); + + if (res.size () > n) { + db::ICplxTrans tri = tr.inverted (); + for (auto p = res.begin () + n; p != res.end (); ++p) { + p->transform (tri); + } + } +} + +void +CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector &res) const +{ + size_t n = res.size (); + mp_proc->process (p.obj ().transformed (p.trans ()).transformed (tr), res); + + if (res.size () > n) { + db::ICplxTrans tri = tr.inverted (); + for (auto p = res.begin () + n; p != res.end (); ++p) { + p->transform (tri); + } + } } // --------------------------------------------------------------------------------------------- @@ -1473,9 +1513,31 @@ CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const } void -CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const +CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector &res) const { - mp_proc->process (p.obj ().transformed (p.trans ()), res); + size_t n = res.size (); + mp_proc->process (tr * p, res); + + if (res.size () > n) { + db::ICplxTrans tri = tr.inverted (); + for (auto p = res.begin () + n; p != res.end (); ++p) { + p->transform (tri); + } + } +} + +void +CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector &res) const +{ + size_t n = res.size (); + mp_proc->process (p.obj ().transformed (p.trans ()).transformed (tr), res); + + if (res.size () > n) { + db::ICplxTrans tri = tr.inverted (); + for (auto p = res.begin () + n; p != res.end (); ++p) { + p->transform (tri); + } + } } // --------------------------------------------------------------------------------------------- diff --git a/src/db/db/dbCompoundOperation.h b/src/db/db/dbCompoundOperation.h index 04872fa9e..d9cbf840f 100644 --- a/src/db/db/dbCompoundOperation.h +++ b/src/db/db/dbCompoundOperation.h @@ -1138,7 +1138,8 @@ private: void processed (db::Layout *, const db::Polygon &p, std::vector &res) const; void processed (db::Layout *, const db::PolygonRef &p, std::vector &res) const; - void processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const; + void processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector &res) const; + void processed (db::Layout *, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector &res) const; template void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const @@ -1160,23 +1161,16 @@ private: const std::map &vv = proc->vars ()->variants (cell->cell_index ()); tl_assert (vv.size () == 1); const db::ICplxTrans &tr = vv.begin ()->first; - processed (layout, tr * *p, res); - - if (! res.empty ()) { - db::ICplxTrans tri = tr.inverted (); - for (auto r = res.begin (); r != res.end (); ++r) { - results.front ().insert (tri * *r); - } - } + processed (layout, *p, tr, res); } else { processed (layout, *p, res); - results.front ().insert (res.begin (), res.end ()); - } + results.front ().insert (res.begin (), res.end ()); + } } }; @@ -1575,7 +1569,8 @@ private: void processed (db::Layout *, const db::Polygon &p, std::vector &res) const; void processed (db::Layout *layout, const db::PolygonRef &p, std::vector &res) const; - void processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const; + void processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector &res) const; + void processed (db::Layout *, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector &res) const; template void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const @@ -1597,23 +1592,16 @@ private: const std::map &vv = proc->vars ()->variants (cell->cell_index ()); tl_assert (vv.size () == 1); const db::ICplxTrans &tr = vv.begin ()->first; - processed (layout, tr * *p, res); - - if (! res.empty ()) { - db::ICplxTrans tri = tr.inverted (); - for (auto r = res.begin (); r != res.end (); ++r) { - results.front ().insert (tri * *r); - } - } + processed (layout, *p, tr, res); } else { processed (layout, *p, res); - results.front ().insert (res.begin (), res.end ()); - } + results.front ().insert (res.begin (), res.end ()); + } } }; @@ -1656,7 +1644,8 @@ private: void processed (db::Layout *, const db::Polygon &p, std::vector &res) const; void processed (db::Layout *layout, const db::PolygonRef &p, std::vector &res) const; - void processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const; + void processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector &res) const; + void processed (db::Layout *layout, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector &res) const; template void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const @@ -1678,23 +1667,16 @@ private: const std::map &vv = proc->vars ()->variants (cell->cell_index ()); tl_assert (vv.size () == 1); const db::ICplxTrans &tr = vv.begin ()->first; - processed (layout, tr * *p, res); - - if (! res.empty ()) { - db::ICplxTrans tri = tr.inverted (); - for (auto r = res.begin (); r != res.end (); ++r) { - results.front ().insert (tri * *r); - } - } + processed (layout, *p, tr, res); } else { processed (layout, *p, res); - results.front ().insert (res.begin (), res.end ()); - } + results.front ().insert (res.begin (), res.end ()); + } } }; diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index 3851b72ec..01254fabf 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -1566,3 +1566,54 @@ TEST(70d_props) { run_test (_this, "70", true); } + +TEST(80_deep_with_mag_width) +{ + run_test (_this, "80", true); +} + +TEST(81_deep_with_mag_space) +{ + run_test (_this, "81", true); +} + +TEST(82_deep_with_mag_cop_width) +{ + run_test (_this, "82", true); +} + +TEST(83_deep_with_mag_cop_space) +{ + run_test (_this, "83", true); +} + +TEST(84_deep_with_mag_edge_width) +{ + run_test (_this, "84", true); +} + +TEST(85_deep_with_mag_edge_space) +{ + run_test (_this, "85", true); +} + +TEST(86_deep_with_mag_size) +{ + run_test (_this, "86", true); +} + +TEST(87_deep_with_mag_size_aniso) +{ + run_test (_this, "87", true); +} + +TEST(88_deep_with_mag_cop_size) +{ + run_test (_this, "88", true); +} + +TEST(89_deep_with_mag_cop_size_aniso) +{ + run_test (_this, "89", true); +} + diff --git a/testdata/drc/drcSimpleTests_80.drc b/testdata/drc/drcSimpleTests_80.drc new file mode 100644 index 000000000..9946545a8 --- /dev/null +++ b/testdata/drc/drcSimpleTests_80.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.width(0.4).output(100, 0) +l1.width(0.9).output(101, 0) +l1.width(1.1).output(102, 0) + diff --git a/testdata/drc/drcSimpleTests_80.gds b/testdata/drc/drcSimpleTests_80.gds new file mode 100644 index 0000000000000000000000000000000000000000..e75eba2b279f3421804a197937731019f69974ca GIT binary patch literal 2138 zcmb7_zityj5XQed->pynlh}X~K`eokA`yxbVOc~V6gdt>B9NeP5%C0+DO0*kBnnET zH15)-pzsqQN*=)-lrAZmZ}-Nx#J;nA()v5i&Tn^SXKoFHFg!;q2+O}wMH3r1MAd&s z5}NmCJ>XF(K03ZWeD~va^6KsAV0iPXk5-(|8DmafAW8sJ4-vqug#h*%CHeK9(jUMd z-c-~?K41RjJgXzetEyep^0n#y8{FS)21sC@1oB?nijN!Vel^Awd1-%UQ9G68RE2Ceo|YtcWVoArDx6+Yc@>x5Dg)i3GY8SO}uk!WQPXQT;RNdBc*}Avoj4D7PbtgBk@-uVVl^!Q|%D`5k_npTsk6r2Y zH~X$t(3Pg%CylXn$h?KH-t*3$u15n0^gg?rPgU)rxjbu2KPoxinyP9q;#pt%QOU9P zs%kIdSzr25$+7OLYA@n>E6|ThZhJRVwHNU_4aZZ-KmVI4`E)+_{CGRjk4nD%GgGw} z?f>%5@l^8c4ps8$yxo7ne~;W*{SP0#-jzO{{;%cVCU3rgkKIALcX?9I`#w4Iy-3_q Fgnvr(v#|gG literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_81.drc b/testdata/drc/drcSimpleTests_81.drc new file mode 100644 index 000000000..a8e887744 --- /dev/null +++ b/testdata/drc/drcSimpleTests_81.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.space(0.4, projection).output(100, 0) +l1.space(0.9, projection).output(101, 0) +l1.space(1.1, projection).output(102, 0) + diff --git a/testdata/drc/drcSimpleTests_81.gds b/testdata/drc/drcSimpleTests_81.gds new file mode 100644 index 0000000000000000000000000000000000000000..e75eba2b279f3421804a197937731019f69974ca GIT binary patch literal 2138 zcmb7_zityj5XQed->pynlh}X~K`eokA`yxbVOc~V6gdt>B9NeP5%C0+DO0*kBnnET zH15)-pzsqQN*=)-lrAZmZ}-Nx#J;nA()v5i&Tn^SXKoFHFg!;q2+O}wMH3r1MAd&s z5}NmCJ>XF(K03ZWeD~va^6KsAV0iPXk5-(|8DmafAW8sJ4-vqug#h*%CHeK9(jUMd z-c-~?K41RjJgXzetEyep^0n#y8{FS)21sC@1oB?nijN!Vel^Awd1-%UQ9G68RE2Ceo|YtcWVoArDx6+Yc@>x5Dg)i3GY8SO}uk!WQPXQT;RNdBc*}Avoj4D7PbtgBk@-uVVl^!Q|%D`5k_npTsk6r2Y zH~X$t(3Pg%CylXn$h?KH-t*3$u15n0^gg?rPgU)rxjbu2KPoxinyP9q;#pt%QOU9P zs%kIdSzr25$+7OLYA@n>E6|ThZhJRVwHNU_4aZZ-KmVI4`E)+_{CGRjk4nD%GgGw} z?f>%5@l^8c4ps8$yxo7ne~;W*{SP0#-jzO{{;%cVCU3rgkKIALcX?9I`#w4Iy-3_q Fgnvr(v#|gG literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_82.drc b/testdata/drc/drcSimpleTests_82.drc new file mode 100644 index 000000000..7ef6bbfc1 --- /dev/null +++ b/testdata/drc/drcSimpleTests_82.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.drc(width < 0.4).output(100, 0) +l1.drc(width < 0.9).output(101, 0) +l1.drc(width < 1.1).output(102, 0) + diff --git a/testdata/drc/drcSimpleTests_82.gds b/testdata/drc/drcSimpleTests_82.gds new file mode 100644 index 0000000000000000000000000000000000000000..e75eba2b279f3421804a197937731019f69974ca GIT binary patch literal 2138 zcmb7_zityj5XQed->pynlh}X~K`eokA`yxbVOc~V6gdt>B9NeP5%C0+DO0*kBnnET zH15)-pzsqQN*=)-lrAZmZ}-Nx#J;nA()v5i&Tn^SXKoFHFg!;q2+O}wMH3r1MAd&s z5}NmCJ>XF(K03ZWeD~va^6KsAV0iPXk5-(|8DmafAW8sJ4-vqug#h*%CHeK9(jUMd z-c-~?K41RjJgXzetEyep^0n#y8{FS)21sC@1oB?nijN!Vel^Awd1-%UQ9G68RE2Ceo|YtcWVoArDx6+Yc@>x5Dg)i3GY8SO}uk!WQPXQT;RNdBc*}Avoj4D7PbtgBk@-uVVl^!Q|%D`5k_npTsk6r2Y zH~X$t(3Pg%CylXn$h?KH-t*3$u15n0^gg?rPgU)rxjbu2KPoxinyP9q;#pt%QOU9P zs%kIdSzr25$+7OLYA@n>E6|ThZhJRVwHNU_4aZZ-KmVI4`E)+_{CGRjk4nD%GgGw} z?f>%5@l^8c4ps8$yxo7ne~;W*{SP0#-jzO{{;%cVCU3rgkKIALcX?9I`#w4Iy-3_q Fgnvr(v#|gG literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_83.drc b/testdata/drc/drcSimpleTests_83.drc new file mode 100644 index 000000000..a7cd252ed --- /dev/null +++ b/testdata/drc/drcSimpleTests_83.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.drc(space(projection) < 0.4).output(100, 0) +l1.drc(space(projection) < 0.9).output(101, 0) +l1.drc(space(projection) < 1.1).output(102, 0) + diff --git a/testdata/drc/drcSimpleTests_83.gds b/testdata/drc/drcSimpleTests_83.gds new file mode 100644 index 0000000000000000000000000000000000000000..e75eba2b279f3421804a197937731019f69974ca GIT binary patch literal 2138 zcmb7_zityj5XQed->pynlh}X~K`eokA`yxbVOc~V6gdt>B9NeP5%C0+DO0*kBnnET zH15)-pzsqQN*=)-lrAZmZ}-Nx#J;nA()v5i&Tn^SXKoFHFg!;q2+O}wMH3r1MAd&s z5}NmCJ>XF(K03ZWeD~va^6KsAV0iPXk5-(|8DmafAW8sJ4-vqug#h*%CHeK9(jUMd z-c-~?K41RjJgXzetEyep^0n#y8{FS)21sC@1oB?nijN!Vel^Awd1-%UQ9G68RE2Ceo|YtcWVoArDx6+Yc@>x5Dg)i3GY8SO}uk!WQPXQT;RNdBc*}Avoj4D7PbtgBk@-uVVl^!Q|%D`5k_npTsk6r2Y zH~X$t(3Pg%CylXn$h?KH-t*3$u15n0^gg?rPgU)rxjbu2KPoxinyP9q;#pt%QOU9P zs%kIdSzr25$+7OLYA@n>E6|ThZhJRVwHNU_4aZZ-KmVI4`E)+_{CGRjk4nD%GgGw} z?f>%5@l^8c4ps8$yxo7ne~;W*{SP0#-jzO{{;%cVCU3rgkKIALcX?9I`#w4Iy-3_q Fgnvr(v#|gG literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_84.drc b/testdata/drc/drcSimpleTests_84.drc new file mode 100644 index 000000000..09b92ff10 --- /dev/null +++ b/testdata/drc/drcSimpleTests_84.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.edges.width(0.4, projection).output(100, 0) +l1.edges.width(0.9, projection).output(101, 0) +l1.edges.width(1.1, projection).output(102, 0) + diff --git a/testdata/drc/drcSimpleTests_84.gds b/testdata/drc/drcSimpleTests_84.gds new file mode 100644 index 0000000000000000000000000000000000000000..e75eba2b279f3421804a197937731019f69974ca GIT binary patch literal 2138 zcmb7_zityj5XQed->pynlh}X~K`eokA`yxbVOc~V6gdt>B9NeP5%C0+DO0*kBnnET zH15)-pzsqQN*=)-lrAZmZ}-Nx#J;nA()v5i&Tn^SXKoFHFg!;q2+O}wMH3r1MAd&s z5}NmCJ>XF(K03ZWeD~va^6KsAV0iPXk5-(|8DmafAW8sJ4-vqug#h*%CHeK9(jUMd z-c-~?K41RjJgXzetEyep^0n#y8{FS)21sC@1oB?nijN!Vel^Awd1-%UQ9G68RE2Ceo|YtcWVoArDx6+Yc@>x5Dg)i3GY8SO}uk!WQPXQT;RNdBc*}Avoj4D7PbtgBk@-uVVl^!Q|%D`5k_npTsk6r2Y zH~X$t(3Pg%CylXn$h?KH-t*3$u15n0^gg?rPgU)rxjbu2KPoxinyP9q;#pt%QOU9P zs%kIdSzr25$+7OLYA@n>E6|ThZhJRVwHNU_4aZZ-KmVI4`E)+_{CGRjk4nD%GgGw} z?f>%5@l^8c4ps8$yxo7ne~;W*{SP0#-jzO{{;%cVCU3rgkKIALcX?9I`#w4Iy-3_q Fgnvr(v#|gG literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_85.drc b/testdata/drc/drcSimpleTests_85.drc new file mode 100644 index 000000000..3e687fd35 --- /dev/null +++ b/testdata/drc/drcSimpleTests_85.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.edges.space(0.4, projection).output(100, 0) +l1.edges.space(0.9, projection).output(101, 0) +l1.edges.space(1.1, projection).output(102, 0) + diff --git a/testdata/drc/drcSimpleTests_85.gds b/testdata/drc/drcSimpleTests_85.gds new file mode 100644 index 0000000000000000000000000000000000000000..e75eba2b279f3421804a197937731019f69974ca GIT binary patch literal 2138 zcmb7_zityj5XQed->pynlh}X~K`eokA`yxbVOc~V6gdt>B9NeP5%C0+DO0*kBnnET zH15)-pzsqQN*=)-lrAZmZ}-Nx#J;nA()v5i&Tn^SXKoFHFg!;q2+O}wMH3r1MAd&s z5}NmCJ>XF(K03ZWeD~va^6KsAV0iPXk5-(|8DmafAW8sJ4-vqug#h*%CHeK9(jUMd z-c-~?K41RjJgXzetEyep^0n#y8{FS)21sC@1oB?nijN!Vel^Awd1-%UQ9G68RE2Ceo|YtcWVoArDx6+Yc@>x5Dg)i3GY8SO}uk!WQPXQT;RNdBc*}Avoj4D7PbtgBk@-uVVl^!Q|%D`5k_npTsk6r2Y zH~X$t(3Pg%CylXn$h?KH-t*3$u15n0^gg?rPgU)rxjbu2KPoxinyP9q;#pt%QOU9P zs%kIdSzr25$+7OLYA@n>E6|ThZhJRVwHNU_4aZZ-KmVI4`E)+_{CGRjk4nD%GgGw} z?f>%5@l^8c4ps8$yxo7ne~;W*{SP0#-jzO{{;%cVCU3rgkKIALcX?9I`#w4Iy-3_q Fgnvr(v#|gG literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_86.drc b/testdata/drc/drcSimpleTests_86.drc new file mode 100644 index 000000000..bbd8c275c --- /dev/null +++ b/testdata/drc/drcSimpleTests_86.drc @@ -0,0 +1,13 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.sized(0.2).output(100, 0) +l1.sized(-0.2).output(101, 0) + diff --git a/testdata/drc/drcSimpleTests_86.gds b/testdata/drc/drcSimpleTests_86.gds new file mode 100644 index 0000000000000000000000000000000000000000..e75eba2b279f3421804a197937731019f69974ca GIT binary patch literal 2138 zcmb7_zityj5XQed->pynlh}X~K`eokA`yxbVOc~V6gdt>B9NeP5%C0+DO0*kBnnET zH15)-pzsqQN*=)-lrAZmZ}-Nx#J;nA()v5i&Tn^SXKoFHFg!;q2+O}wMH3r1MAd&s z5}NmCJ>XF(K03ZWeD~va^6KsAV0iPXk5-(|8DmafAW8sJ4-vqug#h*%CHeK9(jUMd z-c-~?K41RjJgXzetEyep^0n#y8{FS)21sC@1oB?nijN!Vel^Awd1-%UQ9G68RE2Ceo|YtcWVoArDx6+Yc@>x5Dg)i3GY8SO}uk!WQPXQT;RNdBc*}Avoj4D7PbtgBk@-uVVl^!Q|%D`5k_npTsk6r2Y zH~X$t(3Pg%CylXn$h?KH-t*3$u15n0^gg?rPgU)rxjbu2KPoxinyP9q;#pt%QOU9P zs%kIdSzr25$+7OLYA@n>E6|ThZhJRVwHNU_4aZZ-KmVI4`E)+_{CGRjk4nD%GgGw} z?f>%5@l^8c4ps8$yxo7ne~;W*{SP0#-jzO{{;%cVCU3rgkKIALcX?9I`#w4Iy-3_q Fgnvr(v#|gG literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_87.drc b/testdata/drc/drcSimpleTests_87.drc new file mode 100644 index 000000000..b62b98fc5 --- /dev/null +++ b/testdata/drc/drcSimpleTests_87.drc @@ -0,0 +1,15 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.sized(0.2, 0.0).output(100, 0) +l1.sized(0.0, 0.2).output(101, 0) +l1.sized(-0.2, 0.0).output(102, 0) +l1.sized(0.0, -0.2).output(103, 0) + diff --git a/testdata/drc/drcSimpleTests_87.gds b/testdata/drc/drcSimpleTests_87.gds new file mode 100644 index 0000000000000000000000000000000000000000..e75eba2b279f3421804a197937731019f69974ca GIT binary patch literal 2138 zcmb7_zityj5XQed->pynlh}X~K`eokA`yxbVOc~V6gdt>B9NeP5%C0+DO0*kBnnET zH15)-pzsqQN*=)-lrAZmZ}-Nx#J;nA()v5i&Tn^SXKoFHFg!;q2+O}wMH3r1MAd&s z5}NmCJ>XF(K03ZWeD~va^6KsAV0iPXk5-(|8DmafAW8sJ4-vqug#h*%CHeK9(jUMd z-c-~?K41RjJgXzetEyep^0n#y8{FS)21sC@1oB?nijN!Vel^Awd1-%UQ9G68RE2Ceo|YtcWVoArDx6+Yc@>x5Dg)i3GY8SO}uk!WQPXQT;RNdBc*}Avoj4D7PbtgBk@-uVVl^!Q|%D`5k_npTsk6r2Y zH~X$t(3Pg%CylXn$h?KH-t*3$u15n0^gg?rPgU)rxjbu2KPoxinyP9q;#pt%QOU9P zs%kIdSzr25$+7OLYA@n>E6|ThZhJRVwHNU_4aZZ-KmVI4`E)+_{CGRjk4nD%GgGw} z?f>%5@l^8c4ps8$yxo7ne~;W*{SP0#-jzO{{;%cVCU3rgkKIALcX?9I`#w4Iy-3_q Fgnvr(v#|gG literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_88.drc b/testdata/drc/drcSimpleTests_88.drc new file mode 100644 index 000000000..3511ba220 --- /dev/null +++ b/testdata/drc/drcSimpleTests_88.drc @@ -0,0 +1,13 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.drc(sized(0.2)).output(100, 0) +l1.drc(sized(-0.2)).output(101, 0) + diff --git a/testdata/drc/drcSimpleTests_88.gds b/testdata/drc/drcSimpleTests_88.gds new file mode 100644 index 0000000000000000000000000000000000000000..e75eba2b279f3421804a197937731019f69974ca GIT binary patch literal 2138 zcmb7_zityj5XQed->pynlh}X~K`eokA`yxbVOc~V6gdt>B9NeP5%C0+DO0*kBnnET zH15)-pzsqQN*=)-lrAZmZ}-Nx#J;nA()v5i&Tn^SXKoFHFg!;q2+O}wMH3r1MAd&s z5}NmCJ>XF(K03ZWeD~va^6KsAV0iPXk5-(|8DmafAW8sJ4-vqug#h*%CHeK9(jUMd z-c-~?K41RjJgXzetEyep^0n#y8{FS)21sC@1oB?nijN!Vel^Awd1-%UQ9G68RE2Ceo|YtcWVoArDx6+Yc@>x5Dg)i3GY8SO}uk!WQPXQT;RNdBc*}Avoj4D7PbtgBk@-uVVl^!Q|%D`5k_npTsk6r2Y zH~X$t(3Pg%CylXn$h?KH-t*3$u15n0^gg?rPgU)rxjbu2KPoxinyP9q;#pt%QOU9P zs%kIdSzr25$+7OLYA@n>E6|ThZhJRVwHNU_4aZZ-KmVI4`E)+_{CGRjk4nD%GgGw} z?f>%5@l^8c4ps8$yxo7ne~;W*{SP0#-jzO{{;%cVCU3rgkKIALcX?9I`#w4Iy-3_q Fgnvr(v#|gG literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_89.drc b/testdata/drc/drcSimpleTests_89.drc new file mode 100644 index 000000000..88bfc5616 --- /dev/null +++ b/testdata/drc/drcSimpleTests_89.drc @@ -0,0 +1,15 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.drc(sized(0.2, 0.0)).output(100, 0) +l1.drc(sized(0.0, 0.2)).output(101, 0) +l1.drc(sized(-0.2, 0.0)).output(102, 0) +l1.drc(sized(0.0, -0.2)).output(103, 0) + diff --git a/testdata/drc/drcSimpleTests_89.gds b/testdata/drc/drcSimpleTests_89.gds new file mode 100644 index 0000000000000000000000000000000000000000..e75eba2b279f3421804a197937731019f69974ca GIT binary patch literal 2138 zcmb7_zityj5XQed->pynlh}X~K`eokA`yxbVOc~V6gdt>B9NeP5%C0+DO0*kBnnET zH15)-pzsqQN*=)-lrAZmZ}-Nx#J;nA()v5i&Tn^SXKoFHFg!;q2+O}wMH3r1MAd&s z5}NmCJ>XF(K03ZWeD~va^6KsAV0iPXk5-(|8DmafAW8sJ4-vqug#h*%CHeK9(jUMd z-c-~?K41RjJgXzetEyep^0n#y8{FS)21sC@1oB?nijN!Vel^Awd1-%UQ9G68RE2Ceo|YtcWVoArDx6+Yc@>x5Dg)i3GY8SO}uk!WQPXQT;RNdBc*}Avoj4D7PbtgBk@-uVVl^!Q|%D`5k_npTsk6r2Y zH~X$t(3Pg%CylXn$h?KH-t*3$u15n0^gg?rPgU)rxjbu2KPoxinyP9q;#pt%QOU9P zs%kIdSzr25$+7OLYA@n>E6|ThZhJRVwHNU_4aZZ-KmVI4`E)+_{CGRjk4nD%GgGw} z?f>%5@l^8c4ps8$yxo7ne~;W*{SP0#-jzO{{;%cVCU3rgkKIALcX?9I`#w4Iy-3_q Fgnvr(v#|gG literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_au80d.gds b/testdata/drc/drcSimpleTests_au80d.gds new file mode 100644 index 0000000000000000000000000000000000000000..ab0ede5cf5b92b7b47d10f4602443a894b8ba537 GIT binary patch literal 9682 zcmeHLJ#Sn^6un;WzFn=?*hvr(*piVFDG(teudE;<`M7gu-bg0B-W}Oq z=?#CEH90Tq(vx-nw~Tt(t1lmlJi0nKxOw-vSAO{V!SgTPfA-#&Z{L>fK{YSSvRix7 zABkk^Jz0_Lk)DV=v$?8&y=V0g5x;n@{yC}U4}Z2b*X~2iE1!uB zK9=lp(?X~WrLiy5>b9`W(Dn=MinV>&xMyo#{Lu1=v@2HjW%Wss@dMKrZDC|z_M7_x zZNJzSn!mMu*_qjzyJwb9q+PMHFBm)RJLW}O7}1vzV(hYuvUgpSJ@g)pkU#z6xgJ`b zJW7|$*V#OUmdM)oR-Z`w@U%|9HUFK&{x6xI+WvTc!}>*>Ok?6?_={@JOZzx+T)Zci zuPfyQbv61wvid~YH%{u~g!RZH(q7 zpNrqL1MBB`=Z2{xyT93Y5NY4Ju~dFxoS}^;y8TP$i?E;UH<9*2{|ox@{DwH0Xg=A$ z{N~L!_H<`&+B;mFw3%x=(k;fiuy@7xwY>fD{D`rd#*S5F{weg;ja4_k&dUkj@$cu~ zh_Tv>9jpKPnWkZ^u&3(>hV;jJ!at9bygA$3)2GdXiyl4Ensa67!Fjvdqi^&%Q^}rK zQQKr|FgwoGCfkEq{?oPsCs}=b-oD418Lz&h$kSHfY0ZNkdyuc^;EN0IWx4Q)h+k-L z;^(6zTX!sQ zbj)D|xpHFS)1F=0$7oBoAE&uC&jL>S*sP9{^-;*8(B|$~mIq4xUM^Vh7xF==U)xq2 zrCbeNS4k?L(ZJ{+(#|NUTIH-q9+7tP8=}nY##5K8k>$(g2stkB@jfWe)$nO#Xh>+b zJp7K4fm^%lpPT>8Y?Rf$wRvW%8(q}a;?G^MBckfTu_YY7XYUY+v@2Hf5u2z71P}L* zMB3~48kdF-1P?nh5&Ya=sgKx2Js^14jfu3^>Ek{Q^?=}AddeZ~b^I%vmJbB~>R%4Q z&;6C{-#xQ@Ao$ZC9fF_xEBV*HwR|A>m~SHZx!>>`V%MBBu-TiF#@IwC{ws^$60aA* z&KnoQCG{Jl*xTprH_O41#l!dQ9V3zUgQFmdm&n)XKh;?{vIt$=ZxU&*)=%dndqM{Y zU1VV*?REO8d}K-J0HKTQNu<3_Kb5cd9Y!Ar-Ahk9gnsV#SCKdWbHAzAg@0wk>I1>Q z`nN;q=l)9lRQ~R-Rv!rc=}!)!pZhEIQ~B4vvHC#hU;n}(^mBiueh0pHPVKb*m&ot5 zem(tkeuwoN=%?~KtlvOCmEU3g2l}b}4(m72Pvv)5zkz-#KW+Wa^MlC~P5GnY6l1>g z@{cQi=kar?>?DJ)odv&lmht^@r5ane*IxH-6!dnXERUHR1@%STC%y2g n;4!O@Hwf`e{X!P6Fad&q9!&* zjRjH|OEoc3e}G?=T3A?tu>d~Li ztrq0P{3zmy9$`ZD!_J~{J(@`;oSCVd&Y z!@2Qm-WRd3r7zq1`vTqes}}ly8+}>3pijPvwo2$^YwYMxOjaFd!;zX-nDxa=YG+3LZp1{o|OJThtaJz7~7KiVf)-Aeb4S!l}Ds}?ovv> z`YrbPH3_@nKaui^{lPqE#NY6tmoZS=Tg2b+v*I7{b?()MQn%V-Y_su?_>42-PNcjN zf5X?fGtP`Vk#fer&pMfu{bbvQr}iG%DxF>3-k&j7CfBp(%J8%1D&S|#RmA6=O<8s1Xg_Ep5+seL(kFTQfh@9wZMsVItk5t|^?|Qcn zh-`9pWZ|qJK9g%k7W@zR87FL<ym;G0d=ZW_5EMjnR{F z=Yp}yJV#?D@)*O3sry`mi5{|KF35ZFiLwNdmk(#V1G8qn%{rC2zTlj!LyuUW)92;q z0x54=r{K>XQ$A`L_(aMDz2))#U+RV~s~a{L+mih0b6V%7&uNXpc>=X&<_zT?lYFVS z-hUu;&Yma{HWlLuzUp8-1HWsXgWWh60dZ#m`-zkbCiH8Jz(uUUMGT3Q3nux{0Y8DT zAG(Q@3nuwSN1z)vz@}onk&hVTIm8}3BISZfzL}$7?%+c)cR;~Qbn`4y>OSjt!J7TC(nUcxyW_e(pmtpLSf3?@_JCjM2O>Vk=KcF?xuE!Z@bH8RJlMubpu&liKYVj`Rh|<@EeBx^RiZCouQ9KmtVI=qcQ$I z%r-4uKyobGv9RM>HRA%>*HQ8o|do8z36wayU!|N-*eL8U3HE~ zxnPoy+JxtT;NkbLM9Q1^QkOg*2p&#kMDUC8q<+*UJO>01r!gYsP5SZsNIVAwZ~dJm zQr^VhxI+0r@HbyC5&U92Y5&}1D<)KpIJUWxF(7`It$;xDUYO8G$WH~&>4_{DgVk9&JO2LylprV=R^O!DD3 zo&$mp|A~}0@#PNN^MT;ae^(;-#duObI)L4;Xt%KMd9mZ7tl|PG7fkZ!zfnFAyzQTs z2!1i1x#Ng61NS}xalSBc)M=0mho@) zlUemN=!Y`$Dd1=1bHLA7PXRw;JqP@Z{UG3DFJn#KG~(Q@H=QF=E|}~Gu#a`z&jS4! z>(TJFALzKB8-Cf#A`UCxR{x1+uSoiD&P;CL59KQcy-EXLdpYP|eM!D z#~eccvaeJ>k#fPLe(=~6Jn*6NiIfW_`Q{nlPjx*Hb*aZ=`j_pI|L8m6$HGf$KauiE zKN|7b6WsHY@`;oSCjB=#=Kb$_o-%9H^Z$$UAaW3X@ElB}TrlZB;?ACK-F+HABISZf zenvkP%%7PfAHNpo(V!oI{mc{Q4UzIn{zQDPGp;)#<(2gp@tH%cTSUqQZTuoW>kR7- zk#fNXKI@$PS!=uc7wKmXbKfCSUfF*lK5Gc;4w3Ro{fYR@0j^sj<(2gt@tLR0TO#Gm z-#-1I+=w52?6A2Jm)r5WKG5G|%b4_dPM&D`tD;?R$P@BLxn#I;&)%LXH@sx}dq;oc z*l|)S^d@Vv(xn%zLf_BIT9!5Y&UE)}tr>c5dCh&H-_^_T=v+QZ8uMQ>34D zgLQ;Rd8M92eC93lm`Hggp9B8E{c1lD_CLI%MA%=9C+*+$y7GbcZV`7S;1}abKH|^1 z$2v%)yiyMX`@!eBXB{9?Ua1EG|G+b9ClK~O_;`u1zZg&2f9Njd1HpfEU5Vfq<4OL) zi^>OrkGnA<_{DgV|6li`ho{wkAnZP}tVGyfj5pZ7wDZWZUsXR4`cM2^BJ>yIR)18_ zStnRGh?H0AN5p5{=RQEBoclphzXEZ1U5G}9wOY1du5<~>HWTZq2M3IqK7KjKr8;1jkNI@ti?Eur+@v`eUZnPdwW;!yztuhU)_K4<$KTF{o?JLve_%<_51y6 zJJKDB^jABwB>l%aB64YcS^xE(<=;j8*Hd**Nil!$leJvAXM7^%ijF^?*?$7|$FRTj zsYvg(^q+J+gq49*j%8BZ7xo#p{g-mZ(y^@FwU%c;G(M4X#lo>HKP@u4@5Z7%j2z2u z^;lrrf31h^-_o&cO|9kjiSdb)D;ACgbEjj6U$lo2V;LgG&ZklKZW?6|yhkJC5C8R4 z56n&yr3>b(H;-XUWaT@vPo#WsTxP#E|DBfOUogLI|Ks@;>lbk{iHVcJ&uVk_){m2v zi|@qpb)_7ktw#SxW}is;+EIC&upN0s$}{{zKS%a|!Tj3e&)ARWN5si)Oq{HJsWxYC zte@G==i)czz;ZutU2$z>`&au0k@Br83*~3#8Mg66_kY2B5ss7NCQ_amf5v`1zamb? znooAmzj^hI9o^Zh_Kq}8>iF7by2e~*_OAG`=J!9IA2C;x*tv?#Kbf(nbJdKmemTN7 z9)A9fn5&)Gx%$7?G!=7&JzWnN(j94qe;Sp%tL?4&v@AHU(Tdj9m7xapcCkjk=yN90 ze`-l(`jxO)(cd!`uMzEk2iH%{YI9jy}(nO2YVbrvYvwz7rx8)%*P`B zOL-MPnI+k{Wqcy#imu;zC$803MD!hMW$%1;O2=5?-;wjLZpO~TLwH#K$n)`>jw2a~ z1iFl$=XBo8Lx+m7zOTVV4UsaZ`dvI#-mbyS@wb-~kx z739jXi%+Xv>c?nJwjZa7ZPo&*?L)UZa@I#Ci^4W{$Gkj{tM_ujoIaBea`oD`(kNv# z|3gv!udVWmD092x@_9Z&jtg|W4@z=1bQ&2N5}Gadzhz|L*6#9W?l0$!yw=y& zPprAKi`M%3z6*9lG~GKi!v1@9he)Jcv5=40L^~jOxPK&4UdGqBbbKIq*pZ3gC;CGB zh+VV;f`{FhNO_rk+{d9E5WI8Gq)2%g|H8WQf#6^KGez(dePRE%PmB))fAT|$;3xV* z{`21$9|%7DO$0yDJAOs%x=I6^y{j}vE<*8FUi{{0y$DXVaWS0JzA}ov3}9!Ly#vGj z_wA06NcrAD5XB4RYxEzh7Y+4AA3BJa>YV^+wpJzV)lWsJNYq1*iZC@_Ajg%9|-=%zfuH0(HHXD z+HX7mZT;WYf7rb-Pe9Bcc5x!*iiPvncK#dK_v+L}>wkg#M(f|RKU?2!onzi3)_=fn z5Pt!`LHq>#2J1iIH&}lGzd`&3{I>Sn&VPgTAN0Si|Jtp;S$=hSHZuPP{jX!cqKa|n zyyS4ja~_XNd6f)KJ9B!kmhts*)l4qqQ9Z-FhW+GGJ>&M{sM7y-~P%<8|*wL2noG@|e3(P+i1*(o3HR9v6MQL5OGS e37JfHZgVHb`c`XmJ-aT$COLj?E_6P-UHKbyK5*s$ literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_au83d.gds b/testdata/drc/drcSimpleTests_au83d.gds new file mode 100644 index 0000000000000000000000000000000000000000..e08d1822f095ea8328b3fc6c49c878ca2d56f709 GIT binary patch literal 15890 zcmds7&u>*l6rTQiE&X9BH8xn1N+3bd6sZ-ZA*B>zP>CXY`~&>8LKiMvfpG!u>cWU|QO`H$e!XYzy>s8Y18Vdoj}Ok=@18Sf&YW{* z9l%6MqIZWv43|1-K~R4x%w+&EwmFZo z=WUerTw9TkM8`Gx{vw|Jo=CYzI~&6fo-tf~hk18|uX_70D-M03`iYbaM)<0K=%V82 z1=UNWeCT4pKY5e$H~gge8-CLK4Zqp^+w5P&$xJLx`Y)?4tO;TSK31gMV|1NvY{&S@ z%8l*HlU(Qdu8VSDuui2oqYb%keFx?3;$-5K*Wsr2DvwC{#HpBmd0yr{`k~^)X`Mfj za>1JUgRk=k5A!EdUf`Q`hF-P3f&UF3dckkx|A3DiK^r>se~C{&)9*ye3;s9!B>x+} z&YOOw--(pd{~hd;+1Nh8yWlIt1pI_KDpKw-8YjyqFut;~d_sAM6Y#lDbUYqssvB>x zy7e8#wupXtPVAoAqd5JOzJo})V1%!Fr>`i^zpi?TluuuY^D*zKJvx8r#r%ns7xbHT zhTW>Wf&UF3dckkx|A3$1f5T7mzv07j@z)ha`khF5!T$ljiT~T|lVPbRvzwpUdw7R* zc3FpOa(dEQ8Gh1Q1^k4yGW?{qGW?{q3i!8pt!C=hin+f*{RwPMs6PQ8YegG6tUo0_ z>kR7-k@7(91QSMc#w ztUMwox{48;H{&CPx6QcLol?2n@MPb@k{~|A8~PUfU+{OFuyK-;kJUA6cnf~Cf+tqs z)0hW+oI%x%1K!K;_#4jIFXip{nU~z;G365}7xZ>l-8hUKa8AAhaOacPV*8FVffE39*A%y=GSI59O}YcSD6=FA0oFFvIxf#>DJ)o#G7 zSZ|Y)w0_Cic(qp@KP!K~AnPVbdEx9_;!hq`K5{8|M9KxdV^%J3r6)r zN47@6+QA0O3-dRK%~52e~HgHXWSDhFT{VqH#!2{umLt@<97Z5KOz1D zzVVTtcL(ur_(}0^_!@hRbH+W9a>1JU>pC}x|3JTqvDLV56aN7pHe!u{ShEh|Kj51^ z7VN#6_z(Ed%{8=Z2U{p-{P)-2-J_>uQ;A+_*w-gLyEU&-4cWF%Wx9D5$#pOJDp*k; z3tbd+vpcTp11iU*#`-ABv_j>WPeC^yzzroHgDPi#i zS-0!X5h)jp@{ybH91uMG{z|00jxTx1^MT;uL`DQZ8;|NoZo+dw@NgO(Qyf}f2?`8z*VJ`jAYHxc}7-1FPS zu0Ltwu;)*jgFZs>ud4X17&Q@`k9HQr70x4HLoq&)6F*(IaO2ZF!tj~v0z#_cW${D+C<6)qx_k#l@A1O=Vv*B zpN&WP+kRI*5PbX|MFc+^kMcKdQ9cm7En_)?pN&WPh+Fsx2>&5|iIms*A2AL+Kc{^L!E-?H@Vh^e@;W{`7d!_958Wq`@&ezSbCU9x;V0!U!%xazhOheJ`v&O-dQ(U$@nkzlUfH^_gDvs zl-Je6gm@16sf7I$@DuiPz)z?L0UthMPTtz*-0ruXBT_CH?FUfD8rHKwf5Lt={G@tp z_<1i2Ka9Pr^Cy~G5uLv|Gr6wcl&=`{DmDB(hS#4|KGEdLC_f<|mgbK&#QfKMsrreO z3r6*W$DZJ!kCacOTrkQv&-gyJ>3OJ0KCU{C!G83ez=c=Tej??CezfF2_5}C+pnM|b zg3tEtC&oJ*0DHp8aGtbF?&+IJ!mGm=)Sa*n&7wS)m z&m6+ML!`Wre@cAD0QW7C^1}Wt@wv~q?}(Ih|F!7{N{K%~5o4+8%F=hRLh?0@*l9ASSp z9<~4AJ<11y|MP4b8IbG^OpFCwimn*aa+ literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_au84d.gds b/testdata/drc/drcSimpleTests_au84d.gds new file mode 100644 index 0000000000000000000000000000000000000000..2e953ee337423b2ad061c5997d23df27b3092c58 GIT binary patch literal 20242 zcmdU#y^mf;6~@PF?+5EOc49;XHZsUTCIK0FWf=uU&c=>VfGC6zAR%>7r~uK>#dKIu zP=Y8DDoQ}2Nd5r?RiLE8h=S0C4n&ch-^_jXp1JQkb3bMshn2?9>ofD*^D$@6ow@gh zt+282d^mq>WBZ@sWVk<^3LD{+{~dNVwx0UpjSxO`eDnI_w?FsgKm7XbN1k~7v#X(sG+Xt* zl>0y1{v+ng&&mD|^iSuHtY7kEe|?@0g*E-j_7fL=@{{#N)_&GjY{V8vRl7m_PIDV`D@!E&$eB%0F(XVyl*ABlWAFLn8 z&wT9G%^d%e{aWW^`7_}@adrKDBDeGOugtf@mi1NYL|;!Y|2^@A)9S4Bc-{P#9L(}$ zWj`T3(kqm_yiVe^5A#Gk;WWPNoNRwFPx{zb{U7kB$A2VG_G~|K^}%mE{_GXo*_ZZ? ziiu(*lzb5D*0~z+XUBRme?qMG$6_^g{gz_AoNxK_YRYYD)w26vAM5_!&$T3v*Pm1u zCe~j!SJ>aTiS^g$_0eM{+dH>;aI4d{cYgDr`%%@tXd@cSBx{cu%dPri|^-PO<{9~&R|ZnE{< z3(0q(VuNY|Fg_1|C>en3lxg-9P8{RcOF+vZBeqtw-yr#dEj}A5T`X+fjAH0x4_|V_Dqrhd>s~0iVU;gE6ZN~ZN?&`>h0W4k$={5>!2cD# z{Peo9Me>3F8J{s~@O_hfj8FU+tGXkUd@z42`ZZ2Gq2yzH+39WPx8ybZ(V;mYX6P15 zZs_wTvtN5$#!jr?8Q!*1WOscQv(rem~zjO?R0YunZ-9=6#l z@5TK|I(yIGqs(OceM+ZWXW3r&t++c{vp*W_qS39>(Yk%$+J3heTFi#^o9v7c9gt=~gvSbrDK# zSmdKaG4vGzKP0d5v0n|FeUsdB! z8Ewt`o}Gvpdi_=++<4jI_Erc&$qkEqY7^r?czi!0l)T2bx)k{!JWk|7_+5WdKedZ- zAUsavLdk3T`JRArAiRs8>QV9<|I(Sn2jM^bpB~|N{YCpP-${HB{{A0(gx~cS`PY7% z_#k}dTL{1FkNlC`jZYdl?8he!yD>xg-@5!=)9W(0@12&zYsQaeaaMt^{l=p3ig{~z z<2x3GU-T%sp^sw5=lvYxK=}KA>QV9<-#v?u`=g5wr3!TMp;Upo{-S=~FH&hhst$ai zeA1_`wxQUXNdjJ$zyhU&x#w zAG|xw{HI?Hu5XeXR_s>{G;c!5BNqAG`OpKRn>(mb^1A-SWvu6N4R`IL{`UNB%fCyf z)A|9K_lN)6BlF+&7wu=4fbSqavwILqUW=bwBax@I1H$k6i~1R(hF;$!H!Sc|j$D5w zA^x*|gp!ZtzhdBh#}3I23;GZJi+;kH>wjzgY@L5%tUQ13^FPg->KyUA7xhmy+}Cbw zk=(F2|B78p{ZXEy(>KY>`Jd(J;kxA-&RCrj23TybwwTl|&a=RG+R{r}T|5U?#?IZsrH>~oO?n3 zW_)}^KZyMk>hF>ATm5h4FUY^lfB4-VJ=?pIKav~z{K@zW>SxBM{$K-$PQM40+_0#h zG0Z=xx-XR6u*i2lM*S1^@0tD1#>{qnalRGxFQ~sO`k4dln7IFP{6+QG@elWxbIy+$ zAG_6vnQxLC7URbl))1(Dt59;oBEPl%w60%QqoeP>hT~J$U$mbw%5&wtQ1V*-!&mdM z=eOjBMg48{chUK8C4Uq{A3N-q+^}fB&Yt+{&z_a%hnarz2QG-t3H$GiPyJz@K;~`2 z{y*cp9FO{y`yh68{YC#<^IyJ$-gjc*VpGuHUVmEaXY2iI&iswM1&Hs-yO+~?Pp;R^ z>)r(Lws@uAy$kUD)7}QGW&D4=4_Hu-vgg?g>iLoKSx2hds^db*2lYJD@7CPZdX(`O z?1wTw_G{nc_j1$&$qjuy$oLD^bH+#i%>9t#FRDk5-|NN(eD-@XXIs&K#;C#fO>)C3 zU-txmFW@?o8&>(s0lyc9FS%inzo4FG@pCy6efK$p|6PAkKV!5`v~Glw*VfO1{Xk~_ zg8OO4Z>>LW&lBV4_e8{|>#xR7*YI5CUvk3&f6;y}^B*0|6Ue+_gHZDN{I#zi^bjlM zjZpHMe%1)%KzI}ObD95cjmG)&YZ#ll{%ZX7-V6P6--or<-`4ftx_*d}?tv5cqgnjt z%-_g<&b~-`?kmr@FOux*q;>na_(hWSP52)1(VqtX;_T}Sr0Goi!bZ&a-ADZ5WWLtf zT&FkgFuOhON-Rp>SCI3}DQkf_6-sVcSPzK@mj>52$qlP~)-z*SPw<73*XjX0Y8gl^ zgD;fau%bWJRQRlA_z5MCSmb~6AGU|M6ax6kkA?8UUwf3?u*iS%X5xeJzw}6t@VovZ z|Iwc$J_!H%k9vgP^%wd0tu@U(2>*qW8&>($G_J#50=`gk!y^Bgv&nuC`=9+lkJ#V! z7x_{k9U=U#zsPTmKl4sa2e}tB|3b+Pi~3vbZ(TpF^LG^Mk9#`t<19n`gpwN;4hF01S*nH8BDI06!QZ0|$<*F{U^Y2S$xCx_*1_=e}#7bJjlZd817(PrLSh&idSI zulGGSr1iA6_Cz|iV{PMR+Lvxi2hv(P;QyZXtgT=9_{Egox^wsW3(wvAiC_Nc&HL_u zxa@4I!U{n!23`9@0q$1UwTlw$tI zZ_3VnuN1yea>LBuzpel6=--e29p6c5_gB;U?b$-KY^0^WY{s_8W_0@>$ql={9DK3t zJo2T&7fNmz`m*y~DeZkT`(hT3^yTz&U(oG;iiP>VU0;rGm7S+<6uwY$!_XIEXTFmc zvv7njd#JHHhbsHrP-XwIKUNtx3vRq_fB&;Zx1!`bZx%hZN}rm_Us6BVxw+U*i_!}z zojh3Z)E_JY&!i-j+|Wne`B`{Jo-TO&Lg5P~Hw^h3uN5wc?t?E4h;4Pf%Rm0nvhU=f z!WT+z81QR;UMq-hawOcSavwfl>{p(ZccJ7n`Jdw}&&s<{@)`RZzKhY={Lk@~XXRZe`Aq&DzlqUy-k0Rx@h9cq z@r!=tS$P*q-jAPrSf2k8ed6@uK2dZWe4!xr5hJ1Gb_RkvTaCZO&i&TUPT%>d3y<7m zH(TwUt|$G^b#2DFO8!;n#DjA$lzb+C&eoS-;%!WVc{VK5 zOF2dJD>f13^VO~}uf;3&iJr5W*59$iWc!cq-nw43?LW4AtNyiE!6amVJnyvQZRJ(_ zj9H#p!Jn0R=#vMFCU!noKZn1OlK+u>8NWs;9etwkg_0X)yBAID2QH^%KYMI4%sD$` zJ}$}c-ke`+ra8lV$gurmQI6-<Y_`I_(lrKjzCx%O7Or}q8a>ZhXQh9Te1aGu>j zxSVkz^GaP0`SfJ;XeK=TT+t6ozDz%N2YQY^S@a7f@7*b`7d6iv8?QG#EVQ4v<0pvU z#9t_R+|!5HvDe3r&v3B~^cNfVymxI)SM@hiE*R&s_9LUM}S zFtESG4L!sUy~Ix_c~3uftA>2-;D_Wr{VqpM?uft3ZP$MEuowN8-{#mV`Dq|@u{wRzMIL}Q)-XBrSAwO&lvLYksN@;+@Ar-4MRSA z@Ds#;K0_$^jQ@@O_{TmF9)1fY@A0vl9Du|e`-PIv)NiAILjP&_u12@}4l$q(iAh}# z;#YE{K7rpO`bVQ59m=849X3dA80astR}B+4Y!FJ`k6+0hy2#y#{?ph`e9!};cSQeb z_^w8p+QAQ3TcQ8;eC55qcZ@xMF2~t+8&mLkA`q=YXlK1lO za@^#eToBv3p7n3^-~IBeYolX+*yUMaf1c0Ev+wFN+KOyHr&Zm079Mn8&(q<8`Eceb z0^NGLS~LeQTz9kZ-1^Ksyl~xY^I2}DOqYr6)4Al7&he=bK8MOshwYq_hCiXpIR2zA z=lD%08+%JN{0X;Y!&mG;A3I{{I#8HD;>SJ^KHWhmxnank&?OuDT_+gZrDymhhkOn< z6rHA^XPEmi$R>81iL12;chvzpjUT zrz6MT+u&>q`Kxs4MNgUNPz@}*B{uq9KEDmx9Nrc1mSItk)#>nXM(; z)B44qsWbDfcQ1Tw%?uE<;;qgXD2*0j}`nfyU2g2iRkWliTe!fp+9|-S`_Y5d`kAL#k!Uy5s z{f`0R*Y(i;Q#T49gunUg0pZv6kbmYUg%83f-$M9xJ@c2;Zhq6n%clIMYj3Vl{K4k z`kLu9y!b_{`a=UsZW!{NkB#rd0-Nf3$agVrVowfSZbJU%uZkWJpU?bsK=jx3kdF>- zIgs0r{0k*F4EcBey~GbBetd5$Bz|>0dsji27@`j%v{*ynU<~KRY_WK;V+=ljZKCvCdcFwO*a>J1CV%)@@9Kf&Z zA)g*ioq*I0JzOaHvie~kbp(&P5lY_U(|?IGNZjeWLdoO!m)^-fdL=x1r%>`9pBSl! z`QAkiBsUD>N8cdEATg(Z2qiZR`OF9G1K}}02qo|FU5zxggZ-|y0{x|a&puy}xKY1C z$$Rm`M#aGUjt`O>2Kvoci@)wre|KWP~}S~JvXX`U2TW@-5JaN`!ndyX2^FvX8Yd4ckVIxbv@)O_aHo91FkkgzN@jE zf7Kr7YBS`!9-sC5I{^K4J>;`TGnD35q2z`k9~)J}zIN#!k{fpU)DNFS{lF7S-s>OE z#_Ydr2c2)Ber%-Afb@?M^HWp5+!63W_#@`;hL7KxA^q$~93(dk?Z-#-gXpIQg_0YF ze5WJF-rL}83;2`f#~J_i8G3FIN}e&$-`vsJet(B!f4##)K6{8ANbHEaP;$eNPmiQd zLF#tI{MqH+@jac`3sGFE$^Ow3fb zzL$3Dxp|)qUwI!{4-J39d1&|(&O^gTzxw9Lemcij-y7Kv8~%iT*zhOxL&u-g4;{bh z`S~98F(9@zHvT+1eskyNezfZQD0EN*pr6I*2a+2G`iEHn{>Xmf>@R(6#eUZCC(N@A zpYw-)kbZ^_Ldgw7|8;gjxc&^gvmNq@8}~8DeM;PglF!`djr|km@rKVliyjcYBi<)8 ze0m>z5dMgHzTp!id;mv24>f$^rW)|iGQ?4G!!Z7CX2`MkGXGzRdDAnwe-`H~NNyPNC(Kh#{B-w# zS+g_(^UU^4*@S-+zYt?2zxi zvzYvS6mdcq@yBkVak8 zqaPhQ1O8b8TO>CO^{aP+aC{Htv+H{1Z}jJJ`;DZ>9=_^+BguX{Y0(^>eD;%|Ho9IL z<`X{k3~qg;@P(2acKP%K_=mn*_(I8h{Y209@OS*J@C!DxZm9qArIb#5C?$|S@Zfy| zN^ThPA3ARPt(SxEerHNo-!`D+h9RFAQ}-a}Vbyu;5j!O40nz{HzXz1Or~kow3m=4k z<^2P~uj`@x4?JA>ApFZ88xVe75BcPcGY@|7w z0KEOF5`UrOy?F>8cMf>h?!p&JZW!u6_swEIi2clRLhP^WA^-8e*nX=skovp!rvW85 z4Ee+z+d<8dLdgw7{>9H1{UG}9|LlP1uj?WI{?8QuLHvH;lLO*^T@U%!{#f`R{3m}m zApE)>^6`;-8@%NgC4WN6d-pkU!%vV|miiS+zAXMcv%u$B2EI^o!_fXK?=Aj=`2Wy} z0r9`ChkW!h6M?+TK)+CO!;t^zzlwek{g3~3K=jx3kWbv1JHZnlF7X#i-kV3cV~I0J z{c-mSC7+3Z^L`h-_zsS||L6ER=Q{U7$!E_09A9&S<_4kUhCY4`f5QFS@F(0~4Sz!Z z=J+~iI(I_JXU<>4pU^)V{)GP3@F(=|hCku_H2ewoU&Ei!KN|jo{@d^;%pVP(`qP}G zxk)Jb%>2~wC(M5hf5QCP@F&dgGyL-2fjH>7K^QzgG<fe2HSLFEg?5#V$UjO#5KlX2Yy>n&j_n#g}dp6D0>-CKlnQ4gB z7iuyk^&>SAxzw80ztJ`QMkFqgYv!1w`MEu>d3eWpD($MqH;3(?MEgy&KlMyx_KDP& ztcPf2PR5RRy-8iq25l2 z(gVDPPS5Jd!aZlHwAaIE0{=_azDF4%4Mm@^T%lbxp3M>d(5CbA%g$42SFJiv-PAn& z`+6|&Vv&Ss3WauPuAjMiQlB*YR!2_jSiw_iZ}xM1Zk&if8j<1y70 z=c%-}JL$QK;znZ=@tKv#mz-eF3kskEzBovUuyT*doTyrzdXtM5}sTE0(d z{8(I2X+P3R&sDS+4daXP6#0^Kg*wNs`aXr221}(~wd!20l+D#(Z7}enftTAWXou#; znu|;I$y~$gSWMs^hz%(1bB!FIdj{pDPH-qu9NGRwyJ~W-P^a6zSW91P}dx2|W4()LS4V{mJ87J<`^3GF{xX?b153?j^^ehKYrCrtfU6gSm zZ_v`v%*NKNLT)o}>#K*6t#AV?tp60P@raKjnb%;8xdZDw;)`Y;K4c7&uQf=Vp&8lJ z`{Ek6+7plk>m5DkBD&uV%ZXFEA4Mhd*?NU|8R4;qp>F$)^HkbZV?MV}VBZ^-xB5FS znXi<`9*%n~y>x!4w1?+p%)1NDY7HGbtg%-#ZGHUgo_viaq~mo8ZSyS5+V1OsaE-*r zfn5Y`^K>YB4hsFzvoPX6@H`aywO{cn<)h@4Mo1{gIO9UQYAJv6h2KN78RMz6tHyjT z%36;^Sh5VuvnAS9OZii4eh*~qxCfPXRpZA*nVm-6Y_GyDSF}cW#&bTt4~D%8K8=jN zMZ?`cb@p-DoxXf-zpXb#wKrO?twL5?iFoWI-ym-F9k{FWh;I;7+EtT0ViWbC;PCx{ zN_!cvacMjh98MG}_~1{rkJv>$C^(!(RNBkh*LgP{3hwN3rr?7=+5Ux=^HA^?-)0Iv z_>(-o3!okpeD`Ihw5ulhFSebBf=6^v!3V$bV`A4%S{!zE(#~6i;=iK!E$~JWoO!Fo za6$dCQ5@|+p7XEoyKd+T;2Q^(_VxYTEJnQN>guZ)aUKeOeK}L`!5{Ov69DgCy_Uaw^}Y#;dv z+Ba1Wc@B6}+DqC;jsxCQIpjFtO=&OTJA2NXD)-@Y=S`Il{$&60{R8crD*wqN=S^uZ zY5(eD=S`JgS##c0`QT5szt(f!RQVeX=S`Ile&fgNVwUHHt!JpmF6nyX}`H$~84+W2JR#fo8pX4u}avloq z^JkfY5B?;7?TzzL@Lz3a3O@K_KDVFY`^atWJM_+$e;=XJuA1cW4F&a};P7pQN_!cv z*|PCaaErT{f)D;=`^cJ64+lsIq2M&5A1e6ZPx9BFI1dGXV=q(i!EgMS{Y>8|9(;e_b258t(7qJyWAs&cpIrY< phog5qmcMI7QZr@gsAg^Eopk{{zwzlH33Q literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_au87d.gds b/testdata/drc/drcSimpleTests_au87d.gds new file mode 100644 index 0000000000000000000000000000000000000000..7c21bafe5b8b647571e941df1cb026d013bfb9f1 GIT binary patch literal 16808 zcmbuFKa3a06~~9;?)Y&&;2?p3eTgqIj)~*ga6k+Ru@6W=lt@956`@pDe=i z3Q9|9t_vka3QDSol9G}xl$1n@a(SPb`Tq9J&Tr?pM^-w%$D8@=d$aT2?CkD^)v&a5 zFKixKI`XgZRyY-og{5%J{~jhwtH1iitq{I>c;&O3fBE#6|NQ%_>py?|$==_7_eI!T z8Rk}3S8rbm%aagRk1d5mVfFY@2;rlR!}hN`4!;b+|G1{*lVO-Y@+|dy>v7_xvYSSJ zedhlR{@3w;=s^f8_rvPB7$IJcgoR_-9*#vZkw$MWt@>iO}D#7kv29UKeS&c@EXScD_SG9ky#cUkuP zF3a}!|7%w>grsDc&3Mc-RCfEtkEY^}JWD*;1t*nVS(dZ>51s$QN8$VM%OW=KzsFnZ z?r@$Ej@?PIOJz6p{2#r4vYZ2D{8r~PmEE+-Gb8Yf8(u1VZ~TAq{+*A)H?g?by#IhZQA+6wX5 zwtwNJvYUFo$Q4(&k!2m?94JR_Z}K+2*pG3;No6yp&P=C4)7YyD!5;H9$n=Bmh* zV8;RLy5g;Faw>V<1m*Y)xK!8|G-lGgy%;#HZR`ew41URCZJEzv9#0Zt*k7#8S!L zh!u0~e8l;cZ`8%+{Z~9W$$1z*oK$w@>eyUq-GlPlF}AL&Tv7e1o~5$)>bl64H(1vy zUh5av=;&^`R;cW{R(YUarVDiccRyup_q*<_hgL zzESJih+MhUx(DrFBclC%l=nX5rBrt7;A3^Uk~r2Nc-}q1OJ%of;CVOKoo{~gzIg}d zVr%erjcpP*)~6|UsqChnFX#GcL_;uT+|;KuwxsqZZ{v$RUVvb@>(i;uda(+acf7sR?CmlInaT1t>U$QajoE_ zvfH)v*SeZ()vsSu8g*Uqs$bQ!RCd+%WX^s?z7Mdj6}bjy;~TZEEyxw#?c0aOu)Jn* zp5lvM{Km&T*b%Q_-Ev}YUJJW{;g;Unw!`Y%hs?JA&dSczlw*B!Whef^?|f;DV=SY% z;y87#IE#YAM?Z?gpGJ`9t@!fFdG+&+uR`!YvM=KERSNIiOT1Ke(-`->FR!e}_A{|B zd~wc3eB)b-^J_2V;|x!jVf)X#Ij-6?lC=Irh`AC_YcV?o@WuCeJwG88^IC_TKo5bq)TVOb;?53VCs%+!WiA7;~6C!2&xxL9VPWmx!c&Y5Y z@mE!%7`$&{klob#ulTdq(inJa1t*o=H1eaX%>Ei@%~hE_^>mrO6Vg#-I#a(P%68T2S5Fdk!t;ur@;K}Y0_tK)u@G-ley-qRA?q?U%xUAj#ulTX|l6?J(Dw+8< zUyOg|+hTFCdH)s9_{ZE!M_1Y9vdZjv@&Bl@ar97?74$TuqpI+sdzsPAD)a4jwc}M@ zOY2LlGPMs?nQyny{47;fqI-tFk1^x2_wFSXf97GXvaMWYS!Fl%{>v(Ro>+Y0)5k!T zxjbf)@EL4x|?_u{>r^h;dA?-|EpVxN8xW==oCJ;d%m~_20L!N z;@=Q%zfS9zRCd!rp7o1-mURQ49n`b9q!j&)2bdy8lNq8|#!IwqC9#j}3V4~1hL zlgi%WS*PfS!m*A?WpDAUU-U!aSjVKYw|Lem`k`>FV^Z0Be6fe%3krFHl0SS&k;-oB z=fB{O?j|0E<13I9KDQ6@?9l0l!m-nr%HHzNQwIG|INn%EWpD9Y&k~Qqeb=s^6h5~P z#?N2>(GP|Df&EBjZ~4FYW#Un|OV>Ju&+UW$uk9org}*-O6h60mzSsi>J9aks*YtU+ z|C!3ZQOtkAQ}^&uji>(MqsrdkseAaS#!>(9QDtxN)IEGuK;C-anwJ2 zRM{Imbq^oaIO-ohs_YG(x`&Ty9Q6+$RrUr?-NQ#Uj{1j>DtqP^>|^3v+x)6j@00ZM zbKYL2+kLoiBz7HRuC3W#WVSnrUnZuD_v9UMnP=-n9Be!H|>@I{uoLE+Zzcd6_xo@Yk-p>RACN@Z{HXC5XVh1=Zf6h5~P#{ZrBiAUkzd(|m? zZXe{oe<$%MJb$q&h0pDS{Ksb#kHTGk&?$UwALOsTOgswz)7?(tbGzrO{mjoEhj`q+ znD;YTWj7t@A*kjDB%HV_e+NWR<adAJBRrVIoIz~T~_~U*itL#0#*pKkFpFBay zAO2!ND!Zwl|AOZ)66lA*@s|ox*;_pCLg@EK6wZxWi{RQ486-O~?+qyD9`w|MHFekdIEFO|K;Q}^^k;i!M9?BW;fXY8Hg7r(x1TY$Cv zPSJ94-aaP2Q?$13ZT>W*qk5x$qt&Trgd_ zZ#gUrazxI{O#E9K)AjGZxhryFX7<*dU$1}r*B|>gzTUaA_4`i`q&=JF>h=1)6{$5u z>PMz!O6o_aMdVUz27jY#=8Z^PB3JFWr1`l$t9f|GcvrVWm2VE)KgIT&Y=7#R$m|oT zFKQ3j%AAZHOE=vY?=#zui`${4V>z~EHQ#+~ysO)x$+66IMCSK(Ea+jyv8;|C3)_y1 z^-%woj^%@%)x7-LcvrVWlVjoBVeDKN^svHM8jP`}EXsb)qHHku@39wMZLWAIZl_v1 zAxaPM2%VnRkt6qwb#;3^j3)5EWbIp&G16G@jOB{kq48{v@P{^ypIELzDBwIt#mY zj}sflySg1(b)HsJ^YqW|U|>b$B*vT-w^MWd%*_*gvM5?duA$H5UERKj?nk>`Zk`Zp zh({}2|G2olEFM|seBb!xE#qC?4y`gzO+0t2OF!QEVFmpSv7Z}j98+9_tW=MwcE@6> zE5^IJz1>OARTMXfO~z+dB42W@S?8loi>Xg{jdgW9wCY@S%jPQHr{Xm|v{`+hI@+>* z3h|?H;p+CIt@K<)d(kkyJf0$7a;{kC_*L7d7}I23-43lfS1V<6HCP)AtRV1mdxhJn zxv}Qr5N&Pm*bxNB5`s1I6lmhoW)sA-qr0;?RQbe z$-Dujfy_qNtU_)xuj`A$NLRSQ6~;eBYdqrfk<265V(!2?kNBdQr;i!K{IR(k@nV7;T~Tm<{wu$(-N{U|DtPuDBN%LvasjCI>@jCXZAH0E>r1oypRd5hn1 z$$X_e_i)~0@ul%Yb$fVD#=N`mtVZbQVa>gwsq15B_vC9dAsw$%Xxq=itnEGq#A_rz z4(uXq+fRq0=b+FZJqsiL1J6UDAN`6~DIX=T5Fw#3Pqu%dWjvMq#kZM~ z5B?<2?*gnxCEtCSsoSAR{)=tnspJ_QuH=JX`7yDpCoK;HpQo#;bx~Su~$jsNm#YoAK~ z^Jkf|{oqfukNxV6@l^6(ZDvY7_+vh|pYi+1ZH%3IXUo2ixVjyhhi{BSB_I6B_Ak6Lo=W~A*1(l~ z@F)2zFN~*>Lqq$Ntw~N@Zt0Mj=#Re#@qr9ux!c5I$6lk2L2abNch6D zkHF&&-CEaPZ*$ zuyNqv;eUm9!pU$noDYZm?_qLqT4|KTkd1d6Iak?52@l zoB2PD|26y{co@R+gRpWoMu?ZgVc}RV567aI@$G+PH*JpP_-^X?tuGTVmECl3EQdBj zSbZJGViArU%hknW!MFcO5ypR;V|jl&_59>z;-#{i4vvLuXJcnxEW#0EnUG`Wx-9#B zmt}i<|Fx?bLQ*o!W;|vZD!cvSM^o{KpC_K|f|JUwEX!H`ht7ZDqwsy`RS}!_-{UQH zw>eJ;NAITCrLvoP{*T^2Syp&P=C4)7YyD!5;H9$n=Bmh* zV8=e|y5g;FT*SUm86W%$3ULs*qXfdHq6n8XRsnyh)=b>^f+B(sqCiSf5oT0-Qs7EiKUXg z5i91}`H1r?->8et`>%L%lJhWrIH~N))v>wKx(DU8V{BblxuW`2JxgWp)pe08Z?Udb zyw)$S(UF~Wtx(x@t@2z|bFKRIYs%s0gLPf;s$bQ!RCd+%yj+oQ6rVnZU`K8r%oW;g ze52O25xH`ybr0IxBBH%Ll=nX5rBrt7;A3^Uk~r2Nc-}q1OJ%of;CVOKoo{~gzIg}d zVr%erjcpP*)}|?TsqChnFX#GML_;uT+|;KuwxsqZZ{v$RUV9L@>(i;uda(+acf7sR!fi5InaT1t>U$QajoE_ zvfH)v*SeZ()vsSu8g*Uqs$bQ!RCd+%WX^s?zW1@N6}bjy;~TZEEyxw#?c0aOu(WD% zp5%*O{Km&T*b%Q_-Ew?)UJJW{;g;UnE{BzO514K3z2)txDaYEz@^<`%-}%xQ$5=*j z)p6=vaTW!KkA4(~KaC*ITk++U^XlgtUxna*WM9PRs}$b5pLnV4rZMh$UtU>{?Pp?N z_~M+6_{O&y=ht4!#~Ge5!}gzfb6mA)BKZM}J}+T4|=jW0+0pKD0IC3NJrotIzwmZ_>Qr3v3dU$&$AKd zIr}WdK2zEAI)lo7dujvXsOqD)isD;O z9rMO0Q6NBugKK_b7{V0urx4>{x*-brPRN4BU6N|#~CPd2kb9<9#ob+Sd@KV`( zEi@)m522^>mrO9nw){I#a(P%68T2S5Fdk!t;ur@;K}Y0_tK)u@G-ley-6|5?q?U%xUAj#ulTX|l6?J(Dw+8< zUyOg|+hTFCdH)s9_{ZE!M_1XEvdZjv@&Bl@ar97?74$TuqpI+sdzsPAD)a4jwc}M@ zP3udnGPMs?nQyny{47;fqI-tFk1^x2_wFSXfBI3bvdvs&S!Fl%{>v(Rkyw1;)5k!T z@A)z z%k)FxKDf}S>@EJo^~9s_AHC@mKDQ5EKfdVG4~4({tW()r{(t;9@hCjmA%)NF(f@+n zjc*NjaF5x$8nc)G&CB08tuBMR)^Rz^(?@zdiEoH3Y|HwEdF z-gR`m-2%7MbwuHK>mubk=5{}i1>*^3U}^F zr|`LbF#hw_hkhvh$6s|Sd&~ci?j;_Dzk0t@_}o6||Jr8aQTQ7dI)%^eo-gi!tUoti zr*-Jgo3su|Wj7tV8Y zQrTNP>lFP^IMy+#>@A-4i+(5^>zGvb7SB3GKNOC2Oe%YiFZK|8K_O32@`o=eQrS)Y z{1^O@oy4PXdu^&3ZL5t{qvMUKNOBPUQ*dx z{`u=a`k`5Ei< zGnIY4nE!%j{eX{ZJo^~(9 zQDtxN)IEGuK;C-anwJ2RM{Imbq^oaIO-ohs_dCxu#bsvZS$*Ay-(81 z&v|>9ZujB7k=S*NxwdM1k=gDfewmmq-jjF46`rjVvA_My-WK(c{^EjqShDLQmEG#X z*F&)%;fpMFgTk%Z?^4-YJkN~uL*aNPl*-=XPd`dL3b(P@DSU1pjQ=|i5|6@v@VZm@ z+&;*E|8C+@c>ZEl3ZL5t`A^Oy9)-K|uv7TlKFD8tm3S2Xr#qd(=XTE*`@A*kh<YN)$gs{RKHT$O$T}EmVPK4^(&RV#Rog+#{tLlj8yg(Pu&QtRGU@TRe43KNODomCD}YSvTm1!m)lxWpDA+J^fHP>R&3m_yzkJd#CutukYCw zU^Tx}v|OCGkBRRTt*v{TKMm=q-l*UBYix+w Date: Sat, 18 Nov 2023 13:52:20 +0100 Subject: [PATCH 07/14] Updating test data --- testdata/algo/deep_region_au15b.gds | Bin 1664 -> 1664 bytes testdata/drc/drcSimpleTests_au26d.gds | Bin 3562 -> 2952 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/testdata/algo/deep_region_au15b.gds b/testdata/algo/deep_region_au15b.gds index da172280c352ae0f84267f4a9fe72c4b673a4086..5c6489bb1d873bdb744ff068cd54891e1920dc70 100644 GIT binary patch delta 287 zcmZqRZQzY!U}IonieQjoWMY5Lz|A1Uz{_CBV2;dY;9z3&@pNKf5MgGubL=$tKDPXW zrOOWe1+$|<7-U#+>YE(GICJ9L0C60~PK=s7`7L9BAr5HYE(JIC*kEbAUJwb0*z`?}kjG18Sojxzz0mNGff Date: Sat, 18 Nov 2023 18:57:08 +0100 Subject: [PATCH 08/14] Some refactoring --- src/db/db/dbCompoundOperation.h | 12 ++++--- src/db/db/dbDeepEdges.cc | 29 ++++------------- src/db/db/dbDeepRegion.cc | 49 ++--------------------------- src/db/db/dbDeepShapeStore.cc | 46 ++++++++++++++++++++------- src/db/db/dbDeepShapeStore.h | 16 ++-------- src/db/db/dbHierProcessor.cc | 45 +++++++++++++++++++++----- src/db/db/dbHierProcessor.h | 15 ++++----- src/db/db/dbLayout.cc | 11 +++++++ src/db/db/dbLayout.h | 16 ++++++++++ src/db/db/dbLocalOperation.h | 6 ++++ src/db/db/dbRegionLocalOperations.h | 8 +++++ 11 files changed, 138 insertions(+), 115 deletions(-) diff --git a/src/db/db/dbCompoundOperation.h b/src/db/db/dbCompoundOperation.h index d9cbf840f..7c13a67e0 100644 --- a/src/db/db/dbCompoundOperation.h +++ b/src/db/db/dbCompoundOperation.h @@ -1755,8 +1755,10 @@ public: : mp_node (node) { } - const TransformationReducer *vars () const { return mp_node->vars (); } - bool wants_variants () const { return mp_node->wants_variants (); } + virtual const TransformationReducer *vars () const + { + return mp_node->vars (); + } protected: virtual void do_compute_local (db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const @@ -1802,8 +1804,10 @@ public: } } - const TransformationReducer *vars () const { return mp_node->vars (); } - bool wants_variants () const { return mp_node->wants_variants (); } + virtual const TransformationReducer *vars () const + { + return mp_node->vars (); + } protected: virtual void do_compute_local (db::Layout *layout, db::Cell *cell, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &results, const db::LocalProcessorBase *proc) const diff --git a/src/db/db/dbDeepEdges.cc b/src/db/db/dbDeepEdges.cc index ae584c443..6c1438a22 100644 --- a/src/db/db/dbDeepEdges.cc +++ b/src/db/db/dbDeepEdges.cc @@ -2012,9 +2012,15 @@ public: return tl::to_string (tr ("Generic DRC check")); } + virtual const db::TransformationReducer *vars () const + { + return &m_vars; + } + private: EdgeRelationFilter m_check; bool m_has_other; + db::MagnificationReducer m_vars; }; } @@ -2032,28 +2038,6 @@ DeepEdges::run_check (db::edge_relation_type rel, const Edges *other, db::Coord const db::DeepLayer &edges = merged_deep_layer (); - // create cell variants for magnification if needed - - db::cell_variants_collector vars; - vars.collect (edges.layout (), edges.initial_cell ()); - - // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? - const_cast (edges).separate_variants (vars); - - if (other_deep && &other_deep->deep_layer ().layout () != &edges.layout ()) { - - // create cell variants for magnification for the other input if needed - - const db::DeepLayer &other_layer = other_deep->deep_layer (); - - db::cell_variants_collector vars; - vars.collect (other_layer.layout (), other_layer.initial_cell ()); - - // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? - const_cast (other_layer).separate_variants (vars); - - } - EdgeRelationFilter check (rel, d, options.metrics); check.set_include_zero (false); check.set_whole_edges (options.whole_edges); @@ -2071,7 +2055,6 @@ DeepEdges::run_check (db::edge_relation_type rel, const Edges *other, db::Coord other_deep ? &other_deep->deep_layer ().initial_cell () : const_cast (&edges.initial_cell ())); proc.set_base_verbosity (base_verbosity ()); - proc.set_vars (&vars); proc.set_threads (edges.store ()->threads ()); proc.run (&op, edges.layer (), other_deep ? other_deep->deep_layer ().layer () : edges.layer (), res->deep_layer ().layer ()); diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index 897a14ec6..e21620e0c 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -1799,18 +1799,7 @@ Output *region_cop_impl (DeepRegion *region, db::CompoundRegionOperationNode &no } compound_local_operation op (&node); - - // Prepare cell variants if needed - auto op_vars = op.vars (); - db::VariantsCollectorBase vc (op_vars); - if (op.wants_variants () && op_vars) { - vc.collect (polygons.layout (), polygons.initial_cell ()); - // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? - const_cast (polygons).separate_variants (vc); - proc.set_vars (&vc); - } - - proc.run (&op, polygons.layer (), other_layers, res->deep_layer ().layer ()); + proc.run (&op, polygons.layer (), other_layers, res->deep_layer ().layer (), true /*make_variants*/); return res.release (); } @@ -1863,17 +1852,7 @@ Output *region_cop_with_properties_impl (DeepRegion *region, db::CompoundRegionO } compound_local_operation_with_properties op (&node, prop_constraint, res->properties_repository (), subject_pr, intruder_prs); - - // Prepare cell variants if needed - db::VariantsCollectorBase vc (op.vars ()); - if (op.wants_variants ()) { - vc.collect (polygons.layout (), polygons.initial_cell ()); - // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? - const_cast (polygons).separate_variants (vc); - proc.set_vars (&vc); - } - - proc.run (&op, polygons.layer (), other_layers, res->deep_layer ().layer ()); + proc.run (&op, polygons.layer (), other_layers, res->deep_layer ().layer (), true /*make_variants*/); return res.release (); } @@ -1974,28 +1953,6 @@ DeepRegion::run_check (db::edge_relation_type rel, bool different_polygons, cons const db::DeepLayer &polygons = needs_merged_primary ? merged_deep_layer () : deep_layer (); - // create cell variants for magnification if needed - - db::cell_variants_collector vars; - vars.collect (polygons.layout (), polygons.initial_cell ()); - - // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? - const_cast (polygons).separate_variants (vars); - - if (other_deep && &other_deep->deep_layer ().layout () != &polygons.layout ()) { - - // create cell variants for magnification for the other input if needed - - const db::DeepLayer &other_layer = other_deep->deep_layer (); - - db::cell_variants_collector vars; - vars.collect (other_layer.layout (), other_layer.initial_cell ()); - - // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? - const_cast (other_layer).separate_variants (vars); - - } - EdgeRelationFilter check (rel, d, options.metrics); check.set_include_zero (false); check.set_whole_edges (options.whole_edges); @@ -2021,7 +1978,6 @@ DeepRegion::run_check (db::edge_relation_type rel, bool different_polygons, cons subject_breakout_cells, intruder_breakout_cells); configure_proc (proc); - proc.set_vars (&vars); proc.set_threads (polygons.store ()->threads ()); proc.run (&op, polygons.layer (), other_layer, res->deep_layer ().layer ()); @@ -2035,7 +1991,6 @@ DeepRegion::run_check (db::edge_relation_type rel, bool different_polygons, cons subject_breakout_cells, intruder_breakout_cells); configure_proc (proc); - proc.set_vars (&vars); proc.set_threads (polygons.store ()->threads ()); proc.run (&op, polygons.layer (), other_layer, res->deep_layer ().layer ()); diff --git a/src/db/db/dbDeepShapeStore.cc b/src/db/db/dbDeepShapeStore.cc index 7fb293523..620c5f2fa 100644 --- a/src/db/db/dbDeepShapeStore.cc +++ b/src/db/db/dbDeepShapeStore.cc @@ -287,8 +287,31 @@ struct DeepShapeStore::LayoutHolder db::LayoutToNetlist *mp_l2n; }; + class VariantsCreatedListener + : public tl::Object + { + public: + VariantsCreatedListener (DeepShapeStore::LayoutHolder *lh, db::Layout *ly) + : mp_lh (lh) + { + ly->variants_created_event.add (this, &VariantsCreatedListener::variants_created); + } + + private: + void variants_created (const std::map > *var_map) + { + for (std::map >::const_iterator i = var_map->begin (); i != var_map->end (); ++i) { + for (std::map::const_iterator j = i->second.begin (); j != i->second.end (); ++j) { + mp_lh->builder.register_variant (i->first, j->second); + } + } + } + + DeepShapeStore::LayoutHolder *mp_lh; + }; + LayoutHolder (const db::ICplxTrans &trans) - : refs (0), layout (false), builder (&layout, trans) + : refs (0), layout (false), builder (&layout, trans), variants_created (this, &layout) { // .. nothing yet .. } @@ -337,6 +360,9 @@ struct DeepShapeStore::LayoutHolder int refs; db::Layout layout; db::HierarchyBuilder builder; + +private: + VariantsCreatedListener variants_created; std::map > net_builders; std::map layer_refs; }; @@ -1048,17 +1074,6 @@ DeepLayer DeepShapeStore::create_text_layer (const db::RecursiveShapeIterator &s return create_custom_layer (si, &refs, trans); } -void -DeepShapeStore::issue_variants (unsigned int layout_index, const std::map > &var_map) -{ - db::HierarchyBuilder &builder = m_layouts [layout_index]->builder; - for (std::map >::const_iterator i = var_map.begin (); i != var_map.end (); ++i) { - for (std::map::const_iterator j = i->second.begin (); j != i->second.end (); ++j) { - builder.register_variant (i->first, j->second); - } - } -} - const db::CellMapping & DeepShapeStore::internal_cell_mapping (unsigned int into_layout_index, unsigned int from_layout_index) { @@ -1268,6 +1283,13 @@ namespace }; } +void +DeepShapeStore::separate_variants (unsigned int layout_index, db::VariantsCollectorBase &coll) +{ + tl_assert (is_valid_layout_index (layout_index)); + layout (layout_index).separate_variants (coll, initial_cell (layout_index).cell_index ()); +} + void DeepShapeStore::insert (const DeepLayer &deep_layer, db::Layout *into_layout, db::cell_index_type into_cell, unsigned int into_layer) { diff --git a/src/db/db/dbDeepShapeStore.h b/src/db/db/dbDeepShapeStore.h index 98c53c8fa..c53cc37d6 100644 --- a/src/db/db/dbDeepShapeStore.h +++ b/src/db/db/dbDeepShapeStore.h @@ -49,6 +49,7 @@ class Texts; class ShapeCollection; class NetBuilder; class LayoutToNetlist; +class VariantsCollectorBase; /** * @brief Represents a shape collection from the deep shape store @@ -561,20 +562,7 @@ public: * To use this method, first create a variant collector (db::cell_variant_collector) with the required * reducer and collect the variants. Then call this method on the desired layout index to create the variants. */ - template - void separate_variants (unsigned int layout_index, VarCollector &coll) - { - tl_assert (is_valid_layout_index (layout_index)); - - std::map > var_map; - coll.separate_variants (layout (layout_index), initial_cell (layout_index), &var_map); - if (var_map.empty ()) { - // nothing to do. - return; - } - - issue_variants (layout_index, var_map); - } + void separate_variants (unsigned int layout_index, db::VariantsCollectorBase &coll); /** * @brief Commits shapes for variants to the existing cell hierarchy diff --git a/src/db/db/dbHierProcessor.cc b/src/db/db/dbHierProcessor.cc index b93f96f35..636563fc0 100644 --- a/src/db/db/dbHierProcessor.cc +++ b/src/db/db/dbHierProcessor.cc @@ -1143,7 +1143,7 @@ public: db::Box ref_box = db::box_convert () (*ref); for (db::CellInstArray::iterator n = inst->begin_touching (safe_box_enlarged (ref_box, m_dist - 1, m_dist - 1), inst_bc); !n.at_end (); ++n) { db::ICplxTrans tn = inst->complex_trans (*n); - db::Box region = ref_box.enlarged (db::Vector (m_dist, m_dist)).transformed (tn.inverted ()) & intruder_cell.bbox (m_intruder_layer) /*.enlarged (db::Vector (m_dist, m_dist))@@@*/; + db::Box region = ref_box.enlarged (db::Vector (m_dist, m_dist)).transformed (tn.inverted ()) & intruder_cell.bbox (m_intruder_layer); if (! region.empty ()) { add_shapes_from_intruder_inst (id1, intruder_cell, tn, inst_id, region); } @@ -1551,35 +1551,64 @@ size_t local_processor::get_progress () const } template -void local_processor::run (local_operation *op, unsigned int subject_layer, unsigned int intruder_layer, unsigned int output_layer) +void local_processor::run (local_operation *op, unsigned int subject_layer, unsigned int intruder_layer, unsigned int output_layer, bool make_variants) { std::vector ol, il; ol.push_back (output_layer); il.push_back (intruder_layer); - run (op, subject_layer, il, ol); + run (op, subject_layer, il, ol, make_variants); } template -void local_processor::run (local_operation *op, unsigned int subject_layer, unsigned int intruder_layer, const std::vector &output_layers) +void local_processor::run (local_operation *op, unsigned int subject_layer, unsigned int intruder_layer, const std::vector &output_layers, bool make_variants) { std::vector ol, il; il.push_back (intruder_layer); - run (op, subject_layer, il, output_layers); + run (op, subject_layer, il, output_layers, make_variants); } template -void local_processor::run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, unsigned int output_layer) +void local_processor::run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, unsigned int output_layer, bool make_variants) { std::vector ol; ol.push_back (output_layer); - run (op, subject_layer, intruder_layers, ol); + run (op, subject_layer, intruder_layers, ol, make_variants); } template -void local_processor::run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, const std::vector &output_layers) +void local_processor::run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, const std::vector &output_layers, bool make_variants) { tl::SelfTimer timer (tl::verbosity () > base_verbosity (), tl::to_string (tr ("Executing ")) + description (op)); + set_vars_owned (0); + + // Prepare cell variants if needed + if (make_variants) { + + tl::SelfTimer timer (tl::verbosity () > base_verbosity () + 10, tl::to_string (tr ("Cell variant formation"))); + + auto op_vars = op->vars (); + if (op_vars) { + + db::VariantsCollectorBase *coll = new db::VariantsCollectorBase (op_vars); + set_vars_owned (coll); + + coll->collect (*mp_subject_layout, *mp_subject_top); + mp_subject_layout->separate_variants (*coll, mp_subject_top->cell_index ()); + + if (mp_intruder_layout != mp_subject_layout) { + db::VariantsCollectorBase vci (op_vars); + vci.collect (*mp_intruder_layout, *mp_intruder_top); + if (vci.has_variants ()) { + // intruder layout needs to be the same one in that case - we do not want the secondary layout to be modified + throw tl::Exception (tl::to_string (tr ("Can't modify second layout for cell variant formation - this case is not supported as of now"))); + } + } + + } + + } + local_processor_contexts contexts; compute_contexts (contexts, op, subject_layer, intruder_layers); compute_results (contexts, op, output_layers); diff --git a/src/db/db/dbHierProcessor.h b/src/db/db/dbHierProcessor.h index e0f6a9778..cffd05ee8 100644 --- a/src/db/db/dbHierProcessor.h +++ b/src/db/db/dbHierProcessor.h @@ -30,6 +30,7 @@ #include "dbLayout.h" #include "dbLocalOperation.h" #include "dbGenericShapeIterator.h" +#include "dbCellVariants.h" #include "tlThreadedWorkers.h" #include "tlProgress.h" @@ -44,8 +45,6 @@ namespace db { -class VariantsCollectorBase; - template class local_processor; template class local_processor_cell_context; template class local_processor_contexts; @@ -485,8 +484,9 @@ public: return m_boolean_core; } - void set_vars (const db::VariantsCollectorBase *vars) + void set_vars_owned (db::VariantsCollectorBase *vars) { + mp_vars_owned.reset (vars); mp_vars = vars; } @@ -517,6 +517,7 @@ private: bool m_boolean_core; int m_base_verbosity; const db::VariantsCollectorBase *mp_vars; + std::unique_ptr mp_vars_owned; mutable const db::Cell *mp_current_cell; }; @@ -528,10 +529,10 @@ public: local_processor (db::Layout *layout = 0, db::Cell *top = 0, const std::set *breakout_cells = 0); local_processor (db::Layout *subject_layout, db::Cell *subject_top, const db::Layout *intruder_layout, const db::Cell *intruder_cell, const std::set *subject_breakout_cells = 0, const std::set *intruder_breakout_cells = 0); - void run (local_operation *op, unsigned int subject_layer, unsigned int intruder_layer, unsigned int output_layers); - void run (local_operation *op, unsigned int subject_layer, unsigned int intruder_layer, const std::vector &output_layers); - void run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, const std::vector &output_layers); - void run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, unsigned int output_layer); + void run (local_operation *op, unsigned int subject_layer, unsigned int intruder_layer, unsigned int output_layers, bool make_variants = true); + void run (local_operation *op, unsigned int subject_layer, unsigned int intruder_layer, const std::vector &output_layers, bool make_variants = true); + void run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, const std::vector &output_layers, bool make_variants = true); + void run (local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers, unsigned int output_layer, bool make_variants = true); void compute_contexts (local_processor_contexts &contexts, const local_operation *op, unsigned int subject_layer, const std::vector &intruder_layers) const; void compute_results (local_processor_contexts &contexts, const local_operation *op, const std::vector &output_layers) const; diff --git a/src/db/db/dbLayout.cc b/src/db/db/dbLayout.cc index a02ffa949..5ae8af700 100644 --- a/src/db/db/dbLayout.cc +++ b/src/db/db/dbLayout.cc @@ -33,6 +33,7 @@ #include "dbColdProxy.h" #include "dbLibraryManager.h" #include "dbLibrary.h" +#include "dbCellVariants.h" #include "dbRegion.h" #include "dbEdgePairs.h" #include "dbEdges.h" @@ -40,6 +41,7 @@ #include "dbCellMapping.h" #include "dbLayerMapping.h" #include "dbLayoutUtils.h" +#include "dbCellVariants.h" #include "tlTimer.h" #include "tlLog.h" #include "tlInternational.h" @@ -1810,6 +1812,15 @@ Layout::do_update () delete pr; } +void +Layout::separate_variants (db::VariantsCollectorBase &coll, cell_index_type initial_cell) +{ + std::map > var_table; + coll.separate_variants (*this, cell (initial_cell), &var_table); + + variants_created_event (&var_table); +} + static Layout::meta_info_map s_empty_meta; Layout::meta_info_iterator diff --git a/src/db/db/dbLayout.h b/src/db/db/dbLayout.h index 353ad2ad9..1ba18bdbd 100644 --- a/src/db/db/dbLayout.h +++ b/src/db/db/dbLayout.h @@ -71,6 +71,7 @@ class Texts; class Technology; class CellMapping; class LayerMapping; +class VariantsCollectorBase; template class generic_repository; typedef generic_repository GenericRepository; @@ -1657,6 +1658,15 @@ public: */ void update () const; + /** + * @brief Separates cell variants as given by the cell variant collector + * + * The cell variant collector must have been setup with the desired variants + * using "collect". The new cell variants will be created and a "variants_created" + * event is issued. + */ + void separate_variants (db::VariantsCollectorBase &coll, cell_index_type initial_cell); + /** * @brief Forces an update even if the layout is under construction * @@ -2068,6 +2078,12 @@ public: */ tl::Event technology_changed_event; + /** + * @brief This event is raised when cell variants are built + * It will specify a list of cells with their new variants. + */ + tl::event > *> variants_created_event; + protected: /** * @brief Establish the graph's internals according to the dirty flags diff --git a/src/db/db/dbLocalOperation.h b/src/db/db/dbLocalOperation.h index faccd6bf1..96dee1656 100644 --- a/src/db/db/dbLocalOperation.h +++ b/src/db/db/dbLocalOperation.h @@ -38,6 +38,7 @@ namespace db template class shape_interactions; class LocalProcessorBase; +class TransformationReducer; /** * @brief Indicates the desired behaviour for subject shapes for which there is no intruder @@ -117,6 +118,11 @@ public: */ virtual db::Coord dist () const { return 0; } + /** + * @brief Gets the cell variant reducer that indicates whether to build cell variants and which + */ + virtual const db::TransformationReducer *vars () const { return 0; } + protected: /** * @brief Computes the results from a given set of interacting shapes diff --git a/src/db/db/dbRegionLocalOperations.h b/src/db/db/dbRegionLocalOperations.h index 76166715b..b1ffc8785 100644 --- a/src/db/db/dbRegionLocalOperations.h +++ b/src/db/db/dbRegionLocalOperations.h @@ -254,6 +254,11 @@ public: virtual std::string description () const; virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const; + + virtual const db::TransformationReducer *vars () const { return &m_vars; } + +private: + db::MagnificationReducer m_vars; }; template @@ -270,8 +275,11 @@ public: virtual void do_compute_local (db::Layout *layout, db::Cell *subject_cell, const shape_interactions, db::object_with_properties > &interactions, std::vector > &results, const db::LocalProcessorBase * /*proc*/) const; + virtual const db::TransformationReducer *vars () const { return &m_vars; } + private: mutable db::PropertyMapper m_pms, m_pmi; + db::MagnificationReducer m_vars; }; typedef check_local_operation CheckLocalOperation; From d0172d57f3f70b24390ff7122c48ae7668ef4130 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 18 Nov 2023 19:12:13 +0100 Subject: [PATCH 09/14] Further optimization/refactoring --- src/db/db/dbCellVariants.cc | 37 ++++++++++++++++++++++++++++++++ src/db/db/dbCellVariants.h | 8 +++++++ src/db/db/dbCompoundOperation.cc | 9 ++++++++ src/db/db/dbCompoundOperation.h | 3 +++ 4 files changed, 57 insertions(+) diff --git a/src/db/db/dbCellVariants.cc b/src/db/db/dbCellVariants.cc index a71d9eb52..9e274d6c5 100644 --- a/src/db/db/dbCellVariants.cc +++ b/src/db/db/dbCellVariants.cc @@ -43,6 +43,11 @@ db::Trans OrientationReducer::reduce (const db::Trans &trans) const return db::Trans (trans.fp_trans ()); } +bool OrientationReducer::equals (const TransformationReducer *other) const +{ + return dynamic_cast (other) != 0; +} + // ------------------------------------------------------------------------------------------ db::ICplxTrans OrthogonalTransformationReducer::reduce (const db::ICplxTrans &trans) const @@ -63,6 +68,11 @@ db::Trans OrthogonalTransformationReducer::reduce (const db::Trans &) const return db::Trans (); } +bool OrthogonalTransformationReducer::equals (const TransformationReducer *other) const +{ + return dynamic_cast (other) != 0; +} + // ------------------------------------------------------------------------------------------ db::ICplxTrans MagnificationReducer::reduce (const db::ICplxTrans &trans) const @@ -75,6 +85,11 @@ db::Trans MagnificationReducer::reduce (const db::Trans &) const return db::Trans (); } +bool MagnificationReducer::equals (const TransformationReducer *other) const +{ + return dynamic_cast (other) != 0; +} + // ------------------------------------------------------------------------------------------ db::ICplxTrans XYAnisotropyAndMagnificationReducer::reduce (const db::ICplxTrans &trans) const @@ -91,6 +106,11 @@ db::Trans XYAnisotropyAndMagnificationReducer::reduce (const db::Trans &trans) c return db::Trans (trans.angle () % 2, false, db::Vector ()); } +bool XYAnisotropyAndMagnificationReducer::equals (const TransformationReducer *other) const +{ + return dynamic_cast (other) != 0; +} + // ------------------------------------------------------------------------------------------ db::ICplxTrans MagnificationAndOrientationReducer::reduce (const db::ICplxTrans &trans) const @@ -105,6 +125,11 @@ db::Trans MagnificationAndOrientationReducer::reduce (const db::Trans &trans) co return db::Trans (trans.fp_trans ()); } +bool MagnificationAndOrientationReducer::equals (const TransformationReducer *other) const +{ + return dynamic_cast (other) != 0; +} + // ------------------------------------------------------------------------------------------ GridReducer::GridReducer (db::Coord grid) @@ -130,6 +155,12 @@ db::Trans GridReducer::reduce (const db::Trans &trans) const return res; } +bool GridReducer::equals (const TransformationReducer *other) const +{ + const GridReducer *red = dynamic_cast (other); + return red != 0 && red->m_grid == m_grid; +} + // ------------------------------------------------------------------------------------------ ScaleAndGridReducer::ScaleAndGridReducer (db::Coord grid, db::Coord mult, db::Coord div) @@ -174,6 +205,12 @@ db::Trans ScaleAndGridReducer::reduce (const db::Trans &trans) const return res; } +bool ScaleAndGridReducer::equals (const TransformationReducer *other) const +{ + const ScaleAndGridReducer *red = dynamic_cast (other); + return red != 0 && red->m_grid == m_grid && red->m_mult == m_mult; +} + // ------------------------------------------------------------------------------------------ VariantsCollectorBase::VariantsCollectorBase () diff --git a/src/db/db/dbCellVariants.h b/src/db/db/dbCellVariants.h index aebbfd5b1..798771a6f 100644 --- a/src/db/db/dbCellVariants.h +++ b/src/db/db/dbCellVariants.h @@ -54,6 +54,7 @@ public: virtual db::ICplxTrans reduce_trans (const db::ICplxTrans &trans) const { return reduce (trans); } virtual db::Trans reduce (const db::Trans &trans) const = 0; virtual db::ICplxTrans reduce (const db::ICplxTrans &trans) const = 0; + virtual bool equals (const TransformationReducer *other) const = 0; virtual bool is_translation_invariant () const { return true; } }; @@ -67,6 +68,7 @@ struct DB_PUBLIC OrientationReducer { db::ICplxTrans reduce (const db::ICplxTrans &trans) const; db::Trans reduce (const db::Trans &trans) const; + virtual bool equals (const TransformationReducer *other) const; }; /** @@ -77,6 +79,7 @@ struct DB_PUBLIC OrthogonalTransformationReducer { db::ICplxTrans reduce (const db::ICplxTrans &trans) const; db::Trans reduce (const db::Trans &trans) const; + virtual bool equals (const TransformationReducer *other) const; }; /** @@ -89,6 +92,7 @@ struct DB_PUBLIC MagnificationReducer { db::ICplxTrans reduce (const db::ICplxTrans &trans) const; db::Trans reduce (const db::Trans &) const; + virtual bool equals (const TransformationReducer *other) const; }; /** @@ -101,6 +105,7 @@ struct DB_PUBLIC XYAnisotropyAndMagnificationReducer { db::ICplxTrans reduce (const db::ICplxTrans &trans) const; db::Trans reduce (const db::Trans &trans) const; + virtual bool equals (const TransformationReducer *other) const; }; /** @@ -113,6 +118,7 @@ struct DB_PUBLIC MagnificationAndOrientationReducer { db::ICplxTrans reduce (const db::ICplxTrans &trans) const; db::Trans reduce (const db::Trans &trans) const; + virtual bool equals (const TransformationReducer *other) const; }; /** @@ -127,6 +133,7 @@ struct DB_PUBLIC GridReducer db::ICplxTrans reduce (const db::ICplxTrans &trans) const; db::Trans reduce (const db::Trans &trans) const; + virtual bool equals (const TransformationReducer *other) const; bool is_translation_invariant () const { return false; } @@ -150,6 +157,7 @@ struct DB_PUBLIC ScaleAndGridReducer virtual db::Trans reduce_trans (const db::Trans &trans) const; virtual db::ICplxTrans reduce (const db::ICplxTrans &trans) const; virtual db::Trans reduce (const db::Trans &trans) const; + virtual bool equals (const TransformationReducer *other) const; bool is_translation_invariant () const { return false; } diff --git a/src/db/db/dbCompoundOperation.cc b/src/db/db/dbCompoundOperation.cc index 0efbde07a..2601d98ec 100644 --- a/src/db/db/dbCompoundOperation.cc +++ b/src/db/db/dbCompoundOperation.cc @@ -236,7 +236,16 @@ void CompoundTransformationReducer::add (const db::TransformationReducer *reducer) { if (reducer) { + + // do not add the same reducer twice + for (auto v = m_vars.begin (); v != m_vars.end (); ++v) { + if (reducer->equals (*v)) { + return; + } + } + m_vars.push_back (reducer); + } } diff --git a/src/db/db/dbCompoundOperation.h b/src/db/db/dbCompoundOperation.h index 7c13a67e0..953768c18 100644 --- a/src/db/db/dbCompoundOperation.h +++ b/src/db/db/dbCompoundOperation.h @@ -431,6 +431,9 @@ public: virtual db::ICplxTrans reduce (const db::ICplxTrans &trans) const; virtual bool is_translation_invariant () const; + // NOTE: equality does not really matter here as we use it only on leaf reducers + virtual bool equals (const TransformationReducer *other) const { return false; } + private: std::vector m_vars; }; From b0648e1c45565410aff965ccce1b6856613bbf22 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 18 Nov 2023 21:21:00 +0100 Subject: [PATCH 10/14] Experimental: sparse cell variants table --- src/db/db/dbCellVariants.cc | 154 +++++++++++++++-------- src/db/db/dbCellVariants.h | 21 +++- src/db/db/dbCompoundOperation.h | 30 ++--- src/db/db/dbDeepEdgePairs.cc | 8 +- src/db/db/dbDeepEdges.cc | 42 +++---- src/db/db/dbDeepRegion.cc | 65 ++++------ src/db/db/dbDeepTexts.cc | 10 +- src/db/db/dbHierProcessor.cc | 6 +- src/db/db/dbLayoutUtils.cc | 4 +- src/db/db/dbShapeCollectionUtils.h | 8 +- src/db/unit_tests/dbCellVariantsTests.cc | 75 ++++++----- 11 files changed, 224 insertions(+), 199 deletions(-) diff --git a/src/db/db/dbCellVariants.cc b/src/db/db/dbCellVariants.cc index 9e274d6c5..b842b2585 100644 --- a/src/db/db/dbCellVariants.cc +++ b/src/db/db/dbCellVariants.cc @@ -230,32 +230,45 @@ VariantsCollectorBase::collect (const db::Layout &layout, const db::Cell &top_ce { tl_assert (mp_red != 0); - // The top cell gets a "variant" with unit transformation - m_variants [top_cell.cell_index ()].insert (std::make_pair (db::ICplxTrans (), 1)); + m_called.clear (); + m_called.insert (top_cell.cell_index ()); - std::set called; - top_cell.collect_called_cells (called); + top_cell.collect_called_cells (m_called); for (db::Layout::top_down_const_iterator c = layout.begin_top_down (); c != layout.end_top_down (); ++c) { - if (called.find (*c) == called.end ()) { + if (m_called.find (*c) == m_called.end ()) { continue; } // collect the parent variants per parent cell - std::map > variants_per_parent_cell; + std::map > variants_per_parent_cell; for (db::Cell::parent_inst_iterator pi = layout.cell (*c).begin_parent_insts (); ! pi.at_end (); ++pi) { - std::map &variants = variants_per_parent_cell [pi->inst ().object ().cell_index ()]; + std::set &variants = variants_per_parent_cell [pi->inst ().object ().cell_index ()]; add_variant (variants, pi->child_inst ().cell_inst (), mp_red->is_translation_invariant ()); } // compute the resulting variants - std::map &new_variants = m_variants [*c]; + std::set new_variants; - for (std::map >::const_iterator pv = variants_per_parent_cell.begin (); pv != variants_per_parent_cell.end (); ++pv) { - product (variants (pv->first), pv->second, new_variants); + auto vc = m_variants.find (*c); + if (vc != m_variants.end ()) { + new_variants = vc->second; + } + + for (auto pv = variants_per_parent_cell.begin (); pv != variants_per_parent_cell.end (); ++pv) { + auto v = m_variants.find (pv->first); + if (v != m_variants.end ()) { + product (v->second, pv->second, new_variants); + } else { + new_variants.insert (pv->second.begin (), pv->second.end ()); + } + } + + if (new_variants.size () > 1 || (new_variants.size () == 1 && ! new_variants.begin ()->is_unity ())) { + m_variants [*c] = std::move (new_variants); } } @@ -287,8 +300,8 @@ VariantsCollectorBase::separate_variants (db::Layout &layout, db::Cell &top_cell db::Cell &cell = layout.cell (*c); - std::map &vv = m_variants [*c]; - if (vv.size () > 1) { + auto vc = m_variants.find (*c); + if (vc != m_variants.end () && vc->second.size () > 1) { std::map &vt = (*var_table) [*c]; @@ -302,11 +315,11 @@ VariantsCollectorBase::separate_variants (db::Layout &layout, db::Cell &top_cell cell.clear_insts (); int index = 0; - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v, ++index) { + for (auto v = vc->second.begin (); v != vc->second.end (); ++v, ++index) { db::cell_index_type ci_var; - if (v != vv.begin ()) { + if (v != vc->second.begin ()) { std::string var_name = layout.cell_name (*c); var_name += "$VAR" + tl::to_string (index); @@ -316,21 +329,27 @@ VariantsCollectorBase::separate_variants (db::Layout &layout, db::Cell &top_cell copy_shapes (layout, ci_var, *c); // a new entry for the variant - m_variants [ci_var].insert (*v); + if (! v->is_unity ()) { + m_variants [ci_var].insert (*v); + } } else { ci_var = *c; } - vt.insert (std::make_pair (v->first, ci_var)); - create_var_instances (layout.cell (ci_var), inst, v->first, *var_table, mp_red->is_translation_invariant ()); + vt.insert (std::make_pair (*v, ci_var)); + create_var_instances (layout.cell (ci_var), inst, *v, *var_table, mp_red->is_translation_invariant ()); } // correct the first (remaining) entry - std::pair v1 = *vt.begin (); - vv.clear (); - vv.insert (v1); + if (! vt.begin ()->first.is_unity ()) { + std::set &tv = m_variants [*c]; + tv.clear (); + tv.insert (vt.begin ()->first); + } else { + m_variants.erase (*c); + } } else { @@ -352,7 +371,12 @@ VariantsCollectorBase::separate_variants (db::Layout &layout, db::Cell &top_cell } cell.clear_insts (); - create_var_instances (cell, inst, vv.begin ()->first, *var_table, mp_red->is_translation_invariant ()); + + if (vc != m_variants.end ()) { + create_var_instances (cell, inst, *vc->second.begin (), *var_table, mp_red->is_translation_invariant ()); + } else { + create_var_instances (cell, inst, db::ICplxTrans (), *var_table, mp_red->is_translation_invariant ()); + } } @@ -387,14 +411,14 @@ VariantsCollectorBase::commit_shapes (db::Layout &layout, db::Cell &top_cell, un db::Cell &cell = layout.cell (*c); - std::map &vvc = m_variants [*c]; - if (vvc.size () > 1) { + auto vvc = m_variants.find (*c); + if (vvc != m_variants.end () && vvc->second.size () > 1) { - for (std::map::const_iterator vc = vvc.begin (); vc != vvc.end (); ++vc) { + for (auto vc = vvc->second.begin (); vc != vvc->second.end (); ++vc) { for (db::Cell::const_iterator i = cell.begin (); ! i.at_end (); ++i) { - std::map >::const_iterator tc = to_commit.find (i->cell_index ()); + auto tc = to_commit.find (i->cell_index ()); if (tc != to_commit.end ()) { const std::map &vt = tc->second; @@ -406,11 +430,11 @@ VariantsCollectorBase::commit_shapes (db::Layout &layout, db::Cell &top_cell, un for (db::CellInstArray::iterator ia = i->begin (); ! ia.at_end (); ++ia) { db::ICplxTrans t = i->complex_trans (*ia); - db::ICplxTrans rt = mp_red->reduce (vc->first * mp_red->reduce_trans (t)); + db::ICplxTrans rt = mp_red->reduce (*vc * mp_red->reduce_trans (t)); std::map::const_iterator v = vt.find (rt); if (v != vt.end ()) { - db::Shapes &ps = propagated [vc->first]; + db::Shapes &ps = propagated [*vc]; tl::ident_map pm; for (db::Shapes::shape_iterator si = v->second.begin (db::ShapeIterator::All); ! si.at_end (); ++si) { @@ -431,7 +455,7 @@ VariantsCollectorBase::commit_shapes (db::Layout &layout, db::Cell &top_cell, un // single variant -> we can commit any shapes we have kept for this cell directly to the cell - std::map >::iterator l = to_commit.find (*c); + auto l = to_commit.find (*c); if (l != to_commit.end ()) { tl_assert (l->second.size () == 1); cell.shapes (layer).insert (l->second.begin ()->second); @@ -442,7 +466,7 @@ VariantsCollectorBase::commit_shapes (db::Layout &layout, db::Cell &top_cell, un for (db::Cell::const_iterator i = cell.begin (); ! i.at_end (); ++i) { - std::map >::const_iterator tc = to_commit.find (i->cell_index ()); + auto tc = to_commit.find (i->cell_index ()); if (tc != to_commit.end ()) { const std::map &vt = tc->second; @@ -450,7 +474,10 @@ VariantsCollectorBase::commit_shapes (db::Layout &layout, db::Cell &top_cell, un for (db::CellInstArray::iterator ia = i->begin (); ! ia.at_end (); ++ia) { db::ICplxTrans t = i->complex_trans (*ia); - db::ICplxTrans rt = mp_red->reduce (vvc.begin ()->first * mp_red->reduce_trans (t)); + db::ICplxTrans rt = mp_red->reduce_trans (t); + if (vvc != m_variants.end ()) { + rt = mp_red->reduce (*vvc->second.begin () * rt); + } std::map::const_iterator v = vt.find (rt); if (v != vt.end ()) { @@ -474,22 +501,49 @@ VariantsCollectorBase::commit_shapes (db::Layout &layout, db::Cell &top_cell, un } } -const std::map & +static std::set make_once () +{ + std::set res; + res.insert (db::ICplxTrans ()); + return res; +} + +static std::set s_once (make_once ()); + +const std::set & VariantsCollectorBase::variants (db::cell_index_type ci) const { - std::map >::const_iterator v = m_variants.find (ci); - static std::map empty_set; + if (m_called.find (ci) == m_called.end ()) { + static std::set empty; + return empty; + } + + auto v = m_variants.find (ci); if (v == m_variants.end ()) { - return empty_set; + return s_once; } else { return v->second; } } +const db::ICplxTrans & +VariantsCollectorBase::single_variant_transformation (db::cell_index_type ci) const +{ + auto v = m_variants.find (ci); + + if (v == m_variants.end ()) { + static db::ICplxTrans tr1; + return tr1; + } else { + tl_assert (v->second.size () == 1); + return *v->second.begin (); + } +} + bool VariantsCollectorBase::has_variants () const { - for (std::map >::const_iterator i = m_variants.begin (); i != m_variants.end (); ++i) { + for (auto i = m_variants.begin (); i != m_variants.end (); ++i) { if (i->second.size () > 1) { return true; } @@ -498,7 +552,7 @@ VariantsCollectorBase::has_variants () const } void -VariantsCollectorBase::add_variant (std::map &variants, const db::CellInstArray &inst, bool tl_invariant) const +VariantsCollectorBase::add_variant (std::set &variants, const db::CellInstArray &inst, bool tl_invariant) const { if (tl_invariant) { add_variant_tl_invariant (variants, inst); @@ -508,35 +562,35 @@ VariantsCollectorBase::add_variant (std::map &variants, } void -VariantsCollectorBase::add_variant_non_tl_invariant (std::map &variants, const db::CellInstArray &inst) const +VariantsCollectorBase::add_variant_non_tl_invariant (std::set &variants, const db::CellInstArray &inst) const { if (inst.is_complex ()) { for (db::CellInstArray::iterator i = inst.begin (); ! i.at_end (); ++i) { - variants [mp_red->reduce_trans (inst.complex_trans (*i))] += 1; + variants.insert (mp_red->reduce_trans (inst.complex_trans (*i))); } } else { for (db::CellInstArray::iterator i = inst.begin (); ! i.at_end (); ++i) { - variants [db::ICplxTrans (mp_red->reduce_trans (*i))] += 1; + variants.insert (db::ICplxTrans (mp_red->reduce_trans (*i))); } } } void -VariantsCollectorBase::add_variant_tl_invariant (std::map &variants, const db::CellInstArray &inst) const +VariantsCollectorBase::add_variant_tl_invariant (std::set &variants, const db::CellInstArray &inst) const { if (inst.is_complex ()) { - variants [mp_red->reduce_trans (inst.complex_trans ())] += inst.size (); + variants.insert (mp_red->reduce_trans (inst.complex_trans ())); } else { - variants [db::ICplxTrans (mp_red->reduce_trans (inst.front ()))] += inst.size (); + variants.insert (db::ICplxTrans (mp_red->reduce_trans (inst.front ()))); } } void -VariantsCollectorBase::product (const std::map &v1, const std::map &v2, std::map &prod) const +VariantsCollectorBase::product (const std::set &v1, const std::set &v2, std::set &prod) const { - for (std::map::const_iterator i = v1.begin (); i != v1.end (); ++i) { - for (std::map::const_iterator j = v2.begin (); j != v2.end (); ++j) { - prod [mp_red->reduce (i->first * j->first)] += i->second * j->second; + for (auto i = v1.begin (); i != v1.end (); ++i) { + for (auto j = v2.begin (); j != v2.end (); ++j) { + prod.insert (mp_red->reduce (*i * *j)); } } } @@ -564,9 +618,9 @@ VariantsCollectorBase::create_var_instances (db::Cell &in_cell, std::vector &inst, const db::ICplxTrans &for_var, const std::map > &var_table) const { - for (std::vector::const_iterator i = inst.begin (); i != inst.end (); ++i) { + for (auto i = inst.begin (); i != inst.end (); ++i) { - std::map >::const_iterator f = var_table.find (i->object ().cell_index ()); + auto f = var_table.find (i->object ().cell_index ()); if (f == var_table.end ()) { in_cell.insert (*i); @@ -626,9 +680,9 @@ VariantsCollectorBase::create_var_instances_non_tl_invariant (db::Cell &in_cell, void VariantsCollectorBase::create_var_instances_tl_invariant (db::Cell &in_cell, std::vector &inst, const db::ICplxTrans &for_var, const std::map > &var_table) const { - for (std::vector::const_iterator i = inst.begin (); i != inst.end (); ++i) { + for (auto i = inst.begin (); i != inst.end (); ++i) { - std::map >::const_iterator f = var_table.find (i->object ().cell_index ()); + auto f = var_table.find (i->object ().cell_index ()); if (f == var_table.end ()) { in_cell.insert (*i); diff --git a/src/db/db/dbCellVariants.h b/src/db/db/dbCellVariants.h index 798771a6f..8375c1c11 100644 --- a/src/db/db/dbCellVariants.h +++ b/src/db/db/dbCellVariants.h @@ -216,7 +216,15 @@ public: * The keys of the map are the variants, the values is the instance count of the variant * (as seen from the top cell). */ - const std::map &variants (db::cell_index_type ci) const; + const std::set &variants (db::cell_index_type ci) const; + + /** + * @brief Gets the transformation for a single variant + * + * This requires the cell not to be a variant (i.e. already separated). + * It returns the corresponding transformation. + */ + const db::ICplxTrans &single_variant_transformation (db::cell_index_type ci) const; /** * @brief Returns true, if variants have been built @@ -229,13 +237,14 @@ public: static void copy_shapes (db::Layout &layout, db::cell_index_type ci_to, db::cell_index_type ci_from); private: - std::map > m_variants; + std::map > m_variants; + std::set m_called; const TransformationReducer *mp_red; - void add_variant (std::map &variants, const db::CellInstArray &inst, bool tl_invariant) const; - void add_variant_non_tl_invariant (std::map &variants, const db::CellInstArray &inst) const; - void add_variant_tl_invariant (std::map &variants, const db::CellInstArray &inst) const; - void product (const std::map &v1, const std::map &v2, std::map &prod) const; + void add_variant (std::set &variants, const db::CellInstArray &inst, bool tl_invariant) const; + void add_variant_non_tl_invariant (std::set &variants, const db::CellInstArray &inst) const; + void add_variant_tl_invariant (std::set &variants, const db::CellInstArray &inst) const; + void product (const std::set &v1, const std::set &v2, std::set &prod) const; void create_var_instances (db::Cell &in_cell, std::vector &inst, const db::ICplxTrans &for_var, const std::map > &var_table, bool tl_invariant) const; void create_var_instances_non_tl_invariant (db::Cell &in_cell, std::vector &inst, const db::ICplxTrans &for_var, const std::map > &var_table) const; void create_var_instances_tl_invariant (db::Cell &in_cell, std::vector &inst, const db::ICplxTrans &for_var, const std::map > &var_table) const; diff --git a/src/db/db/dbCompoundOperation.h b/src/db/db/dbCompoundOperation.h index 953768c18..39c2de489 100644 --- a/src/db/db/dbCompoundOperation.h +++ b/src/db/db/dbCompoundOperation.h @@ -432,7 +432,7 @@ public: virtual bool is_translation_invariant () const; // NOTE: equality does not really matter here as we use it only on leaf reducers - virtual bool equals (const TransformationReducer *other) const { return false; } + virtual bool equals (const TransformationReducer * /*other*/) const { return false; } private: std::vector m_vars; @@ -1161,9 +1161,7 @@ private: // in the presence of variants, handle the object in top level space - const std::map &vv = proc->vars ()->variants (cell->cell_index ()); - tl_assert (vv.size () == 1); - const db::ICplxTrans &tr = vv.begin ()->first; + const db::ICplxTrans &tr = proc->vars ()->single_variant_transformation (cell->cell_index ()); processed (layout, *p, tr, res); } else { @@ -1314,9 +1312,7 @@ private: // in the presence of variants, handle the object in top level space - const std::map &vv = proc->vars ()->variants (cell->cell_index ()); - tl_assert (vv.size () == 1); - const db::ICplxTrans &tr = vv.begin ()->first; + const db::ICplxTrans &tr = proc->vars ()->single_variant_transformation (cell->cell_index ()); processed (layout, tr * *p, res); if (! res.empty ()) { @@ -1383,9 +1379,7 @@ private: // in the presence of variants, handle the object in top level space - const std::map &vv = proc->vars ()->variants (cell->cell_index ()); - tl_assert (vv.size () == 1); - const db::ICplxTrans &tr = vv.begin ()->first; + const db::ICplxTrans &tr = proc->vars ()->single_variant_transformation (cell->cell_index ()); processed (layout, tr * *p, res); if (! res.empty ()) { @@ -1453,9 +1447,7 @@ private: // in the presence of variants, handle the object in top level space - const std::map &vv = proc->vars ()->variants (cell->cell_index ()); - tl_assert (vv.size () == 1); - const db::ICplxTrans &tr = vv.begin ()->first; + const db::ICplxTrans &tr = proc->vars ()->single_variant_transformation (cell->cell_index ()); processed (layout, tr * *p, res); if (! res.empty ()) { @@ -1520,9 +1512,7 @@ private: // in the presence of variants, handle the object in top level space - const std::map &vv = proc->vars ()->variants (cell->cell_index ()); - tl_assert (vv.size () == 1); - const db::ICplxTrans &tr = vv.begin ()->first; + const db::ICplxTrans &tr = proc->vars ()->single_variant_transformation (cell->cell_index ()); mp_proc->process (tr * *p, res); if (! res.empty ()) { @@ -1592,9 +1582,7 @@ private: // in the presence of variants, handle the object in top level space - const std::map &vv = proc->vars ()->variants (cell->cell_index ()); - tl_assert (vv.size () == 1); - const db::ICplxTrans &tr = vv.begin ()->first; + const db::ICplxTrans &tr = proc->vars ()->single_variant_transformation (cell->cell_index ()); processed (layout, *p, tr, res); } else { @@ -1667,9 +1655,7 @@ private: // in the presence of variants, handle the object in top level space - const std::map &vv = proc->vars ()->variants (cell->cell_index ()); - tl_assert (vv.size () == 1); - const db::ICplxTrans &tr = vv.begin ()->first; + const db::ICplxTrans &tr = proc->vars ()->single_variant_transformation (cell->cell_index ()); processed (layout, *p, tr, res); } else { diff --git a/src/db/db/dbDeepEdgePairs.cc b/src/db/db/dbDeepEdgePairs.cc index 0884a3d41..783727fa7 100644 --- a/src/db/db/dbDeepEdgePairs.cc +++ b/src/db/db/dbDeepEdgePairs.cc @@ -410,17 +410,17 @@ DeepEdgePairs::apply_filter (const EdgePairFilterBase &filter) const if (vars.get ()) { - const std::map &vv = vars->variants (c->cell_index ()); - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v) { + const std::set &vv = vars->variants (c->cell_index ()); + for (auto v = vv.begin (); v != vv.end (); ++v) { db::Shapes *st; if (vv.size () == 1) { st = & c->shapes (res->deep_layer ().layer ()); } else { - st = & to_commit [c->cell_index ()] [v->first]; + st = & to_commit [c->cell_index ()] [*v]; } - const db::ICplxTrans &tr = v->first; + const db::ICplxTrans &tr = *v; for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::EdgePairs); ! si.at_end (); ++si) { if (filter.selected (si->edge_pair ().transformed (tr))) { diff --git a/src/db/db/dbDeepEdges.cc b/src/db/db/dbDeepEdges.cc index 6c1438a22..719534e7d 100644 --- a/src/db/db/dbDeepEdges.cc +++ b/src/db/db/dbDeepEdges.cc @@ -256,10 +256,8 @@ static void transform_deep_layer (db::DeepLayer &deep_layer, const Trans &t) for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { - const std::map &v = vars.variants (c->cell_index ()); - tl_assert (v.size () == size_t (1)); - - db::Trans tr (v.begin ()->first.inverted () * t.disp ()); + const db::ICplxTrans &tv = vars.single_variant_transformation (c->cell_index ()); + db::ICplxTrans tr (tv.inverted () * t.disp ()); db::Shapes &shapes = c->shapes (deep_layer.layer ()); db::Shapes new_shapes (layout.manager (), c.operator-> (), layout.is_editable ()); @@ -750,10 +748,10 @@ DeepEdges::length_type DeepEdges::length (const db::Box &box) const for (db::ShapeIterator s = layout.cell (*c).shapes (edges.layer ()).begin (db::ShapeIterator::Edges); ! s.at_end (); ++s) { lc += s->edge ().length (); } - const std::map &vv = vars.variants (*c); - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v) { - double mag = v->first.mag (); - l += v->second * lc * mag; + const std::set &vv = vars.variants (*c); + for (auto v = vv.begin (); v != vv.end (); ++v) { + double mag = v->mag (); + // @@@ l += v->second * lc * mag; } } @@ -836,20 +834,18 @@ DeepEdges::apply_filter (const EdgeFilterBase &filter) const if (vars.get ()) { - const std::map &vv = vars->variants (c->cell_index ()); - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v) { + const std::set &vv = vars->variants (c->cell_index ()); + for (auto v = vv.begin (); v != vv.end (); ++v) { db::Shapes *st; if (vv.size () == 1) { st = & c->shapes (res->deep_layer ().layer ()); } else { - st = & to_commit [c->cell_index ()] [v->first]; + st = & to_commit [c->cell_index ()] [*v]; } - const db::ICplxTrans &tr = v->first; - for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::Edges); ! si.at_end (); ++si) { - if (filter.selected (si->edge ().transformed (tr))) { + if (filter.selected (si->edge ().transformed (*v))) { st->insert (*si); } } @@ -1279,14 +1275,14 @@ RegionDelegate *DeepEdges::extended (coord_type ext_b, coord_type ext_e, coord_t // TODO: iterate only over the called cells? for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { - const std::map &vv = vars.variants (c->cell_index ()); - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v) { + const std::set &vv = vars.variants (c->cell_index ()); + for (auto v = vv.begin (); v != vv.end (); ++v) { db::Shapes *out; if (vv.size () == 1) { out = & c->shapes (res->deep_layer ().layer ()); } else { - out = & to_commit [c->cell_index ()][v->first]; + out = & to_commit [c->cell_index ()][*v]; } const db::connected_clusters &cc = hc.clusters_per_cell (c->cell_index ()); @@ -1295,12 +1291,12 @@ RegionDelegate *DeepEdges::extended (coord_type ext_b, coord_type ext_e, coord_t if (cc.is_root (*cl)) { PolygonRefToShapesGenerator prgen (&layout, out); - polygon_transformation_filter ptrans (&prgen, v->first.inverted ()); + polygon_transformation_filter ptrans (&prgen, v->inverted ()); JoinEdgesCluster jec (&ptrans, ext_b, ext_e, ext_o, ext_i); std::list heap; for (db::recursive_cluster_shape_iterator rcsi (hc, edges.layer (), c->cell_index (), *cl); ! rcsi.at_end (); ++rcsi) { - heap.push_back (rcsi->transformed (v->first * rcsi.trans ())); + heap.push_back (rcsi->transformed (*v * rcsi.trans ())); jec.add (&heap.back (), 0); } @@ -1318,20 +1314,20 @@ RegionDelegate *DeepEdges::extended (coord_type ext_b, coord_type ext_e, coord_t for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { - const std::map &vv = vars.variants (c->cell_index ()); - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v) { + const std::set &vv = vars.variants (c->cell_index ()); + for (auto v = vv.begin (); v != vv.end (); ++v) { db::Shapes *out; if (vv.size () == 1) { out = & c->shapes (res->deep_layer ().layer ()); } else { - out = & to_commit [c->cell_index ()][v->first]; + out = & to_commit [c->cell_index ()][*v]; } PolygonRefToShapesGenerator prgen (&layout, out); for (db::Shapes::shape_iterator si = c->shapes (edges.layer ()).begin (db::ShapeIterator::Edges); ! si.at_end (); ++si) { prgen.set_prop_id (si->prop_id ()); - prgen.put (extended_edge (si->edge ().transformed (v->first), ext_b, ext_e, ext_o, ext_i).transformed (v->first.inverted ())); + prgen.put (extended_edge (si->edge ().transformed (*v), ext_b, ext_e, ext_o, ext_i).transformed (v->inverted ())); } } diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index e21620e0c..ff96a0b42 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -264,10 +264,8 @@ static void transform_deep_layer (db::DeepLayer &deep_layer, const Trans &t) for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { - const std::map &v = vars.variants (c->cell_index ()); - tl_assert (v.size () == size_t (1)); - - db::Trans tr (v.begin ()->first.inverted () * t.disp ()); + const db::ICplxTrans &tv = vars.single_variant_transformation (c->cell_index ()); + db::ICplxTrans tr (tv.inverted () * t.disp ()); db::Shapes &shapes = c->shapes (deep_layer.layer ()); db::Shapes new_shapes (layout.manager (), c.operator-> (), layout.is_editable ()); @@ -1122,10 +1120,10 @@ DeepRegion::area (const db::Box &box) const for (db::ShapeIterator s = layout.cell (*c).shapes (polygons.layer ()).begin (db::ShapeIterator::All); ! s.at_end (); ++s) { ac += s->area (); } - const std::map &vv = vars.variants (*c); - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v) { - double mag = v->first.mag (); - a += v->second * ac * mag * mag; + const std::set &vv = vars.variants (*c); + for (auto v = vv.begin (); v != vv.end (); ++v) { + double mag = v->mag (); + // @@@ a += v->second * ac * mag * mag; } } @@ -1159,10 +1157,10 @@ DeepRegion::perimeter (const db::Box &box) const for (db::ShapeIterator s = layout.cell (*c).shapes (polygons.layer ()).begin (db::ShapeIterator::All); ! s.at_end (); ++s) { pc += s->perimeter (); } - const std::map &vv = vars.variants (*c); - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v) { - double mag = v->first.mag (); - p += v->second * pc * mag; + const std::set &vv = vars.variants (*c); + for (auto v = vv.begin (); v != vv.end (); ++v) { + double mag = v->mag (); + // @@@ p += v->second * pc * mag; } } @@ -1219,14 +1217,14 @@ DeepRegion::grid_check (db::Coord gx, db::Coord gy) const const db::Shapes &shapes = c->shapes (polygons.layer ()); - const std::map &vv = vars.variants (c->cell_index ()); - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v) { + const std::set &vv = vars.variants (c->cell_index ()); + for (auto v = vv.begin (); v != vv.end (); ++v) { db::Shapes *markers; if (vv.size () == 1) { markers = & c->shapes (res->deep_layer ().layer ()); } else { - markers = & to_commit [c->cell_index ()] [v->first]; + markers = & to_commit [c->cell_index ()] [*v]; } for (db::Shapes::shape_iterator si = shapes.begin (db::ShapeIterator::All); ! si.at_end (); ++si) { @@ -1234,7 +1232,7 @@ DeepRegion::grid_check (db::Coord gx, db::Coord gy) const db::Polygon poly; si->polygon (poly); - AsIfFlatRegion::produce_markers_for_grid_check (poly, v->first, gx, gy, *markers); + AsIfFlatRegion::produce_markers_for_grid_check (poly, *v, gx, gy, *markers); } @@ -1311,9 +1309,7 @@ DeepRegion::snapped (db::Coord gx, db::Coord gy) std::unique_ptr res (new db::DeepRegion (polygons.derived ())); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { - const std::map &v = vars.variants (c->cell_index ()); - tl_assert (v.size () == size_t (1)); - const db::ICplxTrans &tr = v.begin ()->first; + const db::ICplxTrans &tr = vars.single_variant_transformation (c->cell_index ()); db::ICplxTrans trinv = tr.inverted (); const db::Shapes &s = c->shapes (polygons.layer ()); @@ -1385,9 +1381,7 @@ DeepRegion::edges (const EdgeFilterBase *filter) const db::ICplxTrans tr; if (vars.get ()) { - const std::map &v = vars->variants (c->cell_index ()); - tl_assert (v.size () == size_t (1)); - tr = v.begin ()->first; + tr = vars->single_variant_transformation (c->cell_index ()); } const db::Shapes &s = c->shapes (polygons.layer ()); @@ -1506,22 +1500,20 @@ DeepRegion::apply_filter (const PolygonFilterBase &filter) const if (vars.get ()) { - const std::map &vv = vars->variants (c->cell_index ()); - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v) { + const std::set &vv = vars->variants (c->cell_index ()); + for (auto v = vv.begin (); v != vv.end (); ++v) { db::Shapes *st; if (vv.size () == 1) { st = & c->shapes (res->deep_layer ().layer ()); } else { - st = & to_commit [c->cell_index ()] [v->first]; + st = & to_commit [c->cell_index ()] [*v]; } - const db::ICplxTrans &tr = v->first; - for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::All); ! si.at_end (); ++si) { db::Polygon poly; si->polygon (poly); - if (filter.selected (poly.transformed (tr))) { + if (filter.selected (poly.transformed (*v))) { st->insert (*si); } } @@ -1663,9 +1655,8 @@ DeepRegion::sized (coord_type d, unsigned int mode) const std::unique_ptr res (new db::DeepRegion (polygons.derived ())); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { - const std::map &v = vars.variants (c->cell_index ()); - tl_assert (v.size () == size_t (1)); - double mag = v.begin ()->first.mag (); + const db::ICplxTrans &tr = vars.single_variant_transformation (c->cell_index ()); + double mag = tr.mag (); db::Coord d_with_mag = db::coord_traits::rounded (d / mag); const db::Shapes &s = c->shapes (polygons.layer ()); @@ -1719,10 +1710,9 @@ DeepRegion::sized (coord_type dx, coord_type dy, unsigned int mode) const std::unique_ptr res (new db::DeepRegion (polygons.derived ())); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { - const std::map &v = vars.variants (c->cell_index ()); - tl_assert (v.size () == size_t (1)); - double mag = v.begin ()->first.mag (); - double angle = v.begin ()->first.angle (); + const db::ICplxTrans &tr = vars.single_variant_transformation (c->cell_index ()); + double mag = tr.mag (); + double angle = tr.angle (); db::Coord dx_with_mag = db::coord_traits::rounded (dx / mag); db::Coord dy_with_mag = db::coord_traits::rounded (dy / mag); @@ -2020,9 +2010,8 @@ DeepRegion::run_single_polygon_check (db::edge_relation_type rel, db::Coord d, c std::unique_ptr res (new db::DeepEdgePairs (polygons.derived ())); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { - const std::map &v = vars.variants (c->cell_index ()); - tl_assert (v.size () == size_t (1)); - double mag = v.begin ()->first.mag (); + const db::ICplxTrans &tr = vars.single_variant_transformation (c->cell_index ()); + double mag = tr.mag (); db::Coord d_with_mag = db::coord_traits::rounded (d / mag); EdgeRelationFilter check (rel, d_with_mag, options.metrics); diff --git a/src/db/db/dbDeepTexts.cc b/src/db/db/dbDeepTexts.cc index 0c1cc30e7..1fcac0e00 100644 --- a/src/db/db/dbDeepTexts.cc +++ b/src/db/db/dbDeepTexts.cc @@ -431,22 +431,20 @@ DeepTexts *DeepTexts::apply_filter (const TextFilterBase &filter) const if (vars.get ()) { - const std::map &vv = vars->variants (c->cell_index ()); - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v) { + const std::set &vv = vars->variants (c->cell_index ()); + for (auto v = vv.begin (); v != vv.end (); ++v) { db::Shapes *st; if (vv.size () == 1) { st = & c->shapes (res->deep_layer ().layer ()); } else { - st = & to_commit [c->cell_index ()] [v->first]; + st = & to_commit [c->cell_index ()] [*v]; } - const db::ICplxTrans &tr = v->first; - for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::Texts); ! si.at_end (); ++si) { db::Text text; si->text (text); - if (filter.selected (text.transformed (tr))) { + if (filter.selected (text.transformed (*v))) { st->insert (*si); } } diff --git a/src/db/db/dbHierProcessor.cc b/src/db/db/dbHierProcessor.cc index 636563fc0..bc3b890be 100644 --- a/src/db/db/dbHierProcessor.cc +++ b/src/db/db/dbHierProcessor.cc @@ -1491,10 +1491,8 @@ LocalProcessorBase::dist_for_cell (db::cell_index_type cell_index, db::Coord dis { if (mp_vars) { - const std::map &v = mp_vars->variants (cell_index); - tl_assert (v.size () == size_t (1)); - - double mag = v.begin ()->first.mag (); + const db::ICplxTrans &tr = mp_vars->single_variant_transformation (cell_index); + double mag = tr.mag (); return db::coord_traits::rounded (dist / mag); } else { diff --git a/src/db/db/dbLayoutUtils.cc b/src/db/db/dbLayoutUtils.cc index c3ec9efc2..266424ab1 100644 --- a/src/db/db/dbLayoutUtils.cc +++ b/src/db/db/dbLayoutUtils.cc @@ -543,9 +543,7 @@ scale_and_snap (db::Layout &layout, db::Cell &cell, db::Coord g, db::Coord m, db continue; } - const std::map &v = vars.variants (c->cell_index ()); - tl_assert (v.size () == size_t (1)); - db::ICplxTrans tr = v.begin ()->first; + db::ICplxTrans tr = vars.single_variant_transformation (c->cell_index ()); // NOTE: tr_disp is already multiplied with mag, so it can be an integer db::Vector tr_disp = tr.disp (); diff --git a/src/db/db/dbShapeCollectionUtils.h b/src/db/db/dbShapeCollectionUtils.h index 817fd8d3f..02092030f 100644 --- a/src/db/db/dbShapeCollectionUtils.h +++ b/src/db/db/dbShapeCollectionUtils.h @@ -198,20 +198,20 @@ shape_collection_processed_impl (const db::DeepLayer &input, const shape_collect if (vars.get ()) { - const std::map &vv = vars->variants (c->cell_index ()); - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v) { + const std::set &vv = vars->variants (c->cell_index ()); + for (auto v = vv.begin (); v != vv.end (); ++v) { db::Shapes *st; if (vv.size () == 1) { st = & c->shapes (res->deep_layer ().layer ()); } else { - st = & to_commit [c->cell_index ()] [v->first]; + st = & to_commit [c->cell_index ()] [*v]; } shape_collection_processor_delivery delivery (&layout, st); shape_collection_processor_delivery > delivery_wp (&layout, st); - const db::ICplxTrans &tr = v->first; + const db::ICplxTrans &tr = *v; db::ICplxTrans trinv = tr.inverted (); for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::All); ! si.at_end (); ++si) { diff --git a/src/db/unit_tests/dbCellVariantsTests.cc b/src/db/unit_tests/dbCellVariantsTests.cc index 22212954a..acddd9b80 100644 --- a/src/db/unit_tests/dbCellVariantsTests.cc +++ b/src/db/unit_tests/dbCellVariantsTests.cc @@ -27,17 +27,14 @@ #include "tlUnitTest.h" #include "tlStream.h" -std::string var2str (const std::map &vars) +std::string var2str (const std::set &vars) { std::string res; - for (std::map::const_iterator i = vars.begin (); i != vars.end (); ++i) { + for (auto i = vars.begin (); i != vars.end (); ++i) { if (! res.empty ()) { res += ";"; } - res += i->first.to_string (); - res += "["; - res += tl::to_string (i->second); - res += "]"; + res += i->to_string (); } return res; } @@ -94,8 +91,8 @@ TEST(1_Trivial) db::OrientationReducer red; db::cell_variants_collector vb (red); vb.collect (ly, a); - EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), ""); EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); @@ -119,8 +116,8 @@ TEST(2_TwoVariants) db::OrientationReducer red; db::cell_variants_collector vb (red); vb.collect (ly, a); - EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "m0 *1 0,0[1];r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "m0 *1 0,0;r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), ""); EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); @@ -148,9 +145,9 @@ TEST(3_TwoLevels) db::OrientationReducer red; db::cell_variants_collector vb (red); vb.collect (ly, a); - EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1];r90 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0[1];r0 *1 0,0[1];m45 *1 0,0[1];r90 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0;r90 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0;r0 *1 0,0;m45 *1 0,0;r90 *1 0,0"); EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B:r90 *1 1,100"); @@ -182,10 +179,10 @@ TEST(4_ThreeLevels) db::OrientationReducer red; db::cell_variants_collector vb (red); vb.collect (ly, a); - EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1];r90 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0[1];r0 *1 0,0[1];m45 *1 0,0[1];r90 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (d.cell_index ())), "r270 *1 0,0[1];m90 *1 0,0[1];r0 *1 0,0[1];m45 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0;r90 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0;r0 *1 0,0;m45 *1 0,0;r90 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (d.cell_index ())), "r270 *1 0,0;m90 *1 0,0;r0 *1 0,0;m45 *1 0,0"); EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B:r90 *1 1,100"); EXPECT_EQ (inst2str (ly, b), "C:r0 *1 2,10;C:m0 *1 2,100"); @@ -220,9 +217,9 @@ TEST(5_ComplexTrans) db::OrientationReducer red; db::cell_variants_collector vb (red); vb.collect (ly, a); - EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1];r90 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0[1];r0 *1 0,0[1];m45 *1 0,0[1];r90 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0;r90 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0;r0 *1 0,0;m45 *1 0,0;r90 *1 0,0"); EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); } @@ -243,9 +240,9 @@ TEST(6_Arrays) db::OrientationReducer red; db::cell_variants_collector vb (red); vb.collect (ly, a); - EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[100];r90 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0[100];r0 *1 0,0[10000];m45 *1 0,0[1];r90 *1 0,0[100]"); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0;r90 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0;r0 *1 0,0;m45 *1 0,0;r90 *1 0,0"); EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); } @@ -265,9 +262,9 @@ TEST(7_ScalingVariants) db::MagnificationReducer red; db::cell_variants_collector vb (red); vb.collect (ly, a); - EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1];r0 *1.5 0,0[100]"); - EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *1 0,0[1];r0 *1.5 0,0[100];r0 *2 0,0[100];r0 *3 0,0[10000]"); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0;r0 *1.5 0,0"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *1 0,0;r0 *1.5 0,0;r0 *2 0,0;r0 *3 0,0"); EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); } @@ -285,8 +282,8 @@ TEST(8_GridVariants) db::GridReducer red (10); db::cell_variants_collector vb (red); vb.collect (ly, a); - EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 1,0[1];r0 *1 3,0[1];r0 *1 1,1[1];r0 *1 3,1[1]"); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 1,0;r0 *1 3,0;r0 *1 1,1;r0 *1 3,1"); // placements are: // b in a: r0 *1 x=1,1+102 y=10,10+101 @@ -297,7 +294,7 @@ TEST(8_GridVariants) // expanded placements mod 10: // c in a: r0 *2 x=1,1+102 y=10,10+101 x r0 *1 x=2,y=3 // = (3,3),(5,3),(3,4),(5,4) - EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *1 -5,3[1];r0 *1 3,3[1];r0 *1 -5,4[1];r0 *1 3,4[1]"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *1 -5,3;r0 *1 3,3;r0 *1 -5,4;r0 *1 3,4"); EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B:r0 *1 1,111;B:r0 *1 103,10;B:r0 *1 103,111"); @@ -332,8 +329,8 @@ TEST(9_ComplexGridVariants) db::GridReducer red (10); db::cell_variants_collector vb (red); vb.collect (ly, a); - EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); - EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *2 1,0[1];r90 *1 1,0[1];r0 *2 3,0[1];r0 *2 1,1[1];r0 *2 3,1[1]"); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *2 1,0;r90 *1 1,0;r0 *2 3,0;r0 *2 1,1;r0 *2 3,1"); // placements are: // b in a: r0 *2 x=1,1+102 y=10,10+101 @@ -364,9 +361,9 @@ TEST(9_ComplexGridVariants) // (1,2),(1,-3),(-2,2),(-2,-3) // r90 *1 x=1,y=100 x m0 *1 x=2,y=100 // (1,2) - EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *4 -5,-4[2];r0 *4 -3,-4[2];r0 *4 -5,-3[2];r0 *4 -3,-3[2];r90 *2 -2,-3[1];" - "r90 *2 1,-3[1];m0 *2 -5,0[1];r0 *4 -5,0[2];m0 *2 -3,0[1];r0 *4 -3,0[2];" - "m0 *2 -5,1[1];r0 *4 -5,1[2];m0 *2 -3,1[1];r0 *4 -3,1[2];r90 *2 -2,2[1];m45 *1 1,2[1];r90 *2 1,2[1]"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *4 -5,-4;r0 *4 -3,-4;r0 *4 -5,-3;r0 *4 -3,-3;r90 *2 -2,-3;" + "r90 *2 1,-3;m0 *2 -5,0;r0 *4 -5,0;m0 *2 -3,0;r0 *4 -3,0;" + "m0 *2 -5,1;r0 *4 -5,1;m0 *2 -3,1;r0 *4 -3,1;r90 *2 -2,2;m45 *1 1,2;r90 *2 1,2"); EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); } @@ -417,14 +414,14 @@ TEST(101_Propagation) for (db::Layout::const_iterator c = ly.begin (); c != ly.end (); ++c) { - const std::map &vv = vb.variants (c->cell_index ()); - for (std::map::const_iterator v = vv.begin (); v != vv.end (); ++v) { + const std::set &vv = vb.variants (c->cell_index ()); + for (auto v = vv.begin (); v != vv.end (); ++v) { - db::Shapes &out = to_commit [c->cell_index ()][v->first]; + db::Shapes &out = to_commit [c->cell_index ()][*v]; for (db::Shapes::shape_iterator s = c->shapes (l1).begin (db::ShapeIterator::All); ! s.at_end (); ++s) { - db::Box b = s->bbox ().transformed (v->first); + db::Box b = s->bbox ().transformed (*v); b.enlarge (db::Vector (-100, 0)); - out.insert (b.transformed (v->first.inverted ())); + out.insert (b.transformed (v->inverted ())); } } From dd81fda27d46de620d6019b28ae3eda1681c3eb0 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 18 Nov 2023 21:42:24 +0100 Subject: [PATCH 11/14] Refactoring with the goal to reduce the overhead for variant computation --- src/db/db/dbCellVariants.cc | 117 ++++++++++ src/db/db/dbCellVariants.h | 79 +++++++ src/db/db/dbDeepEdges.cc | 8 +- src/db/db/dbDeepRegion.cc | 16 +- src/db/unit_tests/dbCellVariantsTests.cc | 263 +++++++++++++++++++++++ 5 files changed, 471 insertions(+), 12 deletions(-) diff --git a/src/db/db/dbCellVariants.cc b/src/db/db/dbCellVariants.cc index b842b2585..ce555dd1a 100644 --- a/src/db/db/dbCellVariants.cc +++ b/src/db/db/dbCellVariants.cc @@ -706,5 +706,122 @@ VariantsCollectorBase::create_var_instances_tl_invariant (db::Cell &in_cell, std } } +// ------------------------------------------------------------------------------------------ + +VariantStatistics::VariantStatistics () + : mp_red () +{ + // .. nothing yet .. +} + +VariantStatistics::VariantStatistics (const TransformationReducer *red) + : mp_red (red) +{ + // .. nothing yet .. +} + +void +VariantStatistics::collect (const db::Layout &layout, const db::Cell &top_cell) +{ + tl_assert (mp_red != 0); + + // The top cell gets a "variant" with unit transformation + m_variants [top_cell.cell_index ()].insert (std::make_pair (db::ICplxTrans (), 1)); + + std::set called; + top_cell.collect_called_cells (called); + + for (db::Layout::top_down_const_iterator c = layout.begin_top_down (); c != layout.end_top_down (); ++c) { + + if (called.find (*c) == called.end ()) { + continue; + } + + // collect the parent variants per parent cell + + std::map > variants_per_parent_cell; + for (db::Cell::parent_inst_iterator pi = layout.cell (*c).begin_parent_insts (); ! pi.at_end (); ++pi) { + std::map &variants = variants_per_parent_cell [pi->inst ().object ().cell_index ()]; + add_variant (variants, pi->child_inst ().cell_inst (), mp_red->is_translation_invariant ()); + } + + // compute the resulting variants + + std::map &new_variants = m_variants [*c]; + + for (std::map >::const_iterator pv = variants_per_parent_cell.begin (); pv != variants_per_parent_cell.end (); ++pv) { + product (variants (pv->first), pv->second, new_variants); + } + + } +} + +const std::map & +VariantStatistics::variants (db::cell_index_type ci) const +{ + std::map >::const_iterator v = m_variants.find (ci); + static std::map empty_set; + if (v == m_variants.end ()) { + return empty_set; + } else { + return v->second; + } +} + +bool +VariantStatistics::has_variants () const +{ + for (std::map >::const_iterator i = m_variants.begin (); i != m_variants.end (); ++i) { + if (i->second.size () > 1) { + return true; + } + } + return false; +} + +void +VariantStatistics::add_variant (std::map &variants, const db::CellInstArray &inst, bool tl_invariant) const +{ + if (tl_invariant) { + add_variant_tl_invariant (variants, inst); + } else { + add_variant_non_tl_invariant (variants, inst); + } +} + +void +VariantStatistics::add_variant_non_tl_invariant (std::map &variants, const db::CellInstArray &inst) const +{ + if (inst.is_complex ()) { + for (db::CellInstArray::iterator i = inst.begin (); ! i.at_end (); ++i) { + variants [mp_red->reduce_trans (inst.complex_trans (*i))] += 1; + } + } else { + for (db::CellInstArray::iterator i = inst.begin (); ! i.at_end (); ++i) { + variants [db::ICplxTrans (mp_red->reduce_trans (*i))] += 1; + } + } +} + +void +VariantStatistics::add_variant_tl_invariant (std::map &variants, const db::CellInstArray &inst) const +{ + if (inst.is_complex ()) { + variants [mp_red->reduce_trans (inst.complex_trans ())] += inst.size (); + } else { + variants [db::ICplxTrans (mp_red->reduce_trans (inst.front ()))] += inst.size (); + } +} + +void +VariantStatistics::product (const std::map &v1, const std::map &v2, std::map &prod) const +{ + for (std::map::const_iterator i = v1.begin (); i != v1.end (); ++i) { + for (std::map::const_iterator j = v2.begin (); j != v2.end (); ++j) { + prod [mp_red->reduce (i->first * j->first)] += i->second * j->second; + } + } +} + } diff --git a/src/db/db/dbCellVariants.h b/src/db/db/dbCellVariants.h index 8375c1c11..f7a938501 100644 --- a/src/db/db/dbCellVariants.h +++ b/src/db/db/dbCellVariants.h @@ -282,6 +282,85 @@ private: RED m_red; }; +/** + * @brief A class computing variants for cells with statistics + * + * This version provides detailed information about the multiplicity of a certain variant. + * It does not offer a way to seperate variants. + */ +class DB_PUBLIC VariantStatistics +{ +public: + /** + * @brief Creates a variant collector without a transformation reducer + */ + VariantStatistics (); + + /** + * @brief Creates a variant collector with the given reducer + */ + VariantStatistics (const TransformationReducer *red); + + /** + * @brief Collects cell variants for the given layout starting from the top cell + */ + void collect (const db::Layout &layout, const db::Cell &top_cell); + /** + * @brief Gets the variants for a given cell + * + * The keys of the map are the variants, the values is the instance count of the variant + * (as seen from the top cell). + */ + const std::map &variants (db::cell_index_type ci) const; + + /** + * @brief Returns true, if variants have been built + */ + bool has_variants () const; + +private: + std::map > m_variants; + const TransformationReducer *mp_red; + + void add_variant (std::map &variants, const db::CellInstArray &inst, bool tl_invariant) const; + void add_variant_non_tl_invariant (std::map &variants, const db::CellInstArray &inst) const; + void add_variant_tl_invariant (std::map &variants, const db::CellInstArray &inst) const; + void product (const std::map &v1, const std::map &v2, std::map &prod) const; +}; + +/** + * @brief A template using a specific transformation reducer + */ +template +class DB_PUBLIC_TEMPLATE cell_variants_statistics + : public VariantStatistics +{ +public: + /** + * @brief Creates a variant statistics without a transformation reducer + */ + cell_variants_statistics () + : VariantStatistics (&m_red) + { + // .. nothing yet .. + } + + /** + * @brief Creates a variant statistics with the given reducer + * + * The statistics object will take ownership over the reducer + */ + cell_variants_statistics (const RED &red) + : VariantStatistics (&m_red), m_red (red) + { + // .. nothing yet .. + } + +private: + RED m_red; +}; + + } // namespace db #endif diff --git a/src/db/db/dbDeepEdges.cc b/src/db/db/dbDeepEdges.cc index 719534e7d..e5c935c68 100644 --- a/src/db/db/dbDeepEdges.cc +++ b/src/db/db/dbDeepEdges.cc @@ -737,7 +737,7 @@ DeepEdges::length_type DeepEdges::length (const db::Box &box) const const db::DeepLayer &edges = merged_deep_layer (); db::MagnificationReducer red; - db::cell_variants_collector vars (red); + db::cell_variants_statistics vars (red); vars.collect (edges.layout (), edges.initial_cell ()); DeepEdges::length_type l = 0; @@ -748,10 +748,10 @@ DeepEdges::length_type DeepEdges::length (const db::Box &box) const for (db::ShapeIterator s = layout.cell (*c).shapes (edges.layer ()).begin (db::ShapeIterator::Edges); ! s.at_end (); ++s) { lc += s->edge ().length (); } - const std::set &vv = vars.variants (*c); + const std::map &vv = vars.variants (*c); for (auto v = vv.begin (); v != vv.end (); ++v) { - double mag = v->mag (); - // @@@ l += v->second * lc * mag; + double mag = v->first.mag (); + l += v->second * lc * mag; } } diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index ff96a0b42..09f7485b3 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -1109,7 +1109,7 @@ DeepRegion::area (const db::Box &box) const const db::DeepLayer &polygons = merged_deep_layer (); - db::cell_variants_collector vars; + db::cell_variants_statistics vars; vars.collect (polygons.layout (), polygons.initial_cell ()); DeepRegion::area_type a = 0; @@ -1120,10 +1120,10 @@ DeepRegion::area (const db::Box &box) const for (db::ShapeIterator s = layout.cell (*c).shapes (polygons.layer ()).begin (db::ShapeIterator::All); ! s.at_end (); ++s) { ac += s->area (); } - const std::set &vv = vars.variants (*c); + const std::map &vv = vars.variants (*c); for (auto v = vv.begin (); v != vv.end (); ++v) { - double mag = v->mag (); - // @@@ a += v->second * ac * mag * mag; + double mag = v->first.mag (); + a += v->second * ac * mag * mag; } } @@ -1146,7 +1146,7 @@ DeepRegion::perimeter (const db::Box &box) const const db::DeepLayer &polygons = merged_deep_layer (); - db::cell_variants_collector vars; + db::cell_variants_statistics vars; vars.collect (polygons.layout (), polygons.initial_cell ()); DeepRegion::perimeter_type p = 0; @@ -1157,10 +1157,10 @@ DeepRegion::perimeter (const db::Box &box) const for (db::ShapeIterator s = layout.cell (*c).shapes (polygons.layer ()).begin (db::ShapeIterator::All); ! s.at_end (); ++s) { pc += s->perimeter (); } - const std::set &vv = vars.variants (*c); + const std::map &vv = vars.variants (*c); for (auto v = vv.begin (); v != vv.end (); ++v) { - double mag = v->mag (); - // @@@ p += v->second * pc * mag; + double mag = v->first.mag (); + p += v->second * pc * mag; } } diff --git a/src/db/unit_tests/dbCellVariantsTests.cc b/src/db/unit_tests/dbCellVariantsTests.cc index acddd9b80..8775743e2 100644 --- a/src/db/unit_tests/dbCellVariantsTests.cc +++ b/src/db/unit_tests/dbCellVariantsTests.cc @@ -39,6 +39,21 @@ std::string var2str (const std::set &vars) return res; } +std::string var2str (const std::map &vars) +{ + std::string res; + for (std::map::const_iterator i = vars.begin (); i != vars.end (); ++i) { + if (! res.empty ()) { + res += ";"; + } + res += i->first.to_string (); + res += "["; + res += tl::to_string (i->second); + res += "]"; + } + return res; +} + std::string vm2str (const db::Layout &ly, const std::map > &vm) { std::string res; @@ -390,6 +405,254 @@ TEST(100_OrientationVariantsWithLayout) db::compare_layouts (_this, ly, tl::testdata () + "/algo/cell_variants_au1.gds"); } +TEST(10_TrivialStatistics) +{ + db::Layout ly; + db::Cell &a = ly.cell (ly.add_cell ("A")); + db::Cell &b = ly.cell (ly.add_cell ("B")); + db::Cell &c = ly.cell (ly.add_cell ("C")); + db::Cell &d = ly.cell (ly.add_cell ("D")); + + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::Trans (0, false, db::Vector (1, 10)))); + + db::OrientationReducer red; + db::cell_variants_statistics vb (red); + vb.collect (ly, a); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), ""); + EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); +} + +TEST(11_TwoVariantsStatistics) +{ + db::Layout ly; + db::Cell &a = ly.cell (ly.add_cell ("A")); + db::Cell &b = ly.cell (ly.add_cell ("B")); + db::Cell &c = ly.cell (ly.add_cell ("C")); + db::Cell &d = ly.cell (ly.add_cell ("D")); + + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::Trans (0, false, db::Vector (1, 10)))); + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::Trans (0, true, db::Vector (1, 100)))); + + db::OrientationReducer red; + db::cell_variants_statistics vb (red); + vb.collect (ly, a); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "m0 *1 0,0[1];r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), ""); + EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); + + EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B:m0 *1 1,100"); +} + +TEST(12_TwoLevelsStatistics) +{ + db::Layout ly; + db::Cell &a = ly.cell (ly.add_cell ("A")); + db::Cell &b = ly.cell (ly.add_cell ("B")); + db::Cell &c = ly.cell (ly.add_cell ("C")); + db::Cell &d = ly.cell (ly.add_cell ("D")); + + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::Trans (0, false, db::Vector (1, 10)))); + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::Trans (1, false, db::Vector (1, 100)))); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::Trans (0, false, db::Vector (2, 10)))); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::Trans (0, true, db::Vector (2, 100)))); + + db::OrientationReducer red; + db::cell_variants_statistics vb (red); + vb.collect (ly, a); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1];r90 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0[1];r0 *1 0,0[1];m45 *1 0,0[1];r90 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); + + EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B:r90 *1 1,100"); + EXPECT_EQ (inst2str (ly, b), "C:r0 *1 2,10;C:m0 *1 2,100"); +} + +TEST(13_ThreeLevelsStatistics) +{ + db::Layout ly; + db::Cell &a = ly.cell (ly.add_cell ("A")); + db::Cell &b = ly.cell (ly.add_cell ("B")); + db::Cell &c = ly.cell (ly.add_cell ("C")); + db::Cell &d = ly.cell (ly.add_cell ("D")); + + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::Trans (0, false, db::Vector (1, 10)))); + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::Trans (1, false, db::Vector (1, 100)))); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::Trans (0, false, db::Vector (2, 10)))); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::Trans (0, true, db::Vector (2, 100)))); + c.insert (db::CellInstArray (db::CellInst (d.cell_index ()), db::Trans (1, true, db::Vector (0, 0)))); + + db::OrientationReducer red; + db::cell_variants_statistics vb (red); + vb.collect (ly, a); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1];r90 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0[1];r0 *1 0,0[1];m45 *1 0,0[1];r90 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (d.cell_index ())), "r270 *1 0,0[1];m90 *1 0,0[1];r0 *1 0,0[1];m45 *1 0,0[1]"); + + EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B:r90 *1 1,100"); + EXPECT_EQ (inst2str (ly, b), "C:r0 *1 2,10;C:m0 *1 2,100"); + EXPECT_EQ (inst2str (ly, c), "D:m45 *1 0,0"); +} + +TEST(14_ComplexTransStatistics) +{ + db::Layout ly; + db::Cell &a = ly.cell (ly.add_cell ("A")); + db::Cell &b = ly.cell (ly.add_cell ("B")); + db::Cell &c = ly.cell (ly.add_cell ("C")); + db::Cell &d = ly.cell (ly.add_cell ("D")); + + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::ICplxTrans (db::Trans (0, false, db::Vector (1, 10))))); + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::ICplxTrans (db::Trans (1, false, db::Vector (1, 100))))); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::ICplxTrans (db::Trans (0, false, db::Vector (2, 10))))); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::ICplxTrans (db::Trans (0, true, db::Vector (2, 100))))); + + db::OrientationReducer red; + db::cell_variants_statistics vb (red); + vb.collect (ly, a); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1];r90 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0[1];r0 *1 0,0[1];m45 *1 0,0[1];r90 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); +} + +TEST(15_ArraysStatistics) +{ + + db::Layout ly; + db::Cell &a = ly.cell (ly.add_cell ("A")); + db::Cell &b = ly.cell (ly.add_cell ("B")); + db::Cell &c = ly.cell (ly.add_cell ("C")); + db::Cell &d = ly.cell (ly.add_cell ("D")); + + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::Trans (0, false, db::Vector (1, 10)), db::Vector (0, 100), db::Vector (100, 0), 10, 10)); + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::Trans (1, false, db::Vector (1, 100)))); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::Trans (0, false, db::Vector (2, 10)), db::Vector (0, 101), db::Vector (101, 0), 10, 10)); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::Trans (0, true, db::Vector (2, 100)))); + + db::OrientationReducer red; + db::cell_variants_statistics vb (red); + vb.collect (ly, a); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[100];r90 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0[100];r0 *1 0,0[10000];m45 *1 0,0[1];r90 *1 0,0[100]"); + EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); +} + +TEST(16_ScalingVariantsStatistics) +{ + db::Layout ly; + db::Cell &a = ly.cell (ly.add_cell ("A")); + db::Cell &b = ly.cell (ly.add_cell ("B")); + db::Cell &c = ly.cell (ly.add_cell ("C")); + db::Cell &d = ly.cell (ly.add_cell ("D")); + + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::ICplxTrans (1.5, 0, false, db::Vector (1, 10)), db::Vector (0, 100), db::Vector (100, 0), 10, 10)); + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::ICplxTrans (1.0, 90.0, false, db::Vector (1, 100)))); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::ICplxTrans (2.0, 0, false, db::Vector (2, 10)), db::Vector (0, 101), db::Vector (101, 0), 10, 10)); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::ICplxTrans (1.0, 0, true, db::Vector (2, 100)))); + + db::MagnificationReducer red; + db::cell_variants_statistics vb (red); + vb.collect (ly, a); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1];r0 *1.5 0,0[100]"); + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *1 0,0[1];r0 *1.5 0,0[100];r0 *2 0,0[100];r0 *3 0,0[10000]"); + EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); +} + +TEST(17_GridVariantsStatistics) +{ + db::Layout ly; + db::Cell &a = ly.cell (ly.add_cell ("A")); + db::Cell &b = ly.cell (ly.add_cell ("B")); + db::Cell &c = ly.cell (ly.add_cell ("C")); + db::Cell &d = ly.cell (ly.add_cell ("D")); + + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::ICplxTrans (1.0, 0, false, db::Vector (1, 10)), db::Vector (0, 101), db::Vector (102, 0), 2, 2)); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::ICplxTrans (1.0, 0, false, db::Vector (2, 3)))); + + db::GridReducer red (10); + db::cell_variants_statistics vb (red); + vb.collect (ly, a); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 1,0[1];r0 *1 3,0[1];r0 *1 1,1[1];r0 *1 3,1[1]"); + + // placements are: + // b in a: r0 *1 x=1,1+102 y=10,10+101 + // c in b: r0 *1 x=2,y=3 + // expanded placements: + // c in a: r0 *2 x=1,1+102 y=10,10+101 x r0 *1 x=2,y=3 + // = (3,13),(105,13),(3,114),(105,114) + // expanded placements mod 10: + // c in a: r0 *2 x=1,1+102 y=10,10+101 x r0 *1 x=2,y=3 + // = (3,3),(5,3),(3,4),(5,4) + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *1 -5,3[1];r0 *1 3,3[1];r0 *1 -5,4[1];r0 *1 3,4[1]"); + EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); + + EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B:r0 *1 1,111;B:r0 *1 103,10;B:r0 *1 103,111"); + EXPECT_EQ (inst2str (ly, b), "C:r0 *1 2,3"); + EXPECT_EQ (inst2str (ly, c), ""); +} + +TEST(18_ComplexGridVariantsStatistics) +{ + db::Layout ly; + db::Cell &a = ly.cell (ly.add_cell ("A")); + db::Cell &b = ly.cell (ly.add_cell ("B")); + db::Cell &c = ly.cell (ly.add_cell ("C")); + db::Cell &d = ly.cell (ly.add_cell ("D")); + + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::ICplxTrans (2.0, 0, false, db::Vector (1, 10)), db::Vector (0, 101), db::Vector (102, 0), 2, 2)); + a.insert (db::CellInstArray (db::CellInst (b.cell_index ()), db::ICplxTrans (1.0, 90.0, false, db::Vector (1, 100)))); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::ICplxTrans (2.0, 0, false, db::Vector (2, 10)), db::Vector (0, 103), db::Vector (105, 0), 2, 2)); + b.insert (db::CellInstArray (db::CellInst (c.cell_index ()), db::ICplxTrans (1.0, 0, true, db::Vector (2, 100)))); + + db::GridReducer red (10); + db::cell_variants_statistics vb (red); + vb.collect (ly, a); + EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); + EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *2 1,0[1];r90 *1 1,0[1];r0 *2 3,0[1];r0 *2 1,1[1];r0 *2 3,1[1]"); + + // placements are: + // b in a: r0 *2 x=1,1+102 y=10,10+101 + // r90 *1 x=1,y=100 + // c in b: r0 *2 x=2,2+105 y=10,10+103 + // m0 *1 x=2,y=100 + // expanded placements: + // c in a: r0 *2 x=1,1+102 y=10,10+101 x r0 *2 x=2,2+105 y=10,10+103 + // = (5,30),(215,30),(5,236),(215,236) + // (107,30),(317,30),(107,236),(317,236) + // (5,131),(215,131),(5,337),(215,337) + // (107,131),(317,131),(107,337),(317,337) + // r0 *2 x=1,1+102 y=10,10+101 x m0 *1 x=2,y=100 + // (5,210),(5,311),(107,210),(107,311) + // r90 *1 x=1,y=100 x r0 *2 x=2,2+105 y=10,10+103 + // (-9,102),(-9,207),(-112,102),(-112,207) + // r90 *1 x=1,y=100 x m0 *1 x=2,y=100 + // (-99,102) + // expanded ((placements + 5) mod 10) - placements + // c in a: r0 *2 x=1,1+102 y=10,10+101 x r0 *2 x=2,2+105 y=10,10+103 + // = (5,0),(5,0),(-5,-4),(-5,-4) + // (7,0),(7,0),(-3,-4),(-3,-4) + // (-5,1),(-5,1),(-5,-3),(-5,-3) + // (-3,1),(-3,1),(-3,-3),(-3,-3) + // r0 *2 x=1,1+102 y=10,10+101 x m0 *1 x=2,y=100 + // (-5,0),(-5,1),(-3,0),(-3,1) + // r90 *1 x=1,y=100 x r0 *2 x=2,2+105 y=10,10+103 + // (1,2),(1,-3),(-2,2),(-2,-3) + // r90 *1 x=1,y=100 x m0 *1 x=2,y=100 + // (1,2) + EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *4 -5,-4[2];r0 *4 -3,-4[2];r0 *4 -5,-3[2];r0 *4 -3,-3[2];r90 *2 -2,-3[1];" + "r90 *2 1,-3[1];m0 *2 -5,0[1];r0 *4 -5,0[2];m0 *2 -3,0[1];r0 *4 -3,0[2];" + "m0 *2 -5,1[1];r0 *4 -5,1[2];m0 *2 -3,1[1];r0 *4 -3,1[2];r90 *2 -2,2[1];m45 *1 1,2[1];r90 *2 1,2[1]"); + EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); +} + TEST(101_Propagation) { db::Layout ly; From c2df163b8afba2ad1960691453cc451b50b89ad9 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 18 Nov 2023 23:27:20 +0100 Subject: [PATCH 12/14] Added cell variants to polygon to edge processor --- src/db/db/dbCellVariants.cc | 1 + src/db/db/dbRegionProcessors.cc | 8 +++++++- src/db/db/dbRegionProcessors.h | 1 + testdata/drc/drcGenericTests_6.drc | 2 +- testdata/drc/drcGenericTests_au6d.gds | Bin 10026 -> 10480 bytes 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/db/db/dbCellVariants.cc b/src/db/db/dbCellVariants.cc index ce555dd1a..419d0fcfc 100644 --- a/src/db/db/dbCellVariants.cc +++ b/src/db/db/dbCellVariants.cc @@ -325,6 +325,7 @@ VariantsCollectorBase::separate_variants (db::Layout &layout, db::Cell &top_cell var_name += "$VAR" + tl::to_string (index); ci_var = layout.add_cell (var_name.c_str ()); + m_called.insert (ci_var); layout.add_meta_info (ci_var, layout.begin_meta (*c), layout.end_meta (*c)); copy_shapes (layout, ci_var, *c); diff --git a/src/db/db/dbRegionProcessors.cc b/src/db/db/dbRegionProcessors.cc index 5931bf3da..529a66a0a 100644 --- a/src/db/db/dbRegionProcessors.cc +++ b/src/db/db/dbRegionProcessors.cc @@ -118,7 +118,13 @@ void RelativeExtentsAsEdges::process (const db::Polygon &poly, std::vector{L4=vr&aujG18Sojxzz0#*re ze#WP;`3G+j%jPIyC&tNlgz7fW5;?#)d6tmV{L4=vr&au+wQIlU(ruscou#BDcu1Gm%SP3(-5jrbiVZ{lm1yotwQauKiH zT)^ct*@&}Y@+TlJ0?Hfl0Oh$3Og7+an*51ZXL6Z Date: Sun, 19 Nov 2023 00:14:46 +0100 Subject: [PATCH 13/14] Some more refactoring --- src/db/db/dbCellVariants.cc | 63 +++++++++++------------- src/db/db/dbCellVariants.h | 10 ++-- src/db/db/dbDeepEdgePairs.cc | 8 +-- src/db/db/dbDeepEdges.cc | 21 ++++---- src/db/db/dbDeepRegion.cc | 58 +++++++++------------- src/db/db/dbDeepShapeStore.cc | 7 --- src/db/db/dbDeepShapeStore.h | 56 --------------------- src/db/db/dbDeepTexts.cc | 8 +-- src/db/db/dbHierProcessor.cc | 7 +-- src/db/db/dbLayout.cc | 9 ---- src/db/db/dbLayout.h | 9 ---- src/db/db/dbLayoutUtils.cc | 4 +- src/db/db/dbShapeCollectionUtils.h | 10 ++-- src/db/unit_tests/dbCellVariantsTests.cc | 55 ++++++++++----------- 14 files changed, 115 insertions(+), 210 deletions(-) diff --git a/src/db/db/dbCellVariants.cc b/src/db/db/dbCellVariants.cc index 419d0fcfc..5a4b1ff83 100644 --- a/src/db/db/dbCellVariants.cc +++ b/src/db/db/dbCellVariants.cc @@ -220,22 +220,23 @@ VariantsCollectorBase::VariantsCollectorBase () } VariantsCollectorBase::VariantsCollectorBase (const TransformationReducer *red) - : mp_red (red) + : mp_red (red), mp_layout (0) { // .. nothing yet .. } void -VariantsCollectorBase::collect (const db::Layout &layout, const db::Cell &top_cell) +VariantsCollectorBase::collect (Layout *layout, db::cell_index_type initial_cell) { tl_assert (mp_red != 0); + mp_layout = layout; m_called.clear (); - m_called.insert (top_cell.cell_index ()); + m_called.insert (initial_cell); - top_cell.collect_called_cells (m_called); + layout->cell (initial_cell).collect_called_cells (m_called); - for (db::Layout::top_down_const_iterator c = layout.begin_top_down (); c != layout.end_top_down (); ++c) { + for (db::Layout::top_down_const_iterator c = layout->begin_top_down (); c != layout->end_top_down (); ++c) { if (m_called.find (*c) == m_called.end ()) { continue; @@ -244,7 +245,7 @@ VariantsCollectorBase::collect (const db::Layout &layout, const db::Cell &top_ce // collect the parent variants per parent cell std::map > variants_per_parent_cell; - for (db::Cell::parent_inst_iterator pi = layout.cell (*c).begin_parent_insts (); ! pi.at_end (); ++pi) { + for (db::Cell::parent_inst_iterator pi = layout->cell (*c).begin_parent_insts (); ! pi.at_end (); ++pi) { std::set &variants = variants_per_parent_cell [pi->inst ().object ().cell_index ()]; add_variant (variants, pi->child_inst ().cell_inst (), mp_red->is_translation_invariant ()); } @@ -275,15 +276,11 @@ VariantsCollectorBase::collect (const db::Layout &layout, const db::Cell &top_ce } void -VariantsCollectorBase::separate_variants (db::Layout &layout, db::Cell &top_cell, std::map > *var_table) +VariantsCollectorBase::separate_variants (std::map > *var_table) { tl_assert (mp_red != 0); - db::LayoutLocker locker (&layout); - - std::set called; - top_cell.collect_called_cells (called); - called.insert (top_cell.cell_index ()); + db::LayoutLocker locker (mp_layout); // create new cells for the variants @@ -292,13 +289,13 @@ VariantsCollectorBase::separate_variants (db::Layout &layout, db::Cell &top_cell var_table = &var_table_intern; } - for (db::Layout::bottom_up_const_iterator c = layout.begin_bottom_up (); c != layout.end_bottom_up (); ++c) { + for (db::Layout::bottom_up_const_iterator c = mp_layout->begin_bottom_up (); c != mp_layout->end_bottom_up (); ++c) { - if (called.find (*c) == called.end ()) { + if (m_called.find (*c) == m_called.end ()) { continue; } - db::Cell &cell = layout.cell (*c); + db::Cell &cell = mp_layout->cell (*c); auto vc = m_variants.find (*c); if (vc != m_variants.end () && vc->second.size () > 1) { @@ -321,13 +318,13 @@ VariantsCollectorBase::separate_variants (db::Layout &layout, db::Cell &top_cell if (v != vc->second.begin ()) { - std::string var_name = layout.cell_name (*c); + std::string var_name = mp_layout->cell_name (*c); var_name += "$VAR" + tl::to_string (index); - ci_var = layout.add_cell (var_name.c_str ()); + ci_var = mp_layout->add_cell (var_name.c_str ()); m_called.insert (ci_var); - layout.add_meta_info (ci_var, layout.begin_meta (*c), layout.end_meta (*c)); - copy_shapes (layout, ci_var, *c); + mp_layout->add_meta_info (ci_var, mp_layout->begin_meta (*c), mp_layout->end_meta (*c)); + copy_shapes (*mp_layout, ci_var, *c); // a new entry for the variant if (! v->is_unity ()) { @@ -339,7 +336,7 @@ VariantsCollectorBase::separate_variants (db::Layout &layout, db::Cell &top_cell } vt.insert (std::make_pair (*v, ci_var)); - create_var_instances (layout.cell (ci_var), inst, *v, *var_table, mp_red->is_translation_invariant ()); + create_var_instances (mp_layout->cell (ci_var), inst, *v, *var_table, mp_red->is_translation_invariant ()); } @@ -384,10 +381,12 @@ VariantsCollectorBase::separate_variants (db::Layout &layout, db::Cell &top_cell } } + + mp_layout->variants_created_event (var_table); } void -VariantsCollectorBase::commit_shapes (db::Layout &layout, db::Cell &top_cell, unsigned int layer, std::map > &to_commit) +VariantsCollectorBase::commit_shapes (unsigned int layer, std::map > &to_commit) { tl_assert (mp_red != 0); @@ -398,19 +397,15 @@ VariantsCollectorBase::commit_shapes (db::Layout &layout, db::Cell &top_cell, un // NOTE: this implementation suffers from accumulation of propagated shapes: we add more levels of propagated // shapes if required. We don't clean up, because we do not know when a shape collection stops being required. - db::LayoutLocker locker (&layout); + db::LayoutLocker locker (mp_layout); - std::set called; - top_cell.collect_called_cells (called); - called.insert (top_cell.cell_index ()); + for (db::Layout::bottom_up_const_iterator c = mp_layout->begin_bottom_up (); c != mp_layout->end_bottom_up (); ++c) { - for (db::Layout::bottom_up_const_iterator c = layout.begin_bottom_up (); c != layout.end_bottom_up (); ++c) { - - if (called.find (*c) == called.end ()) { + if (m_called.find (*c) == m_called.end ()) { continue; } - db::Cell &cell = layout.cell (*c); + db::Cell &cell = mp_layout->cell (*c); auto vvc = m_variants.find (*c); if (vvc != m_variants.end () && vvc->second.size () > 1) { @@ -722,17 +717,17 @@ VariantStatistics::VariantStatistics (const TransformationReducer *red) } void -VariantStatistics::collect (const db::Layout &layout, const db::Cell &top_cell) +VariantStatistics::collect (const db::Layout *layout, db::cell_index_type initial_cell) { tl_assert (mp_red != 0); // The top cell gets a "variant" with unit transformation - m_variants [top_cell.cell_index ()].insert (std::make_pair (db::ICplxTrans (), 1)); + m_variants [initial_cell].insert (std::make_pair (db::ICplxTrans (), 1)); std::set called; - top_cell.collect_called_cells (called); + layout->cell (initial_cell).collect_called_cells (called); - for (db::Layout::top_down_const_iterator c = layout.begin_top_down (); c != layout.end_top_down (); ++c) { + for (db::Layout::top_down_const_iterator c = layout->begin_top_down (); c != layout->end_top_down (); ++c) { if (called.find (*c) == called.end ()) { continue; @@ -741,7 +736,7 @@ VariantStatistics::collect (const db::Layout &layout, const db::Cell &top_cell) // collect the parent variants per parent cell std::map > variants_per_parent_cell; - for (db::Cell::parent_inst_iterator pi = layout.cell (*c).begin_parent_insts (); ! pi.at_end (); ++pi) { + for (db::Cell::parent_inst_iterator pi = layout->cell (*c).begin_parent_insts (); ! pi.at_end (); ++pi) { std::map &variants = variants_per_parent_cell [pi->inst ().object ().cell_index ()]; add_variant (variants, pi->child_inst ().cell_inst (), mp_red->is_translation_invariant ()); } diff --git a/src/db/db/dbCellVariants.h b/src/db/db/dbCellVariants.h index f7a938501..a1a871c1d 100644 --- a/src/db/db/dbCellVariants.h +++ b/src/db/db/dbCellVariants.h @@ -188,7 +188,7 @@ public: /** * @brief Collects cell variants for the given layout starting from the top cell */ - void collect (const db::Layout &layout, const db::Cell &top_cell); + void collect (Layout *layout, cell_index_type initial_cell); /** * @brief Creates cell variants for singularization of the different variants @@ -199,7 +199,7 @@ public: * If given, *var_table will be filled with a map giving the new cell and variant against * the old cell for all cells with more than one variant. */ - void separate_variants (db::Layout &layout, db::Cell &top_cell, std::map > *var_table = 0); + void separate_variants (std::map > *var_table = 0); /** * @brief Commits the shapes for different variants to the current cell hierarchy @@ -208,7 +208,7 @@ public: * "to_commit" initially is a set of shapes to commit for the given cell and variant. * This map is modified during the algorithm and should be discarded later. */ - void commit_shapes (db::Layout &layout, db::Cell &top_cell, unsigned int layer, std::map > &to_commit); + void commit_shapes (unsigned int layer, std::map > &to_commit); /** * @brief Gets the variants for a given cell @@ -240,6 +240,7 @@ private: std::map > m_variants; std::set m_called; const TransformationReducer *mp_red; + db::Layout *mp_layout; void add_variant (std::set &variants, const db::CellInstArray &inst, bool tl_invariant) const; void add_variant_non_tl_invariant (std::set &variants, const db::CellInstArray &inst) const; @@ -304,7 +305,8 @@ public: /** * @brief Collects cell variants for the given layout starting from the top cell */ - void collect (const db::Layout &layout, const db::Cell &top_cell); + void collect (const db::Layout *layout, db::cell_index_type initial_cell); + /** * @brief Gets the variants for a given cell * diff --git a/src/db/db/dbDeepEdgePairs.cc b/src/db/db/dbDeepEdgePairs.cc index 783727fa7..62f3ff6ca 100644 --- a/src/db/db/dbDeepEdgePairs.cc +++ b/src/db/db/dbDeepEdgePairs.cc @@ -386,21 +386,21 @@ DeepEdgePairs * DeepEdgePairs::apply_filter (const EdgePairFilterBase &filter) const { const db::DeepLayer &edge_pairs = deep_layer (); + db::Layout &layout = const_cast (edge_pairs.layout ()); std::unique_ptr vars; if (filter.vars ()) { vars.reset (new db::VariantsCollectorBase (filter.vars ())); - vars->collect (edge_pairs.layout (), edge_pairs.initial_cell ()); + vars->collect (&layout, edge_pairs.initial_cell ().cell_index ()); if (filter.wants_variants ()) { - const_cast (edge_pairs).separate_variants (*vars); + vars->separate_variants (); } } - db::Layout &layout = const_cast (edge_pairs.layout ()); std::map > to_commit; std::unique_ptr res (new db::DeepEdgePairs (edge_pairs.derived ())); @@ -445,7 +445,7 @@ DeepEdgePairs::apply_filter (const EdgePairFilterBase &filter) const } if (! to_commit.empty () && vars.get ()) { - res->deep_layer ().commit_shapes (*vars, to_commit); + vars->commit_shapes (res->deep_layer ().layer (), to_commit); } return res.release (); diff --git a/src/db/db/dbDeepEdges.cc b/src/db/db/dbDeepEdges.cc index e5c935c68..12b9a1774 100644 --- a/src/db/db/dbDeepEdges.cc +++ b/src/db/db/dbDeepEdges.cc @@ -244,15 +244,16 @@ static void transform_deep_layer (db::DeepLayer &deep_layer, const Trans &t) // Plain move + db::Layout &layout = deep_layer.layout (); + // build cell variants for different orientations db::OrientationReducer same_orientation; db::VariantsCollectorBase vars (&same_orientation); - vars.collect (deep_layer.layout (), deep_layer.initial_cell ()); - deep_layer.separate_variants (vars); + vars.collect (&layout, deep_layer.initial_cell ().cell_index ()); + vars.separate_variants (); // process the variants - db::Layout &layout = deep_layer.layout (); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { @@ -738,7 +739,7 @@ DeepEdges::length_type DeepEdges::length (const db::Box &box) const db::MagnificationReducer red; db::cell_variants_statistics vars (red); - vars.collect (edges.layout (), edges.initial_cell ()); + vars.collect (&edges.layout (), edges.initial_cell ().cell_index ()); DeepEdges::length_type l = 0; @@ -810,21 +811,21 @@ DeepEdges * DeepEdges::apply_filter (const EdgeFilterBase &filter) const { const db::DeepLayer &edges = filter.requires_raw_input () ? deep_layer () : merged_deep_layer (); + db::Layout &layout = const_cast (edges.layout ()); std::unique_ptr vars; if (filter.vars ()) { vars.reset (new db::VariantsCollectorBase (filter.vars ())); - vars->collect (edges.layout (), edges.initial_cell ()); + vars->collect (&layout, edges.initial_cell ().cell_index ()); if (filter.wants_variants ()) { - const_cast (edges).separate_variants (*vars); + vars->separate_variants (); } } - db::Layout &layout = const_cast (edges.layout ()); std::map > to_commit; std::unique_ptr res (new db::DeepEdges (edges.derived ())); @@ -867,7 +868,7 @@ DeepEdges::apply_filter (const EdgeFilterBase &filter) const } if (! to_commit.empty () && vars.get ()) { - res->deep_layer ().commit_shapes (*vars, to_commit); + vars->commit_shapes (res->deep_layer ().layer (), to_commit); } if (! filter.requires_raw_input ()) { @@ -1258,7 +1259,7 @@ RegionDelegate *DeepEdges::extended (coord_type ext_b, coord_type ext_e, coord_t // dots formally don't have an orientation, hence the interpretation is x and y. db::MagnificationReducer red; db::cell_variants_collector vars (red); - vars.collect (edges.layout (), edges.initial_cell ()); + vars.collect (&layout, edges.initial_cell ().cell_index ()); std::map > to_commit; @@ -1337,7 +1338,7 @@ RegionDelegate *DeepEdges::extended (coord_type ext_b, coord_type ext_e, coord_t } // propagate results from variants - vars.commit_shapes (layout, top_cell, res->deep_layer ().layer (), to_commit); + vars.commit_shapes (res->deep_layer ().layer (), to_commit); return res.release (); } diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index 09f7485b3..b6e04023a 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -256,8 +256,8 @@ static void transform_deep_layer (db::DeepLayer &deep_layer, const Trans &t) db::MagnificationAndOrientationReducer same_orientation; db::VariantsCollectorBase vars (&same_orientation); - vars.collect (deep_layer.layout (), deep_layer.initial_cell ()); - deep_layer.separate_variants (vars); + vars.collect (&deep_layer.layout (), deep_layer.initial_cell ().cell_index ()); + vars.separate_variants (); // process the variants db::Layout &layout = deep_layer.layout (); @@ -1110,7 +1110,7 @@ DeepRegion::area (const db::Box &box) const const db::DeepLayer &polygons = merged_deep_layer (); db::cell_variants_statistics vars; - vars.collect (polygons.layout (), polygons.initial_cell ()); + vars.collect (&polygons.layout (), polygons.initial_cell ().cell_index ()); DeepRegion::area_type a = 0; @@ -1147,7 +1147,7 @@ DeepRegion::perimeter (const db::Box &box) const const db::DeepLayer &polygons = merged_deep_layer (); db::cell_variants_statistics vars; - vars.collect (polygons.layout (), polygons.initial_cell ()); + vars.collect (&polygons.layout (), polygons.initial_cell ().cell_index ()); DeepRegion::perimeter_type p = 0; @@ -1208,7 +1208,7 @@ DeepRegion::grid_check (db::Coord gx, db::Coord gy) const db::Layout &layout = const_cast (polygons.layout ()); db::cell_variants_collector vars (gx); - vars.collect (layout, polygons.initial_cell ()); + vars.collect (&layout, polygons.initial_cell ().cell_index ()); std::map > to_commit; std::unique_ptr res (new db::DeepEdgePairs (polygons.derived ())); @@ -1241,7 +1241,7 @@ DeepRegion::grid_check (db::Coord gx, db::Coord gy) const } // propagate the markers with a similar algorithm used for producing the variants - res->deep_layer ().commit_shapes (vars, to_commit); + vars.commit_shapes (res->deep_layer ().layer (), to_commit); return res.release (); } @@ -1295,15 +1295,13 @@ DeepRegion::snapped (db::Coord gx, db::Coord gy) } const db::DeepLayer &polygons = merged_deep_layer (); + db::Layout &layout = const_cast (polygons.layout ()); db::cell_variants_collector vars (gx); - vars.collect (polygons.layout (), polygons.initial_cell ()); + vars.collect (&layout, polygons.initial_cell ().cell_index ()); + vars.separate_variants (); - // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? - const_cast (polygons).separate_variants (vars); - - db::Layout &layout = const_cast (polygons.layout ()); std::vector heap; std::unique_ptr res (new db::DeepRegion (polygons.derived ())); @@ -1363,20 +1361,17 @@ DeepRegion::edges (const EdgeFilterBase *filter) const db::PropertyMapper pm (res->properties_repository (), &polygons.layout ().properties_repository ()); std::unique_ptr vars; + db::Layout &layout = const_cast (polygons.layout ()); if (filter && filter->vars ()) { vars.reset (new db::VariantsCollectorBase (filter->vars ())); - vars->collect (polygons.layout (), polygons.initial_cell ()); - - // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? - const_cast (polygons).separate_variants (*vars); + vars->collect (&layout, polygons.initial_cell ().cell_index ()); + vars->separate_variants (); } - db::Layout &layout = const_cast (polygons.layout ()); - for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { db::ICplxTrans tr; @@ -1476,21 +1471,21 @@ DeepRegion * DeepRegion::apply_filter (const PolygonFilterBase &filter) const { const db::DeepLayer &polygons = filter.requires_raw_input () ? deep_layer () : merged_deep_layer (); + db::Layout &layout = const_cast (polygons.layout ()); std::unique_ptr vars; if (filter.vars ()) { vars.reset (new db::VariantsCollectorBase (filter.vars ())); - vars->collect (polygons.layout (), polygons.initial_cell ()); + vars->collect (&layout, polygons.initial_cell ().cell_index ()); if (filter.wants_variants ()) { - const_cast (polygons).separate_variants (*vars); + vars->separate_variants (); } } - db::Layout &layout = const_cast (polygons.layout ()); std::map > to_commit; std::unique_ptr res (new db::DeepRegion (polygons.derived ())); @@ -1537,7 +1532,7 @@ DeepRegion::apply_filter (const PolygonFilterBase &filter) const } if (! to_commit.empty () && vars.get ()) { - res->deep_layer ().commit_shapes (*vars, to_commit); + vars->commit_shapes (res->deep_layer ().layer (), to_commit); } if (! filter.requires_raw_input ()) { @@ -1647,10 +1642,8 @@ DeepRegion::sized (coord_type d, unsigned int mode) const db::Layout &layout = const_cast (polygons.layout ()); db::cell_variants_collector vars; - vars.collect (polygons.layout (), polygons.initial_cell ()); - - // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? - const_cast (polygons).separate_variants (vars); + vars.collect (&layout, polygons.initial_cell ().cell_index ()); + vars.separate_variants (); std::unique_ptr res (new db::DeepRegion (polygons.derived ())); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { @@ -1702,10 +1695,8 @@ DeepRegion::sized (coord_type dx, coord_type dy, unsigned int mode) const db::Layout &layout = const_cast (polygons.layout ()); db::cell_variants_collector vars; - vars.collect (polygons.layout (), polygons.initial_cell ()); - - // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? - const_cast (polygons).separate_variants (vars); + vars.collect (&layout, polygons.initial_cell ().cell_index ()); + vars.separate_variants (); std::unique_ptr res (new db::DeepRegion (polygons.derived ())); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { @@ -1998,14 +1989,11 @@ DeepRegion::run_single_polygon_check (db::edge_relation_type rel, db::Coord d, c } const db::DeepLayer &polygons = merged_deep_layer (); + db::Layout &layout = const_cast (polygons.layout ()); db::cell_variants_collector vars; - vars.collect (polygons.layout (), polygons.initial_cell ()); - - // NOTE: m_merged_polygons is mutable, so why is the const_cast needed? - const_cast (polygons).separate_variants (vars); - - db::Layout &layout = const_cast (polygons.layout ()); + vars.collect (&layout, polygons.initial_cell ().cell_index ()); + vars.separate_variants (); std::unique_ptr res (new db::DeepEdgePairs (polygons.derived ())); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { diff --git a/src/db/db/dbDeepShapeStore.cc b/src/db/db/dbDeepShapeStore.cc index 620c5f2fa..81ff9c327 100644 --- a/src/db/db/dbDeepShapeStore.cc +++ b/src/db/db/dbDeepShapeStore.cc @@ -1283,13 +1283,6 @@ namespace }; } -void -DeepShapeStore::separate_variants (unsigned int layout_index, db::VariantsCollectorBase &coll) -{ - tl_assert (is_valid_layout_index (layout_index)); - layout (layout_index).separate_variants (coll, initial_cell (layout_index).cell_index ()); -} - void DeepShapeStore::insert (const DeepLayer &deep_layer, db::Layout *into_layout, db::cell_index_type into_cell, unsigned int into_layer) { diff --git a/src/db/db/dbDeepShapeStore.h b/src/db/db/dbDeepShapeStore.h index c53cc37d6..1e6e0aaaa 100644 --- a/src/db/db/dbDeepShapeStore.h +++ b/src/db/db/dbDeepShapeStore.h @@ -193,25 +193,6 @@ public: */ void add_from (const DeepLayer &dl); - /** - * @brief Separates cell variants (see DeepShapeStore::separate_variants) - */ - template - void separate_variants (VarCollector &collector); - - /** - * @brief Commits shapes for variants to the existing cell hierarchy - * - * The "to_propagate" collection is a set of shapes per cell and variant. The - * algorithm will put these shapes into the existing hierarchy putting the - * shapes into the proper parent cells to resolve variants. - * - * This map will be modified by the algorithm and should be discarded - * later. - */ - template - void commit_shapes (VarCollector &collector, std::map > &to_propagate); - /** * @brief Gets the shape store object * This is a pure const version to prevent manipulation of the store. @@ -556,29 +537,6 @@ public: */ const db::CellMapping &internal_cell_mapping (unsigned int from_layout_index, unsigned int into_layout_index); - /** - * @brief Create cell variants from the given variant collector - * - * To use this method, first create a variant collector (db::cell_variant_collector) with the required - * reducer and collect the variants. Then call this method on the desired layout index to create the variants. - */ - void separate_variants (unsigned int layout_index, db::VariantsCollectorBase &coll); - - /** - * @brief Commits shapes for variants to the existing cell hierarchy - * - * To use this method, first create a variant collector (db::cell_variant_collector) with the required - * reducer and collect the variants. Then call this method on the desired layout index to commit the shapes for the - * respective variants. - */ - template - void commit_shapes (unsigned int layout_index, VarCollector &coll, unsigned int layer, std::map > &to_commit) - { - tl_assert (is_valid_layout_index (layout_index)); - - coll.commit_shapes (layout (layout_index), initial_cell (layout_index), layer, to_commit); - } - /** * @brief For testing */ @@ -916,20 +874,6 @@ private: std::map, CellMappingWithGenerationIds> m_internal_mapping_cache; }; -template -void DeepLayer::separate_variants (VarCollector &collector) -{ - check_dss (); - mp_store->separate_variants (m_layout, collector); -} - -template -void DeepLayer::commit_shapes (VarCollector &collector, std::map > &to_commit) -{ - check_dss (); - mp_store->commit_shapes (m_layout, collector, layer (), to_commit); -} - } #endif diff --git a/src/db/db/dbDeepTexts.cc b/src/db/db/dbDeepTexts.cc index 1fcac0e00..6845964f4 100644 --- a/src/db/db/dbDeepTexts.cc +++ b/src/db/db/dbDeepTexts.cc @@ -407,21 +407,21 @@ TextsDelegate *DeepTexts::filtered (const TextFilterBase &filter) const DeepTexts *DeepTexts::apply_filter (const TextFilterBase &filter) const { const db::DeepLayer &texts = deep_layer (); + db::Layout &layout = const_cast (texts.layout ()); std::unique_ptr vars; if (filter.vars ()) { vars.reset (new db::VariantsCollectorBase (filter.vars ())); - vars->collect (texts.layout (), texts.initial_cell ()); + vars->collect (&layout, texts.initial_cell ().cell_index ()); if (filter.wants_variants ()) { - const_cast (texts).separate_variants (*vars); + vars->separate_variants (); } } - db::Layout &layout = const_cast (texts.layout ()); std::map > to_commit; std::unique_ptr res (new db::DeepTexts (texts.derived ())); @@ -468,7 +468,7 @@ DeepTexts *DeepTexts::apply_filter (const TextFilterBase &filter) const } if (! to_commit.empty () && vars.get ()) { - res->deep_layer ().commit_shapes (*vars, to_commit); + vars->commit_shapes (res->deep_layer ().layer (), to_commit); } return res.release (); diff --git a/src/db/db/dbHierProcessor.cc b/src/db/db/dbHierProcessor.cc index bc3b890be..bf6cea016 100644 --- a/src/db/db/dbHierProcessor.cc +++ b/src/db/db/dbHierProcessor.cc @@ -1591,12 +1591,13 @@ void local_processor::run (local_operation *op, unsigned db::VariantsCollectorBase *coll = new db::VariantsCollectorBase (op_vars); set_vars_owned (coll); - coll->collect (*mp_subject_layout, *mp_subject_top); - mp_subject_layout->separate_variants (*coll, mp_subject_top->cell_index ()); + coll->collect (mp_subject_layout, mp_subject_top->cell_index ()); + coll->separate_variants (); if (mp_intruder_layout != mp_subject_layout) { db::VariantsCollectorBase vci (op_vars); - vci.collect (*mp_intruder_layout, *mp_intruder_top); + // NOTE: we don't plan to use separate_variants, so the const cast is in order + vci.collect (const_cast (mp_intruder_layout), mp_intruder_top->cell_index ()); if (vci.has_variants ()) { // intruder layout needs to be the same one in that case - we do not want the secondary layout to be modified throw tl::Exception (tl::to_string (tr ("Can't modify second layout for cell variant formation - this case is not supported as of now"))); diff --git a/src/db/db/dbLayout.cc b/src/db/db/dbLayout.cc index 5ae8af700..ab60ae787 100644 --- a/src/db/db/dbLayout.cc +++ b/src/db/db/dbLayout.cc @@ -1812,15 +1812,6 @@ Layout::do_update () delete pr; } -void -Layout::separate_variants (db::VariantsCollectorBase &coll, cell_index_type initial_cell) -{ - std::map > var_table; - coll.separate_variants (*this, cell (initial_cell), &var_table); - - variants_created_event (&var_table); -} - static Layout::meta_info_map s_empty_meta; Layout::meta_info_iterator diff --git a/src/db/db/dbLayout.h b/src/db/db/dbLayout.h index 1ba18bdbd..d85c5976f 100644 --- a/src/db/db/dbLayout.h +++ b/src/db/db/dbLayout.h @@ -1658,15 +1658,6 @@ public: */ void update () const; - /** - * @brief Separates cell variants as given by the cell variant collector - * - * The cell variant collector must have been setup with the desired variants - * using "collect". The new cell variants will be created and a "variants_created" - * event is issued. - */ - void separate_variants (db::VariantsCollectorBase &coll, cell_index_type initial_cell); - /** * @brief Forces an update even if the layout is under construction * diff --git a/src/db/db/dbLayoutUtils.cc b/src/db/db/dbLayoutUtils.cc index 266424ab1..ef45cc2fb 100644 --- a/src/db/db/dbLayoutUtils.cc +++ b/src/db/db/dbLayoutUtils.cc @@ -521,8 +521,8 @@ scale_and_snap (db::Layout &layout, db::Cell &cell, db::Coord g, db::Coord m, db { tl::SelfTimer timer1 (tl::verbosity () >= 41, tl::to_string (tr ("scale_and_snap: variant formation"))); - vars.collect (layout, cell); - vars.separate_variants (layout, cell); + vars.collect (&layout, cell.cell_index ()); + vars.separate_variants (); } std::set called_cells; diff --git a/src/db/db/dbShapeCollectionUtils.h b/src/db/db/dbShapeCollectionUtils.h index 02092030f..954efc628 100644 --- a/src/db/db/dbShapeCollectionUtils.h +++ b/src/db/db/dbShapeCollectionUtils.h @@ -169,21 +169,21 @@ DB_PUBLIC_TEMPLATE OutputContainer * shape_collection_processed_impl (const db::DeepLayer &input, const shape_collection_processor &filter) { + db::Layout &layout = const_cast (input.layout ()); + std::unique_ptr vars; if (filter.vars ()) { vars.reset (new db::VariantsCollectorBase (filter.vars ())); - vars->collect (input.layout (), input.initial_cell ()); + vars->collect (&layout, input.initial_cell ().cell_index ()); if (filter.wants_variants ()) { - const_cast (input).separate_variants (*vars); + vars->separate_variants (); } } - db::Layout &layout = const_cast (input.layout ()); - std::vector heap; std::map > to_commit; @@ -256,7 +256,7 @@ shape_collection_processed_impl (const db::DeepLayer &input, const shape_collect } if (! to_commit.empty () && vars.get ()) { - res->deep_layer ().commit_shapes (*vars, to_commit); + vars->commit_shapes (res->deep_layer ().layer (), to_commit); } if (filter.result_is_merged ()) { diff --git a/src/db/unit_tests/dbCellVariantsTests.cc b/src/db/unit_tests/dbCellVariantsTests.cc index 8775743e2..a508f2a25 100644 --- a/src/db/unit_tests/dbCellVariantsTests.cc +++ b/src/db/unit_tests/dbCellVariantsTests.cc @@ -105,14 +105,14 @@ TEST(1_Trivial) db::OrientationReducer red; db::cell_variants_collector vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), ""); EXPECT_EQ (var2str (vb.variants (d.cell_index ())), ""); std::map > vm; - vb.separate_variants (ly, a, &vm); + vb.separate_variants (&vm); EXPECT_EQ (vm.empty (), true); EXPECT_EQ (vm2str (ly, vm), ""); } @@ -130,7 +130,7 @@ TEST(2_TwoVariants) db::OrientationReducer red; db::cell_variants_collector vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "m0 *1 0,0;r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), ""); @@ -139,7 +139,7 @@ TEST(2_TwoVariants) EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B:m0 *1 1,100"); std::map > vm; - vb.separate_variants (ly, a, &vm); + vb.separate_variants (&vm); EXPECT_EQ (vm2str (ly, vm), "B:B[m0 *1 0,0],B$VAR1[r0 *1 0,0]"); EXPECT_EQ (inst2str (ly, a), "B$VAR1:r0 *1 1,10;B:m0 *1 1,100"); } @@ -159,7 +159,7 @@ TEST(3_TwoLevels) db::OrientationReducer red; db::cell_variants_collector vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0;r90 *1 0,0"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0;r0 *1 0,0;m45 *1 0,0;r90 *1 0,0"); @@ -169,7 +169,7 @@ TEST(3_TwoLevels) EXPECT_EQ (inst2str (ly, b), "C:r0 *1 2,10;C:m0 *1 2,100"); std::map > vm; - vb.separate_variants (ly, a, &vm); + vb.separate_variants (&vm); EXPECT_EQ (vm2str (ly, vm), "B:B[r0 *1 0,0],B$VAR1[r90 *1 0,0];C:C[m0 *1 0,0],C$VAR1[r0 *1 0,0],C$VAR2[m45 *1 0,0],C$VAR3[r90 *1 0,0]"); EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B$VAR1:r90 *1 1,100"); @@ -193,7 +193,7 @@ TEST(4_ThreeLevels) db::OrientationReducer red; db::cell_variants_collector vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0;r90 *1 0,0"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0;r0 *1 0,0;m45 *1 0,0;r90 *1 0,0"); @@ -204,7 +204,7 @@ TEST(4_ThreeLevels) EXPECT_EQ (inst2str (ly, c), "D:m45 *1 0,0"); std::map > vm; - vb.separate_variants (ly, a, &vm); + vb.separate_variants (&vm); EXPECT_EQ (vm2str (ly, vm), "B:B[r0 *1 0,0],B$VAR1[r90 *1 0,0];C:C[m0 *1 0,0],C$VAR1[r0 *1 0,0],C$VAR2[m45 *1 0,0],C$VAR3[r90 *1 0,0];D:D[r270 *1 0,0],D$VAR1[m90 *1 0,0],D$VAR2[r0 *1 0,0],D$VAR3[m45 *1 0,0]"); EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B$VAR1:r90 *1 1,100"); @@ -231,7 +231,7 @@ TEST(5_ComplexTrans) db::OrientationReducer red; db::cell_variants_collector vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0;r90 *1 0,0"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0;r0 *1 0,0;m45 *1 0,0;r90 *1 0,0"); @@ -240,7 +240,6 @@ TEST(5_ComplexTrans) TEST(6_Arrays) { - db::Layout ly; db::Cell &a = ly.cell (ly.add_cell ("A")); db::Cell &b = ly.cell (ly.add_cell ("B")); @@ -254,7 +253,7 @@ TEST(6_Arrays) db::OrientationReducer red; db::cell_variants_collector vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0;r90 *1 0,0"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0;r0 *1 0,0;m45 *1 0,0;r90 *1 0,0"); @@ -276,7 +275,7 @@ TEST(7_ScalingVariants) db::MagnificationReducer red; db::cell_variants_collector vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0;r0 *1.5 0,0"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *1 0,0;r0 *1.5 0,0;r0 *2 0,0;r0 *3 0,0"); @@ -296,7 +295,7 @@ TEST(8_GridVariants) db::GridReducer red (10); db::cell_variants_collector vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 1,0;r0 *1 3,0;r0 *1 1,1;r0 *1 3,1"); @@ -317,7 +316,7 @@ TEST(8_GridVariants) EXPECT_EQ (inst2str (ly, c), ""); std::map > vm; - vb.separate_variants (ly, a, &vm); + vb.separate_variants (&vm); EXPECT_EQ (vm2str (ly, vm), "B:B[r0 *1 1,0],B$VAR1[r0 *1 3,0],B$VAR2[r0 *1 1,1],B$VAR3[r0 *1 3,1];C:C[r0 *1 -5,3],C$VAR1[r0 *1 3,3],C$VAR2[r0 *1 -5,4],C$VAR3[r0 *1 3,4]"); EXPECT_EQ (inst2str (ly, a), "B:r0 *1 1,10;B$VAR2:r0 *1 1,111;B$VAR1:r0 *1 103,10;B$VAR3:r0 *1 103,111"); @@ -343,7 +342,7 @@ TEST(9_ComplexGridVariants) db::GridReducer red (10); db::cell_variants_collector vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *2 1,0;r90 *1 1,0;r0 *2 3,0;r0 *2 1,1;r0 *2 3,1"); @@ -398,8 +397,8 @@ TEST(100_OrientationVariantsWithLayout) db::OrientationReducer red; db::cell_variants_collector vb (red); - vb.collect (ly, top_cell); - vb.separate_variants (ly, top_cell); + vb.collect (&ly, top_cell.cell_index ()); + vb.separate_variants (); CHECKPOINT(); db::compare_layouts (_this, ly, tl::testdata () + "/algo/cell_variants_au1.gds"); @@ -417,7 +416,7 @@ TEST(10_TrivialStatistics) db::OrientationReducer red; db::cell_variants_statistics vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), ""); @@ -437,7 +436,7 @@ TEST(11_TwoVariantsStatistics) db::OrientationReducer red; db::cell_variants_statistics vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "m0 *1 0,0[1];r0 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), ""); @@ -461,7 +460,7 @@ TEST(12_TwoLevelsStatistics) db::OrientationReducer red; db::cell_variants_statistics vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1];r90 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0[1];r0 *1 0,0[1];m45 *1 0,0[1];r90 *1 0,0[1]"); @@ -487,7 +486,7 @@ TEST(13_ThreeLevelsStatistics) db::OrientationReducer red; db::cell_variants_statistics vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1];r90 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0[1];r0 *1 0,0[1];m45 *1 0,0[1];r90 *1 0,0[1]"); @@ -513,7 +512,7 @@ TEST(14_ComplexTransStatistics) db::OrientationReducer red; db::cell_variants_statistics vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1];r90 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0[1];r0 *1 0,0[1];m45 *1 0,0[1];r90 *1 0,0[1]"); @@ -536,7 +535,7 @@ TEST(15_ArraysStatistics) db::OrientationReducer red; db::cell_variants_statistics vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[100];r90 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "m0 *1 0,0[100];r0 *1 0,0[10000];m45 *1 0,0[1];r90 *1 0,0[100]"); @@ -558,7 +557,7 @@ TEST(16_ScalingVariantsStatistics) db::MagnificationReducer red; db::cell_variants_statistics vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 0,0[1];r0 *1.5 0,0[100]"); EXPECT_EQ (var2str (vb.variants (c.cell_index ())), "r0 *1 0,0[1];r0 *1.5 0,0[100];r0 *2 0,0[100];r0 *3 0,0[10000]"); @@ -578,7 +577,7 @@ TEST(17_GridVariantsStatistics) db::GridReducer red (10); db::cell_variants_statistics vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *1 1,0[1];r0 *1 3,0[1];r0 *1 1,1[1];r0 *1 3,1[1]"); @@ -614,7 +613,7 @@ TEST(18_ComplexGridVariantsStatistics) db::GridReducer red (10); db::cell_variants_statistics vb (red); - vb.collect (ly, a); + vb.collect (&ly, a.cell_index ()); EXPECT_EQ (var2str (vb.variants (a.cell_index ())), "r0 *1 0,0[1]"); EXPECT_EQ (var2str (vb.variants (b.cell_index ())), "r0 *2 1,0[1];r90 *1 1,0[1];r0 *2 3,0[1];r0 *2 1,1[1];r0 *2 3,1[1]"); @@ -673,7 +672,7 @@ TEST(101_Propagation) unsigned int l2 = ly.insert_layer (db::LayerProperties (2, 0)); db::cell_variants_collector vb; - vb.collect (ly, top_cell); + vb.collect (&ly, top_cell.cell_index ()); for (db::Layout::const_iterator c = ly.begin (); c != ly.end (); ++c) { @@ -691,7 +690,7 @@ TEST(101_Propagation) } - vb.commit_shapes (ly, top_cell, l2, to_commit); + vb.commit_shapes (l2, to_commit); CHECKPOINT(); db::compare_layouts (_this, ly, tl::testdata () + "/algo/cell_variants_au2.gds"); From f659b9fc4ef200a53c7e5c9041b05d5f5e25bc81 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 19 Nov 2023 00:22:45 +0100 Subject: [PATCH 14/14] Updating golden data --- testdata/algo/deep_region_au21.gds | Bin 10478 -> 10478 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/testdata/algo/deep_region_au21.gds b/testdata/algo/deep_region_au21.gds index 127919c7a269494efab9b0258a341a1558d9f9dd..44396f32ef7123caa1a4412c7e1023f25491de5e 100644 GIT binary patch delta 319 zcmaDC_%1MtfsKKQDS|{L4=vr&au{AM;5Pn?pI)7apK>|?iOlE+~P z0|y(MlZqk3{L4=vr&au