diff --git a/src/db/db/dbDeepEdges.cc b/src/db/db/dbDeepEdges.cc index ea66d4bbe..6363e8ddc 100644 --- a/src/db/db/dbDeepEdges.cc +++ b/src/db/db/dbDeepEdges.cc @@ -379,7 +379,7 @@ DeepEdges::ensure_merged_edges_valid () const db::hier_clusters hc; db::Connectivity conn; conn.connect (m_deep_layer); - // TODO: this uses the wrong verbosity inside ... + hc.set_base_verbosity (base_verbosity() + 10); hc.build (layout, m_deep_layer.initial_cell (), db::ShapeIterator::Edges, conn); // collect the clusters and merge them into big polygons @@ -387,7 +387,7 @@ DeepEdges::ensure_merged_edges_valid () const // hopefully more efficient that collecting everything and will lead to reuse of parts. ClusterMerger cm (m_deep_layer.layer (), hc, report_progress (), progress_desc ()); - cm.set_base_verbosity (base_verbosity ()); + cm.set_base_verbosity (base_verbosity () + 10); // TODO: iterate only over the called cells? for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { @@ -1019,7 +1019,7 @@ RegionDelegate *DeepEdges::extended (coord_type ext_b, coord_type ext_e, coord_t db::hier_clusters hc; db::Connectivity conn (db::Connectivity::EdgesConnectByPoints); conn.connect (m_merged_edges); - // TODO: this uses the wrong verbosity inside ... + hc.set_base_verbosity (base_verbosity () + 10); hc.build (layout, m_merged_edges.initial_cell (), db::ShapeIterator::Edges, conn); // TODO: iterate only over the called cells? diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index e626c5126..ce1b5a6e0 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -412,7 +412,7 @@ DeepRegion::ensure_merged_polygons_valid () const db::hier_clusters hc; db::Connectivity conn; conn.connect (m_deep_layer); - // TODO: this uses the wrong verbosity inside ... + hc.set_base_verbosity (base_verbosity () + 10); hc.build (layout, m_deep_layer.initial_cell (), db::ShapeIterator::Polygons, conn); // collect the clusters and merge them into big polygons @@ -420,7 +420,7 @@ DeepRegion::ensure_merged_polygons_valid () const // hopefully more efficient that collecting everything and will lead to reuse of parts. ClusterMerger cm (m_deep_layer.layer (), layout, hc, min_coherence (), report_progress (), progress_desc ()); - cm.set_base_verbosity (base_verbosity ()); + cm.set_base_verbosity (base_verbosity () + 10); // TODO: iterate only over the called cells? for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { @@ -1197,7 +1197,7 @@ DeepRegion::merged (bool min_coherence, unsigned int min_wc) const db::hier_clusters hc; db::Connectivity conn; conn.connect (m_deep_layer); - // TODO: this uses the wrong verbosity inside ... + hc.set_base_verbosity (base_verbosity () + 10); hc.build (layout, m_deep_layer.initial_cell (), db::ShapeIterator::Polygons, conn); // collect the clusters and merge them into big polygons @@ -1207,7 +1207,7 @@ DeepRegion::merged (bool min_coherence, unsigned int min_wc) const DeepLayer dl_out (m_deep_layer.derived ()); ClusterMerger cm (m_deep_layer.layer (), layout, hc, min_coherence, report_progress (), progress_desc ()); - cm.set_base_verbosity (base_verbosity ()); + cm.set_base_verbosity (base_verbosity () + 10); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { const db::connected_clusters &cc = hc.clusters_per_cell (c->cell_index ()); @@ -1273,7 +1273,7 @@ DeepRegion::sized (coord_type d, unsigned int mode) const namespace { -struct DB_PUBLIC XYAnisotropyAndMagnificationReducer +struct XYAnisotropyAndMagnificationReducer : public db::TransformationReducer { db::ICplxTrans reduce (const db::ICplxTrans &trans) const diff --git a/src/db/db/dbHierNetworkProcessor.cc b/src/db/db/dbHierNetworkProcessor.cc index 40d7c0dd0..de09415c6 100644 --- a/src/db/db/dbHierNetworkProcessor.cc +++ b/src/db/db/dbHierNetworkProcessor.cc @@ -851,9 +851,8 @@ private: template void -local_clusters::build_clusters (const db::Cell &cell, db::ShapeIterator::flags_type shape_flags, const db::Connectivity &conn, const tl::equivalence_clusters *attr_equivalence) +local_clusters::build_clusters (const db::Cell &cell, db::ShapeIterator::flags_type shape_flags, const db::Connectivity &conn, const tl::equivalence_clusters *attr_equivalence, bool report_progress) { - bool report_progress = tl::verbosity () >= 50; static std::string desc = tl::to_string (tr ("Building local clusters")); db::box_scanner > bs (report_progress, desc); @@ -1068,10 +1067,17 @@ private: template hier_clusters::hier_clusters () + : m_base_verbosity (20) { // .. nothing yet .. } +template +void hier_clusters::set_base_verbosity (int bv) +{ + m_base_verbosity = bv; +} + template void hier_clusters::clear () { @@ -1739,7 +1745,7 @@ template void hier_clusters::do_build (cell_clusters_box_converter &cbc, const db::Layout &layout, const db::Cell &cell, db::ShapeIterator::flags_type shape_flags, const db::Connectivity &conn, const tl::equivalence_clusters *attr_equivalence) { - tl::SelfTimer timer (tl::verbosity () >= 21, tl::to_string (tr ("Computing shape clusters"))); + tl::SelfTimer timer (tl::verbosity () > m_base_verbosity, tl::to_string (tr ("Computing shape clusters"))); std::set called; cell.collect_called_cells (called); @@ -1748,7 +1754,7 @@ hier_clusters::do_build (cell_clusters_box_converter &cbc, const db::Layou // first build all local clusters { - tl::SelfTimer timer (tl::verbosity () >= 31, tl::to_string (tr ("Computing local shape clusters"))); + tl::SelfTimer timer (tl::verbosity () > m_base_verbosity + 10, tl::to_string (tr ("Computing local shape clusters"))); tl::RelativeProgress progress (tl::to_string (tr ("Computing local clusters")), called.size (), 1); for (std::set::const_iterator c = called.begin (); c != called.end (); ++c) { @@ -1760,7 +1766,7 @@ hier_clusters::do_build (cell_clusters_box_converter &cbc, const db::Layou // build the hierarchical connections bottom-up and for all cells whose children are computed already { - tl::SelfTimer timer (tl::verbosity () >= 31, tl::to_string (tr ("Computing hierarchical shape clusters"))); + tl::SelfTimer timer (tl::verbosity () > m_base_verbosity + 10, tl::to_string (tr ("Computing hierarchical shape clusters"))); tl::RelativeProgress progress (tl::to_string (tr ("Computing hierarchical clusters")), called.size (), 1); std::set done; @@ -1798,13 +1804,13 @@ void hier_clusters::build_local_cluster (const db::Layout &layout, const db::Cell &cell, db::ShapeIterator::flags_type shape_flags, const db::Connectivity &conn, const tl::equivalence_clusters *attr_equivalence) { std::string msg = tl::to_string (tr ("Computing local clusters for cell: ")) + std::string (layout.cell_name (cell.cell_index ())); - if (tl::verbosity () >= 40) { + if (tl::verbosity () >= m_base_verbosity + 20) { tl::log << msg; } - tl::SelfTimer timer (tl::verbosity () >= 41, msg); + tl::SelfTimer timer (tl::verbosity () > m_base_verbosity + 20, msg); connected_clusters &local = m_per_cell_clusters [cell.cell_index ()]; - local.build_clusters (cell, shape_flags, conn, attr_equivalence); + local.build_clusters (cell, shape_flags, conn, attr_equivalence, tl::verbosity () >= m_base_verbosity + 30); } template @@ -1899,10 +1905,10 @@ void hier_clusters::build_hier_connections (cell_clusters_box_converter &cbc, const db::Layout &layout, const db::Cell &cell, const db::Connectivity &conn) { std::string msg = tl::to_string (tr ("Computing hierarchical clusters for cell: ")) + std::string (layout.cell_name (cell.cell_index ())); - if (tl::verbosity () >= 40) { + if (tl::verbosity () >= m_base_verbosity + 20) { tl::log << msg; } - tl::SelfTimer timer (tl::verbosity () >= 41, msg); + tl::SelfTimer timer (tl::verbosity () > m_base_verbosity + 20, msg); connected_clusters &local = m_per_cell_clusters [cell.cell_index ()]; @@ -1931,9 +1937,9 @@ hier_clusters::build_hier_connections (cell_clusters_box_converter &cbc, c { static std::string desc = tl::to_string (tr ("Instance to instance treatment")); - tl::SelfTimer timer (tl::verbosity () >= 51, desc); + tl::SelfTimer timer (tl::verbosity () > m_base_verbosity + 30, desc); - bool report_progress = tl::verbosity () >= 50; + bool report_progress = tl::verbosity () >= m_base_verbosity + 30; db::box_scanner bs (report_progress, desc); for (std::vector::const_iterator inst = inst_storage.begin (); inst != inst_storage.end (); ++inst) { @@ -1950,9 +1956,9 @@ hier_clusters::build_hier_connections (cell_clusters_box_converter &cbc, c double area_ratio = 10.0; static std::string desc = tl::to_string (tr ("Local to instance treatment")); - tl::SelfTimer timer (tl::verbosity () >= 51, desc); + tl::SelfTimer timer (tl::verbosity () > m_base_verbosity + 30, desc); - bool report_progress = tl::verbosity () >= 50; + bool report_progress = tl::verbosity () >= m_base_verbosity + 30; db::box_scanner2, unsigned int, db::Instance, unsigned int> bs2 (report_progress, desc); for (typename connected_clusters::const_iterator c = local.begin (); c != local.end (); ++c) { @@ -1985,7 +1991,7 @@ hier_clusters::build_hier_connections (cell_clusters_box_converter &cbc, c // finally connect global nets { static std::string desc = tl::to_string (tr ("Global net treatment")); - tl::SelfTimer timer (tl::verbosity () >= 51, desc); + tl::SelfTimer timer (tl::verbosity () > m_base_verbosity + 30, desc); GlobalNetClusterMaker global_net_clusters; diff --git a/src/db/db/dbHierNetworkProcessor.h b/src/db/db/dbHierNetworkProcessor.h index 2bcfb1242..67c90c013 100644 --- a/src/db/db/dbHierNetworkProcessor.h +++ b/src/db/db/dbHierNetworkProcessor.h @@ -492,7 +492,7 @@ public: * cluster joining may happen in this case, because multi-attribute * assignment might create connections too. */ - void build_clusters (const db::Cell &cell, db::ShapeIterator::flags_type shape_flags, const db::Connectivity &conn, const tl::equivalence_clusters *attr_equivalence = 0); + void build_clusters (const db::Cell &cell, db::ShapeIterator::flags_type shape_flags, const db::Connectivity &conn, const tl::equivalence_clusters *attr_equivalence = 0, bool report_progress = false); /** * @brief Creates and inserts a new clusters @@ -767,6 +767,14 @@ public: */ hier_clusters (); + /** + * @brief Sets the base verbosity + * + * The default value is 30. Basic timing will be reported for > base_verbosity, detailed timing + * for > base_verbosity + 10. + */ + void set_base_verbosity (int bv); + /** * @brief Builds a hierarchy of clusters from a cell hierarchy and given connectivity */ @@ -814,6 +822,7 @@ private: void do_build (cell_clusters_box_converter &cbc, const db::Layout &layout, const db::Cell &cell, db::ShapeIterator::flags_type shape_flags, const db::Connectivity &conn, const tl::equivalence_clusters *attr_equivalence = 0); std::map > m_per_cell_clusters; + int m_base_verbosity; }; /**