mirror of https://github.com/KLayout/klayout.git
Ghost cells are not renamed in blend mode 'rename'
This commit is contained in:
parent
73afd07f51
commit
7d8825a9fb
|
|
@ -239,6 +239,7 @@ CommonReader::merge_cell (db::Layout &layout, db::cell_index_type target_cell_in
|
||||||
{
|
{
|
||||||
const db::Cell &src_cell = layout.cell (src_cell_index);
|
const db::Cell &src_cell = layout.cell (src_cell_index);
|
||||||
db::Cell &target_cell = layout.cell (target_cell_index);
|
db::Cell &target_cell = layout.cell (target_cell_index);
|
||||||
|
target_cell.set_ghost_cell (src_cell.is_ghost_cell () && target_cell.is_ghost_cell ());
|
||||||
|
|
||||||
// copy over the instances
|
// copy over the instances
|
||||||
for (db::Cell::const_iterator i = src_cell.begin (); ! i.at_end (); ++i) {
|
for (db::Cell::const_iterator i = src_cell.begin (); ! i.at_end (); ++i) {
|
||||||
|
|
@ -347,7 +348,7 @@ CommonReader::finish (db::Layout &layout)
|
||||||
|
|
||||||
// no conflict - plain rename
|
// no conflict - plain rename
|
||||||
|
|
||||||
for (std::map<std::string, std::pair<size_t, db::cell_index_type> >::const_iterator i = m_name_map.begin (); i != m_name_map.end () && ! has_conflict; ++i) {
|
for (std::map<std::string, std::pair<size_t, db::cell_index_type> >::const_iterator i = m_name_map.begin (); i != m_name_map.end (); ++i) {
|
||||||
layout.rename_cell (i->second.second, i->first.c_str ());
|
layout.rename_cell (i->second.second, i->first.c_str ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -379,7 +380,8 @@ CommonReader::finish (db::Layout &layout)
|
||||||
db::cell_index_type ci_org = c2n.second;
|
db::cell_index_type ci_org = c2n.second;
|
||||||
|
|
||||||
// NOTE: proxy cells are never resolved. "RenameCell" is a plain and simple case.
|
// NOTE: proxy cells are never resolved. "RenameCell" is a plain and simple case.
|
||||||
if (c2n.first && m_cc_resolution != RenameCell && ! layout.cell (ci_org).is_proxy ()) {
|
// Ghost cells are merged rendering the new cell a non-ghost cell.
|
||||||
|
if (c2n.first && (m_cc_resolution != RenameCell || layout.cell (ci_org).is_ghost_cell () || layout.cell (ci_new).is_ghost_cell ()) && ! layout.cell (ci_org).is_proxy ()) {
|
||||||
cells_with_conflict.push_back (std::make_pair (ci_new, ci_org));
|
cells_with_conflict.push_back (std::make_pair (ci_new, ci_org));
|
||||||
} else {
|
} else {
|
||||||
layout.rename_cell (ci_new, layout.uniquify_cell_name (i->second.c_str ()).c_str ());
|
layout.rename_cell (ci_new, layout.uniquify_cell_name (i->second.c_str ()).c_str ());
|
||||||
|
|
|
||||||
|
|
@ -541,6 +541,78 @@ TEST(4_CollectModeRename)
|
||||||
db::compare_layouts (_this, layout, fn_au, db::WriteGDS2, 1);
|
db::compare_layouts (_this, layout, fn_au, db::WriteGDS2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(4_CollectModeRenameWithGhost)
|
||||||
|
{
|
||||||
|
db::Manager m (false);
|
||||||
|
db::Layout layout (&m);
|
||||||
|
|
||||||
|
db::LoadLayoutOptions options;
|
||||||
|
options.get_options<db::CommonReaderOptions> ().cell_conflict_resolution = db::RenameCell;
|
||||||
|
|
||||||
|
{
|
||||||
|
tl::InputStream file (tl::testsrc () + "/testdata/gds/collect_basic_ag.gds");
|
||||||
|
db::Reader reader (file);
|
||||||
|
reader.read (layout, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
tl::InputStream file (tl::testsrc () + "/testdata/gds/collect_basic_b.gds");
|
||||||
|
db::Reader reader (file);
|
||||||
|
reader.read (layout, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string fn_au (tl::testsrc () + "/testdata/gds/collect_rename_au2.gds");
|
||||||
|
db::compare_layouts (_this, layout, fn_au, db::WriteGDS2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(4_CollectModeRenameWithGhostReverse)
|
||||||
|
{
|
||||||
|
db::Manager m (false);
|
||||||
|
db::Layout layout (&m);
|
||||||
|
|
||||||
|
db::LoadLayoutOptions options;
|
||||||
|
options.get_options<db::CommonReaderOptions> ().cell_conflict_resolution = db::RenameCell;
|
||||||
|
|
||||||
|
{
|
||||||
|
tl::InputStream file (tl::testsrc () + "/testdata/gds/collect_basic_a.gds");
|
||||||
|
db::Reader reader (file);
|
||||||
|
reader.read (layout, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
tl::InputStream file (tl::testsrc () + "/testdata/gds/collect_basic_bg.gds");
|
||||||
|
db::Reader reader (file);
|
||||||
|
reader.read (layout, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string fn_au (tl::testsrc () + "/testdata/gds/collect_rename_au3.gds");
|
||||||
|
db::compare_layouts (_this, layout, fn_au, db::WriteGDS2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(4_CollectModeRenameWithGhostBoth)
|
||||||
|
{
|
||||||
|
db::Manager m (false);
|
||||||
|
db::Layout layout (&m);
|
||||||
|
|
||||||
|
db::LoadLayoutOptions options;
|
||||||
|
options.get_options<db::CommonReaderOptions> ().cell_conflict_resolution = db::RenameCell;
|
||||||
|
|
||||||
|
{
|
||||||
|
tl::InputStream file (tl::testsrc () + "/testdata/gds/collect_basic_ag.gds");
|
||||||
|
db::Reader reader (file);
|
||||||
|
reader.read (layout, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
tl::InputStream file (tl::testsrc () + "/testdata/gds/collect_basic_bg.gds");
|
||||||
|
db::Reader reader (file);
|
||||||
|
reader.read (layout, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string fn_au (tl::testsrc () + "/testdata/gds/collect_rename_au4.gds");
|
||||||
|
db::compare_layouts (_this, layout, fn_au, db::WriteGDS2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
TEST(4_CollectModeOverwrite)
|
TEST(4_CollectModeOverwrite)
|
||||||
{
|
{
|
||||||
db::Manager m (false);
|
db::Manager m (false);
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue