From 941c0fff90bafdbcf6e202f6ff10d59c7f5d0e72 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 29 Dec 2024 22:48:34 +0100 Subject: [PATCH] Fixing compile issues --- src/db/db/dbCompoundOperation.h | 46 ------------------------ src/db/db/dbEdgeNeighborhood.cc | 15 +++++--- src/db/db/dbEdges.cc | 5 +++ src/db/db/dbHierProcessor.cc | 11 ++++++ src/db/db/dbHierProcessor2.cc | 4 +++ src/db/db/dbLocalOperation.cc | 2 ++ src/db/db/dbLocalOperationUtils.h | 54 ++++++++++++++++++++++++++++ src/db/db/dbObjectWithProperties.h | 10 ++++++ src/db/db/dbPolygonTools.cc | 4 +++ src/db/db/dbRegionCheckUtils.cc | 11 ++++++ src/db/db/dbRegionLocalOperations.cc | 35 +++++++++++++++++- 11 files changed, 146 insertions(+), 51 deletions(-) diff --git a/src/db/db/dbCompoundOperation.h b/src/db/db/dbCompoundOperation.h index 9c3102a8a..c9a1e326e 100644 --- a/src/db/db/dbCompoundOperation.h +++ b/src/db/db/dbCompoundOperation.h @@ -1005,29 +1005,6 @@ private: bool m_owns_filter; bool m_sum_of_set; - /* @@@ - 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 - { - std::vector > one; - one.push_back (std::unordered_set ()); - - child (0)->compute_local (cache, layout, cell, interactions, one, proc); - - if (m_sum_of_set) { - if (mp_filter->selected_set (one.front ())) { - results.front ().insert (one.front ().begin (), one.front ().end ()); - } - } else { - for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { - if (mp_filter->selected (*p)) { - results.front ().insert (*p); - } - } - } - } - @@@ */ - template void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions, db::object_with_properties > &interactions, std::vector > > &results, const db::LocalProcessorBase *proc) const { @@ -1079,29 +1056,6 @@ private: bool m_owns_filter; bool m_sum_of; - /* @@@ - 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 - { - std::vector > one; - one.push_back (std::unordered_set ()); - - child (0)->compute_local (cache, layout, cell, interactions, one, proc); - - if (m_sum_of) { - if (mp_filter->selected (one.front ())) { - results.front ().insert (one.front ().begin (), one.front ().end ()); - } - } else { - for (typename std::unordered_set::const_iterator p = one.front ().begin (); p != one.front ().end (); ++p) { - if (mp_filter->selected (*p)) { - results.front ().insert (*p); - } - } - } - } - @@@ */ - template void implement_compute_local (db::CompoundRegionOperationCache *cache, 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/dbEdgeNeighborhood.cc b/src/db/db/dbEdgeNeighborhood.cc index 7f91ceeb1..15a30d73d 100644 --- a/src/db/db/dbEdgeNeighborhood.cc +++ b/src/db/db/dbEdgeNeighborhood.cc @@ -217,13 +217,20 @@ private: db::SimplePolygon per_edge_clip_box (db::Box (xmin, -m_din - 1, xmax, m_dout + 1)); // compute the merged neighbors + // NOTE: we first separate by layer and properties ID before we merge. Hence + // shapes with different properties IDs are kept separate. + std::map > merged_neighbors; - db::EdgeProcessor ep; + std::map, std::vector > neighbors_by_prop_ids; for (auto n = neighbors.begin (); n != neighbors.end (); ++n) { + for (auto p = n->second.begin (); p != n->second.end (); ++p) { + neighbors_by_prop_ids [std::make_pair (n->first, (*p)->properties_id ())].push_back (*p); + } + } - // @@@ TODO: separate by properties ID and feed individually ... - db::properties_id_type prop_id = 0; + db::EdgeProcessor ep; + for (auto n = neighbors_by_prop_ids.begin (); n != neighbors_by_prop_ids.end (); ++n) { ep.clear (); @@ -238,7 +245,7 @@ private: ep.insert (per_edge_clip_box, size_t (1)); db::BooleanOp and_op (db::BooleanOp::And); - db::PolygonContainerWithProperties pc (merged_neighbors [n->first], prop_id); + db::PolygonContainerWithProperties pc (merged_neighbors [n->first.first], n->first.second); db::PolygonGenerator pg (pc, false); ep.process (pg, and_op); diff --git a/src/db/db/dbEdges.cc b/src/db/db/dbEdges.cc index 7ae53b009..733286bee 100644 --- a/src/db/db/dbEdges.cc +++ b/src/db/db/dbEdges.cc @@ -218,6 +218,11 @@ template DB_PUBLIC void Edges::insert (const db::SimplePolygon &); template DB_PUBLIC void Edges::insert (const db::Polygon &); template DB_PUBLIC void Edges::insert (const db::Path &); template DB_PUBLIC void Edges::insert (const db::Edge &); +template DB_PUBLIC void Edges::insert (const db::BoxWithProperties &); +template DB_PUBLIC void Edges::insert (const db::SimplePolygonWithProperties &); +template DB_PUBLIC void Edges::insert (const db::PolygonWithProperties &); +template DB_PUBLIC void Edges::insert (const db::PathWithProperties &); +template DB_PUBLIC void Edges::insert (const db::EdgeWithProperties &); void Edges::insert (const db::Shape &shape) { diff --git a/src/db/db/dbHierProcessor.cc b/src/db/db/dbHierProcessor.cc index 328fffbdd..0e9c7b43a 100644 --- a/src/db/db/dbHierProcessor.cc +++ b/src/db/db/dbHierProcessor.cc @@ -1812,11 +1812,16 @@ template class DB_PUBLIC shape_interactions; template class DB_PUBLIC shape_interactions; template class DB_PUBLIC shape_interactions; template class DB_PUBLIC shape_interactions; +template class DB_PUBLIC shape_interactions; +template class DB_PUBLIC shape_interactions; template class DB_PUBLIC shape_interactions; template class DB_PUBLIC shape_interactions; +template class DB_PUBLIC shape_interactions; template class DB_PUBLIC shape_interactions; template class DB_PUBLIC shape_interactions; +template class DB_PUBLIC shape_interactions; template class DB_PUBLIC shape_interactions; +template class DB_PUBLIC shape_interactions; template class DB_PUBLIC shape_interactions; template class DB_PUBLIC shape_interactions; template class DB_PUBLIC shape_interactions; @@ -1839,6 +1844,8 @@ template class DB_PUBLIC local_processor_context_computation_task; template class DB_PUBLIC local_processor_context_computation_task; template class DB_PUBLIC local_processor_context_computation_task; +template class DB_PUBLIC local_processor_context_computation_task; +template class DB_PUBLIC local_processor_context_computation_task; template class DB_PUBLIC local_processor_context_computation_task; template class DB_PUBLIC local_processor_context_computation_task; template class DB_PUBLIC local_processor_context_computation_task; @@ -1876,6 +1883,8 @@ template class DB_PUBLIC local_processor_result_computation_task; template class DB_PUBLIC local_processor_result_computation_task; template class DB_PUBLIC local_processor_result_computation_task; +template class DB_PUBLIC local_processor_result_computation_task; +template class DB_PUBLIC local_processor_result_computation_task; template class DB_PUBLIC local_processor_result_computation_task; template class DB_PUBLIC local_processor_result_computation_task; template class DB_PUBLIC local_processor_result_computation_task; @@ -1905,6 +1914,8 @@ template class DB_PUBLIC local_processor; template class DB_PUBLIC local_processor; template class DB_PUBLIC local_processor; +template class DB_PUBLIC local_processor; +template class DB_PUBLIC local_processor; template class DB_PUBLIC local_processor; template class DB_PUBLIC local_processor; template class DB_PUBLIC local_processor; diff --git a/src/db/db/dbHierProcessor2.cc b/src/db/db/dbHierProcessor2.cc index 4861e08b7..a8d515025 100644 --- a/src/db/db/dbHierProcessor2.cc +++ b/src/db/db/dbHierProcessor2.cc @@ -544,6 +544,8 @@ template class DB_PUBLIC local_processor_cell_context; template class DB_PUBLIC local_processor_cell_context; template class DB_PUBLIC local_processor_cell_context; +template class DB_PUBLIC local_processor_cell_context; +template class DB_PUBLIC local_processor_cell_context; template class DB_PUBLIC local_processor_cell_context; template class DB_PUBLIC local_processor_cell_context; template class DB_PUBLIC local_processor_cell_context; @@ -581,6 +583,8 @@ template class DB_PUBLIC local_processor_cell_contexts; template class DB_PUBLIC local_processor_cell_contexts; template class DB_PUBLIC local_processor_cell_contexts; +template class DB_PUBLIC local_processor_cell_contexts; +template class DB_PUBLIC local_processor_cell_contexts; template class DB_PUBLIC local_processor_cell_contexts; template class DB_PUBLIC local_processor_cell_contexts; template class DB_PUBLIC local_processor_cell_contexts; diff --git a/src/db/db/dbLocalOperation.cc b/src/db/db/dbLocalOperation.cc index bec8d0cd1..7aef0b1a0 100644 --- a/src/db/db/dbLocalOperation.cc +++ b/src/db/db/dbLocalOperation.cc @@ -89,6 +89,8 @@ template class DB_PUBLIC local_operation; template class DB_PUBLIC local_operation; template class DB_PUBLIC local_operation; +template class DB_PUBLIC local_operation; +template class DB_PUBLIC local_operation; template class DB_PUBLIC local_operation; template class DB_PUBLIC local_operation; template class DB_PUBLIC local_operation; diff --git a/src/db/db/dbLocalOperationUtils.h b/src/db/db/dbLocalOperationUtils.h index b32f90fc2..1a22b210c 100644 --- a/src/db/db/dbLocalOperationUtils.h +++ b/src/db/db/dbLocalOperationUtils.h @@ -97,6 +97,34 @@ private: std::unordered_set *mp_polyrefs; }; +template <> +class DB_PUBLIC polygon_ref_generator + : public PolygonSink +{ +public: + /** + * @brief Constructor + */ + polygon_ref_generator (db::Layout *layout, std::unordered_set &polyrefs) + : PolygonSink (), mp_layout (layout), mp_polyrefs (&polyrefs) + { + // .. nothing yet .. + } + + /** + * @brief Implementation of the PolygonSink interface + */ + void put (const db::Polygon &polygon) + { + tl::MutexLocker locker (&mp_layout->lock ()); + mp_polyrefs->insert (db::PolygonRefWithProperties (db::PolygonRef (polygon, mp_layout->shape_repository ()), db::properties_id_type (0))); + } + +private: + db::Layout *mp_layout; + std::unordered_set *mp_polyrefs; +}; + template <> class DB_PUBLIC polygon_ref_generator : public PolygonSink @@ -123,6 +151,32 @@ private: std::unordered_set *mp_polygons; }; +template <> +class DB_PUBLIC polygon_ref_generator + : public PolygonSink +{ +public: + /** + * @brief Constructor + */ + polygon_ref_generator (db::Layout *, std::unordered_set &polygons) + : mp_polygons (&polygons) + { + // .. nothing yet .. + } + + /** + * @brief Implementation of the PolygonSink interface + */ + virtual void put (const db::Polygon &polygon) + { + mp_polygons->insert (db::PolygonWithProperties (polygon, db::properties_id_type (0))); + } + +private: + std::unordered_set *mp_polygons; +}; + typedef polygon_ref_generator PolygonRefGenerator; template diff --git a/src/db/db/dbObjectWithProperties.h b/src/db/db/dbObjectWithProperties.h index b463f4215..a2979ae5c 100644 --- a/src/db/db/dbObjectWithProperties.h +++ b/src/db/db/dbObjectWithProperties.h @@ -79,6 +79,16 @@ public: // .. nothing yet .. } + /** + * @brief Create myself from a object + * The properties ID is initialized with zero (= no properties) + */ + object_with_properties (const Obj &obj) + : Obj (obj), m_id (0) + { + // .. nothing yet .. + } + /** * @brief Create myself from a object and an id */ diff --git a/src/db/db/dbPolygonTools.cc b/src/db/db/dbPolygonTools.cc index b7a3fc6ac..4b6383ace 100644 --- a/src/db/db/dbPolygonTools.cc +++ b/src/db/db/dbPolygonTools.cc @@ -657,6 +657,10 @@ template DB_PUBLIC bool suggest_split_polygon<> (const db::Polygon &polygon, siz template DB_PUBLIC bool suggest_split_polygon<> (const db::SimplePolygon &polygon, size_t max_vertex_count, double max_area_ratio); template DB_PUBLIC bool suggest_split_polygon<> (const db::DPolygon &polygon, size_t max_vertex_count, double max_area_ratio); template DB_PUBLIC bool suggest_split_polygon<> (const db::DSimplePolygon &polygon, size_t max_vertex_count, double max_area_ratio); +template DB_PUBLIC bool suggest_split_polygon<> (const db::PolygonWithProperties &polygon, size_t max_vertex_count, double max_area_ratio); +template DB_PUBLIC bool suggest_split_polygon<> (const db::SimplePolygonWithProperties &polygon, size_t max_vertex_count, double max_area_ratio); +template DB_PUBLIC bool suggest_split_polygon<> (const db::DPolygonWithProperties &polygon, size_t max_vertex_count, double max_area_ratio); +template DB_PUBLIC bool suggest_split_polygon<> (const db::DSimplePolygonWithProperties &polygon, size_t max_vertex_count, double max_area_ratio); // ------------------------------------------------------------------------- // Implementation of split_polygon diff --git a/src/db/db/dbRegionCheckUtils.cc b/src/db/db/dbRegionCheckUtils.cc index 9ace8d834..a28b8249a 100644 --- a/src/db/db/dbRegionCheckUtils.cc +++ b/src/db/db/dbRegionCheckUtils.cc @@ -525,6 +525,8 @@ poly2poly_check::process () // explicit instantiations template class poly2poly_check; template class poly2poly_check; +template class poly2poly_check; +template class poly2poly_check; // ------------------------------------------------------------------------------------- // RegionToEdgeInteractionFilterBase implementation @@ -593,6 +595,10 @@ template class region_to_edge_interaction_filter_base; template class region_to_edge_interaction_filter_base; template class region_to_edge_interaction_filter_base; +template class region_to_edge_interaction_filter_base; +template class region_to_edge_interaction_filter_base; +template class region_to_edge_interaction_filter_base; +template class region_to_edge_interaction_filter_base; // ------------------------------------------------------------------------------------- // RegionToTextInteractionFilterBase implementation @@ -652,5 +658,10 @@ template class region_to_text_interaction_filter_base; template class region_to_text_interaction_filter_base; template class region_to_text_interaction_filter_base; +template class region_to_text_interaction_filter_base; +template class region_to_text_interaction_filter_base; +template class region_to_text_interaction_filter_base; +template class region_to_text_interaction_filter_base; +template class region_to_text_interaction_filter_base; } diff --git a/src/db/db/dbRegionLocalOperations.cc b/src/db/db/dbRegionLocalOperations.cc index 2df5793c9..1894dc3ba 100644 --- a/src/db/db/dbRegionLocalOperations.cc +++ b/src/db/db/dbRegionLocalOperations.cc @@ -40,6 +40,11 @@ static inline const db::Polygon *push_polygon_to_heap (db::Layout *, const db::P return &p; } +static inline const db::PolygonWithProperties *push_polygon_to_heap (db::Layout *, const db::PolygonWithProperties &p, std::list &) +{ + return &p; +} + static inline const db::PolygonRef *push_polygon_to_heap (db::Layout *layout, const db::PolygonRef &p, std::list &heap) { db::PolygonRef ref = db::PolygonRef (p, layout->shape_repository ()); @@ -47,6 +52,13 @@ static inline const db::PolygonRef *push_polygon_to_heap (db::Layout *layout, co return &heap.back (); } +static inline const db::PolygonRefWithProperties *push_polygon_to_heap (db::Layout *layout, const db::PolygonRefWithProperties &p, std::list &heap) +{ + db::PolygonRefWithProperties ref = db::PolygonRefWithProperties (db::PolygonRef (p, layout->shape_repository ()), p.properties_id ()); + heap.push_back (ref); + return &heap.back (); +} + template struct result_counting_inserter { @@ -758,6 +770,8 @@ check_local_operation::description () const // explicit instantiations template class DB_PUBLIC check_local_operation; template class DB_PUBLIC check_local_operation; +template class DB_PUBLIC check_local_operation; +template class DB_PUBLIC check_local_operation; // --------------------------------------------------------------------------------------------------------------- @@ -831,6 +845,8 @@ check_local_operation_with_properties::description () const // explicit instantiations template class DB_PUBLIC check_local_operation_with_properties; template class DB_PUBLIC check_local_operation_with_properties; +template class DB_PUBLIC check_local_operation_with_properties; +template class DB_PUBLIC check_local_operation_with_properties; // --------------------------------------------------------------------------------------------------------------- @@ -1032,6 +1048,8 @@ std::string interacting_local_operation::description () const // explicit instantiations template class DB_PUBLIC interacting_local_operation; template class DB_PUBLIC interacting_local_operation; +template class DB_PUBLIC interacting_local_operation; +template class DB_PUBLIC interacting_local_operation; // --------------------------------------------------------------------------------------------------------------- @@ -1107,6 +1125,9 @@ std::string contained_local_operation::description () const template class DB_PUBLIC contained_local_operation; template class DB_PUBLIC contained_local_operation; template class DB_PUBLIC contained_local_operation; +template class DB_PUBLIC contained_local_operation; +template class DB_PUBLIC contained_local_operation; +template class DB_PUBLIC contained_local_operation; // --------------------------------------------------------------------------------------------------------------- @@ -1186,6 +1207,8 @@ std::string pull_local_operation::description () const template class DB_PUBLIC pull_local_operation; template class DB_PUBLIC pull_local_operation; +template class DB_PUBLIC pull_local_operation; +template class DB_PUBLIC pull_local_operation; // --------------------------------------------------------------------------------------------------------------- @@ -1244,7 +1267,7 @@ void interacting_with_edge_local_operation::do_compute_local (db::La } } - merge_scanner.process (cluster_collector, 1, db::box_convert ()); + merge_scanner.process (cluster_collector, 1, db::box_convert ()); for (typename std::unordered_set::const_iterator e = merged_heap.begin (); e != merged_heap.end (); ++e) { scanner.insert2 (e.operator-> (), 0); @@ -1314,6 +1337,8 @@ std::string interacting_with_edge_local_operation::description () co template class DB_PUBLIC interacting_with_edge_local_operation; template class DB_PUBLIC interacting_with_edge_local_operation; +template class DB_PUBLIC interacting_with_edge_local_operation; +template class DB_PUBLIC interacting_with_edge_local_operation; // --------------------------------------------------------------------------------------------------------------- @@ -1375,6 +1400,8 @@ std::string pull_with_edge_local_operation::description () const template class DB_PUBLIC pull_with_edge_local_operation; template class DB_PUBLIC pull_with_edge_local_operation; +template class DB_PUBLIC pull_with_edge_local_operation; +template class DB_PUBLIC pull_with_edge_local_operation; // --------------------------------------------------------------------------------------------------------------- @@ -1442,6 +1469,8 @@ std::string pull_with_text_local_operation::description () const template class DB_PUBLIC pull_with_text_local_operation; template class DB_PUBLIC pull_with_text_local_operation; +template class DB_PUBLIC pull_with_text_local_operation; +template class DB_PUBLIC pull_with_text_local_operation; // --------------------------------------------------------------------------------------------------------------- @@ -1546,6 +1575,8 @@ std::string interacting_with_text_local_operation::description () co // explicit instantiations template class DB_PUBLIC interacting_with_text_local_operation; template class DB_PUBLIC interacting_with_text_local_operation; +template class DB_PUBLIC interacting_with_text_local_operation; +template class DB_PUBLIC interacting_with_text_local_operation; // --------------------------------------------------------------------------------------------- // BoolAndOrNotLocalOperation implementation @@ -1631,6 +1662,8 @@ bool_and_or_not_local_operation::do_compute_local (db::Layout *layou template class DB_PUBLIC bool_and_or_not_local_operation; template class DB_PUBLIC bool_and_or_not_local_operation; +template class DB_PUBLIC bool_and_or_not_local_operation; +template class DB_PUBLIC bool_and_or_not_local_operation; // --------------------------------------------------------------------------------------------- // BoolAndOrNotLocalOperationWithProperties implementation