mirror of https://github.com/KLayout/klayout.git
Fix for layout query performance improvement: needs to check for qualified cell name (with lib), not pure cellname
This commit is contained in:
parent
c75a1bc2eb
commit
e9eed3842b
|
|
@ -561,23 +561,13 @@ public:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (m_pattern.is_const ()) {
|
|
||||||
|
|
||||||
objectives ().set_wants_all_cells (false);
|
|
||||||
|
|
||||||
// include the cell with the name we look for into the objectives
|
|
||||||
std::pair<bool, db::cell_index_type> cell_by_name = layout ()->cell_by_name (m_pattern.pattern ().c_str ());
|
|
||||||
if (cell_by_name.first) {
|
|
||||||
objectives ().request_cell (cell_by_name.second);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
objectives ().set_wants_all_cells (false);
|
objectives ().set_wants_all_cells (false);
|
||||||
|
|
||||||
// include all matching cells into the objectives
|
// include all matching cells into the objectives
|
||||||
for (db::Layout::const_iterator c = layout ()->begin (); c != layout ()->end(); ++c) {
|
for (db::Layout::const_iterator c = layout ()->begin (); c != layout ()->end(); ++c) {
|
||||||
if (m_pattern.match (layout ()->cell_name (c->cell_index()))) {
|
if (m_pattern.match (c->get_qualified_name ())) {
|
||||||
objectives ().request_cell (c->cell_index ());
|
objectives ().request_cell (c->cell_index ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1382,6 +1382,8 @@ TEST(62)
|
||||||
for (std::vector<db::PCellParameterDeclaration>::const_iterator p = pd.begin (); p != pd.end (); ++p) {
|
for (std::vector<db::PCellParameterDeclaration>::const_iterator p = pd.begin (); p != pd.end (); ++p) {
|
||||||
if (p->get_name () == "text") {
|
if (p->get_name () == "text") {
|
||||||
values.push_back (tl::Variant ("T1"));
|
values.push_back (tl::Variant ("T1"));
|
||||||
|
} else if (p->get_name () == "layer") {
|
||||||
|
values.push_back (tl::Variant (db::LayerProperties (1, 0)));
|
||||||
} else {
|
} else {
|
||||||
values.push_back (p->get_default ());
|
values.push_back (p->get_default ());
|
||||||
}
|
}
|
||||||
|
|
@ -1393,6 +1395,8 @@ TEST(62)
|
||||||
for (std::vector<db::PCellParameterDeclaration>::const_iterator p = pd.begin (); p != pd.end (); ++p) {
|
for (std::vector<db::PCellParameterDeclaration>::const_iterator p = pd.begin (); p != pd.end (); ++p) {
|
||||||
if (p->get_name () == "text") {
|
if (p->get_name () == "text") {
|
||||||
values.push_back (tl::Variant ("T2"));
|
values.push_back (tl::Variant ("T2"));
|
||||||
|
} else if (p->get_name () == "layer") {
|
||||||
|
values.push_back (tl::Variant (db::LayerProperties (2, 0)));
|
||||||
} else {
|
} else {
|
||||||
values.push_back (p->get_default ());
|
values.push_back (p->get_default ());
|
||||||
}
|
}
|
||||||
|
|
@ -1436,7 +1440,7 @@ TEST(62)
|
||||||
db::LayoutQuery q ("instances of ...\"Basic.*\"");
|
db::LayoutQuery q ("instances of ...\"Basic.*\"");
|
||||||
db::LayoutQueryIterator iq (q, &g);
|
db::LayoutQueryIterator iq (q, &g);
|
||||||
std::string s = q2s_expr (iq, "inst.cell.display_title");
|
std::string s = q2s_expr (iq, "inst.cell.display_title");
|
||||||
EXPECT_EQ (s, "Basic.TEXT('T2'),Basic.TEXT('T1'),Basic.TEXT('T1')");
|
EXPECT_EQ (s, "Basic.TEXT(l=2/0,'T2'),Basic.TEXT(l=1/0,'T1'),Basic.TEXT(l=1/0,'T1')");
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1769,7 +1769,7 @@ TEST(119_WithAndWithoutContext)
|
||||||
|
|
||||||
const db::Cell &text_cell = gg.cell (tc.second);
|
const db::Cell &text_cell = gg.cell (tc.second);
|
||||||
EXPECT_EQ (text_cell.is_proxy (), true);
|
EXPECT_EQ (text_cell.is_proxy (), true);
|
||||||
EXPECT_EQ (text_cell.get_display_name (), "Basic.TEXT('KLAYOUT RULES')");
|
EXPECT_EQ (text_cell.get_display_name (), "Basic.TEXT(l=1/0,'KLAYOUT RULES')");
|
||||||
|
|
||||||
CHECKPOINT ();
|
CHECKPOINT ();
|
||||||
db::compare_layouts (_this, gg, tl::testsrc () + "/testdata/oasis/dbOASISWriter119_au.gds", db::NoNormalization);
|
db::compare_layouts (_this, gg, tl::testsrc () + "/testdata/oasis/dbOASISWriter119_au.gds", db::NoNormalization);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue