WIP: some optimization with empty intruder hint.

This commit is contained in:
Matthias Koefferlein 2018-09-23 17:22:08 +02:00
parent 9e09002d43
commit 3c15d8e387
2 changed files with 18 additions and 4 deletions

View File

@ -70,6 +70,12 @@ BoolAndOrNotLocalOperation::BoolAndOrNotLocalOperation (bool is_and)
// .. nothing yet .. // .. nothing yet ..
} }
LocalOperation::on_empty_intruder_mode
BoolAndOrNotLocalOperation::on_empty_intruder_hint () const
{
return m_is_and ? LocalOperation::Drop : LocalOperation::Copy;
}
void void
BoolAndOrNotLocalOperation::compute_local (db::Layout *layout, const std::map<db::PolygonRef, std::vector<db::PolygonRef> > &interactions, std::set<db::PolygonRef> &result) const BoolAndOrNotLocalOperation::compute_local (db::Layout *layout, const std::map<db::PolygonRef, std::vector<db::PolygonRef> > &interactions, std::set<db::PolygonRef> &result) const
{ {
@ -496,7 +502,7 @@ void LocalProcessor::compute_contexts (db::LocalProcessorCellContext *parent_con
std::map<const db::CellInstArray *, interaction_value_type> interactions; std::map<const db::CellInstArray *, interaction_value_type> interactions;
// @@@ TODO: don't do this in AND more for instances without an intruder // insert dummy interactions to handle at least the child cell vs. itself
for (db::Cell::const_iterator i = cell->begin (); !i.at_end (); ++i) { for (db::Cell::const_iterator i = cell->begin (); !i.at_end (); ++i) {
interactions.insert (std::make_pair (&i->cell_inst (), interaction_value_type ())); interactions.insert (std::make_pair (&i->cell_inst (), interaction_value_type ()));
} }
@ -602,9 +608,11 @@ LocalProcessor::compute_local_cell (db::Cell *cell, const std::pair<std::set<Cel
std::map<db::PolygonRef, std::vector<db::PolygonRef> > interactions; std::map<db::PolygonRef, std::vector<db::PolygonRef> > interactions;
db::box_convert <db::CellInstArray, true> inst_bci (*mp_layout, m_intruder_layer); db::box_convert <db::CellInstArray, true> inst_bci (*mp_layout, m_intruder_layer);
// @@@ TODO: don't do this in AND mode (we don't need interactions without an intruder) if (mp_op->on_empty_intruder_hint () != LocalOperation::Drop) {
for (db::Shapes::shape_iterator i = shapes_subject.begin (polygon_ref_flags ()); !i.at_end (); ++i) { // insert dummy interactions to accommodate subject vs. nothing
interactions.insert (std::make_pair (*i->basic_ptr (db::PolygonRef::tag ()), std::vector<db::PolygonRef> ())); for (db::Shapes::shape_iterator i = shapes_subject.begin (polygon_ref_flags ()); !i.at_end (); ++i) {
interactions.insert (std::make_pair (*i->basic_ptr (db::PolygonRef::tag ()), std::vector<db::PolygonRef> ()));
}
} }
if (! shapes_subject.empty () && ! (shapes_intruders.empty () && intruders.second.empty ())) { if (! shapes_subject.empty () && ! (shapes_intruders.empty () && intruders.second.empty ())) {

View File

@ -41,10 +41,15 @@ class LocalProcessorCellContext;
class DB_PLUGIN_PUBLIC LocalOperation class DB_PLUGIN_PUBLIC LocalOperation
{ {
public: public:
enum on_empty_intruder_mode {
Ignore = 0, Copy, Drop
};
LocalOperation () { } LocalOperation () { }
virtual ~LocalOperation () { } virtual ~LocalOperation () { }
virtual void compute_local (db::Layout *layout, const std::map<db::PolygonRef, std::vector<db::PolygonRef> > &interactions, std::set<db::PolygonRef> &result) const = 0; virtual void compute_local (db::Layout *layout, const std::map<db::PolygonRef, std::vector<db::PolygonRef> > &interactions, std::set<db::PolygonRef> &result) const = 0;
virtual on_empty_intruder_mode on_empty_intruder_hint () const = 0;
}; };
class DB_PLUGIN_PUBLIC BoolAndOrNotLocalOperation class DB_PLUGIN_PUBLIC BoolAndOrNotLocalOperation
@ -54,6 +59,7 @@ public:
BoolAndOrNotLocalOperation (bool is_and); BoolAndOrNotLocalOperation (bool is_and);
virtual void compute_local (db::Layout *layout, const std::map<db::PolygonRef, std::vector<db::PolygonRef> > &interactions, std::set<db::PolygonRef> &result) const; virtual void compute_local (db::Layout *layout, const std::map<db::PolygonRef, std::vector<db::PolygonRef> > &interactions, std::set<db::PolygonRef> &result) const;
virtual on_empty_intruder_mode on_empty_intruder_hint () const;
private: private:
bool m_is_and; bool m_is_and;