diff --git a/src/plugins/tools/netx/db_plugin/dbHierProcessor.cc b/src/plugins/tools/netx/db_plugin/dbHierProcessor.cc index 1e040b3b1..0d5ba4cea 100644 --- a/src/plugins/tools/netx/db_plugin/dbHierProcessor.cc +++ b/src/plugins/tools/netx/db_plugin/dbHierProcessor.cc @@ -538,12 +538,18 @@ void LocalProcessor::compute_contexts (db::LocalProcessorCellContext *parent_con InteractionRegistrationInst2Inst rec (mp_layout, m_subject_layer, mp_layout, m_intruder_layer, &interactions); for (db::Cell::const_iterator i = cell->begin (); !i.at_end (); ++i) { - scanner.insert1 (&i->cell_inst (), 0); - scanner.insert2 (&i->cell_inst (), 0); + if (! inst_bcs (i->cell_inst ()).empty ()) { + scanner.insert1 (&i->cell_inst (), 0); + } + if (! inst_bci (i->cell_inst ()).empty ()) { + scanner.insert2 (&i->cell_inst (), 0); + } } for (std::set::const_iterator i = intruders.first.begin (); i != intruders.first.end (); ++i) { - scanner.insert2 (i.operator-> (), 0); + if (! inst_bci (*i).empty ()) { + scanner.insert2 (i.operator-> (), 0); + } } scanner.process (rec, 0, inst_bcs, inst_bci); @@ -554,7 +560,9 @@ void LocalProcessor::compute_contexts (db::LocalProcessorCellContext *parent_con InteractionRegistrationInst2Shape rec (mp_layout, m_subject_layer, &interactions); for (db::Cell::const_iterator i = cell->begin (); !i.at_end (); ++i) { - scanner.insert1 (&i->cell_inst (), 0); + if (! inst_bcs (i->cell_inst ()).empty ()) { + scanner.insert1 (&i->cell_inst (), 0); + } } for (std::set::const_iterator i = intruders.second.begin (); i != intruders.second.end (); ++i) { @@ -676,10 +684,14 @@ LocalProcessor::compute_local_cell (db::Cell *cell, const std::pairbegin (); !i.at_end (); ++i) { - scanner.insert2 (&i->cell_inst (), 0); + if (! inst_bci (i->cell_inst ()).empty ()) { + scanner.insert2 (&i->cell_inst (), 0); + } } for (std::set::const_iterator i = intruders.first.begin (); i != intruders.first.end (); ++i) { - scanner.insert2 (i.operator-> (), 0); + if (! inst_bci (*i).empty ()) { + scanner.insert2 (i.operator-> (), 0); + } } scanner.process (rec, 0, db::box_convert (), inst_bci); diff --git a/src/plugins/tools/netx/db_plugin/dbNetExtractor.cc b/src/plugins/tools/netx/db_plugin/dbNetExtractor.cc index fe0521e23..ea5357edf 100644 --- a/src/plugins/tools/netx/db_plugin/dbNetExtractor.cc +++ b/src/plugins/tools/netx/db_plugin/dbNetExtractor.cc @@ -22,6 +22,7 @@ #include "dbNetExtractor.h" +#include "dbHierProcessor.h" #include "dbLayoutUtils.h" #include "dbCellMapping.h" #include "dbPolygonTools.h" @@ -34,7 +35,7 @@ namespace db { NetExtractor::NetExtractor() - : mp_orig_layout (0), mp_layout (0) + : mp_orig_layout (0), mp_layout (0), mp_top_cell (0) { // @@@ @@ -45,21 +46,30 @@ NetExtractor::~NetExtractor () { delete mp_layout; mp_layout = 0; + mp_top_cell = 0; } void NetExtractor::open (const db::Layout &orig_layout, cell_index_type orig_top_cell) { + tl::SelfTimer timer (tl::verbosity () >= 31, tl::to_string (tr ("Open layout"))); + delete mp_layout; mp_orig_layout = &orig_layout; mp_layout = new db::Layout (); mp_layout->dbu (orig_layout.dbu ()); - db::cell_index_type top = mp_layout->add_cell (orig_layout.cell_name (orig_top_cell)); + mp_top_cell = &mp_layout->cell (mp_layout->add_cell (orig_layout.cell_name (orig_top_cell))); // copy hierarchy m_cm.clear (); - m_cm.create_from_names_full (*mp_layout, top, orig_layout, orig_top_cell); + m_cm.create_from_names_full (*mp_layout, mp_top_cell->cell_index (), orig_layout, orig_top_cell); +} + +void +NetExtractor::output (NetLayer a, const LayerProperties &lp) +{ + mp_layout->set_properties (a.layer_index (), lp); } static double area_ratio (const db::Polygon &poly) @@ -92,6 +102,8 @@ static void split_polygon_into (const db::Polygon &poly, db::Shapes &dest, size_ NetLayer NetExtractor::load (unsigned int layer_index) { + tl::SelfTimer timer (tl::verbosity () >= 31, tl::to_string (tr ("Loading layer ")) + mp_orig_layout->get_properties (layer_index).to_string ()); + const double max_area_ratio = 3.0; const size_t max_points = 16; @@ -126,13 +138,25 @@ NetExtractor::load (unsigned int layer_index) NetLayer NetExtractor::bool_and (NetLayer a, NetLayer b) { - return NetLayer (mp_layout->insert_layer ()); // @@@ + return and_or_not (a, b, true); } NetLayer NetExtractor::bool_not (NetLayer a, NetLayer b) { - return NetLayer (mp_layout->insert_layer ()); // @@@ + return and_or_not (a, b, false); +} + +NetLayer +NetExtractor::and_or_not (NetLayer a, NetLayer b, bool is_and) +{ + unsigned int lout = mp_layout->insert_layer (); + + db::BoolAndOrNotLocalOperation op (is_and); + db::LocalProcessor proc (mp_layout, mp_top_cell, &op, a.layer_index (), b.layer_index (), lout); + proc.run (); + + return NetLayer (lout); } db::Layout * diff --git a/src/plugins/tools/netx/db_plugin/dbNetExtractor.h b/src/plugins/tools/netx/db_plugin/dbNetExtractor.h index 2f478e93f..d4066a3ae 100644 --- a/src/plugins/tools/netx/db_plugin/dbNetExtractor.h +++ b/src/plugins/tools/netx/db_plugin/dbNetExtractor.h @@ -71,6 +71,7 @@ public: NetLayer load (unsigned int layer_index); NetLayer bool_and (NetLayer a, NetLayer b); NetLayer bool_not (NetLayer a, NetLayer b); + void output (NetLayer a, const db::LayerProperties &lp); db::Layout *layout_copy () const; private: @@ -78,9 +79,12 @@ private: NetExtractor (const db::NetExtractor &); NetExtractor &operator= (const db::NetExtractor &); + NetLayer and_or_not (NetLayer a, NetLayer b, bool is_and); + // @@@ const db::Layout *mp_orig_layout; // @@@ should be a smart pointer db::Layout *mp_layout; + db::Cell *mp_top_cell; db::CellMapping m_cm; }; diff --git a/src/plugins/tools/netx/db_plugin/gsiDeclDbNetExtractor.cc b/src/plugins/tools/netx/db_plugin/gsiDeclDbNetExtractor.cc index a3a549902..d6ee3c1df 100644 --- a/src/plugins/tools/netx/db_plugin/gsiDeclDbNetExtractor.cc +++ b/src/plugins/tools/netx/db_plugin/gsiDeclDbNetExtractor.cc @@ -41,6 +41,16 @@ void open2 (db::NetExtractor *ex, const db::Layout *orig_layout, const db::Cell ex->open (*orig_layout, cell->cell_index ()); } +void output1 (db::NetExtractor *ex, const db::NetLayer &nl, const db::LayerProperties &lp) +{ + ex->output (nl, lp); +} + +void output2 (db::NetExtractor *ex, const db::NetLayer &nl, int layer, int datatype, const std::string &name) +{ + ex->output (nl, db::LayerProperties (layer, datatype, name)); +} + gsi::Class decl_NetNetExtractor ("db", "NetExtractor", gsi::method ("open", &db::NetExtractor::open, gsi::arg ("orig_layout"), gsi::arg ("orig_top_cell_index"), "@@@" @@ -48,6 +58,12 @@ gsi::Class decl_NetNetExtractor ("db", "NetExtractor", gsi::method_ext ("open", &open2, gsi::arg ("orig_layout"), gsi::arg ("orig_top_cell"), "@@@" ) + + gsi::method_ext ("output", &output1, gsi::arg ("net_layer"), gsi::arg ("layer"), + "@@@" + ) + + gsi::method_ext ("output", &output2, gsi::arg ("net_layer"), gsi::arg ("layer"), gsi::arg ("datatype"), gsi::arg ("name", std::string ()), + "@@@" + ) + gsi::method ("load", &db::NetExtractor::load, gsi::arg ("layer_index"), "@@@" ) + diff --git a/src/tl/tl/tlTimer.cc b/src/tl/tl/tlTimer.cc index 1be9d0b81..de04772ee 100644 --- a/src/tl/tl/tlTimer.cc +++ b/src/tl/tl/tlTimer.cc @@ -186,6 +186,12 @@ Timer::take () m_wall_ms = wall_ms; } +void +SelfTimer::start_report () const +{ + tl::info << m_desc << ": " << tl::to_string (tr ("started")); +} + void SelfTimer::report () const { diff --git a/src/tl/tl/tlTimer.h b/src/tl/tl/tlTimer.h index 2799e34af..14d3cbe3b 100644 --- a/src/tl/tl/tlTimer.h +++ b/src/tl/tl/tlTimer.h @@ -118,6 +118,7 @@ public: { m_enabled = true; start (); + start_report (); } /** @@ -131,6 +132,7 @@ public: m_enabled = enabled; if (enabled) { start (); + start_report (); } } @@ -144,6 +146,7 @@ public: private: void report () const; + void start_report () const; std::string m_desc; bool m_enabled;