WIP: test for multimapping in LEF/DEF

This commit is contained in:
Matthias Koefferlein
2020-12-19 21:28:22 +01:00
parent d4b5dab0db
commit 9688da9ffd
9 changed files with 90 additions and 36 deletions
@@ -1359,18 +1359,22 @@ std::set<unsigned int> LEFDEFReaderState::open_layer_uncached(db::Layout &layout
}
}
bool found = false;
int lfound = -1;
if (lp_new.layer >= 0 && lp_new.datatype >= 0) {
for (db::Layout::layer_iterator i = layout.begin_layers (); i != layout.end_layers () && ! found; ++i) {
for (db::Layout::layer_iterator i = layout.begin_layers (); i != layout.end_layers () && lfound < 0; ++i) {
if ((*i).second->log_equal (lp_new)) {
found = true;
res.insert ((*i).first);
lfound = int ((*i).first);
}
}
}
if (! found) {
if (lfound < 0) {
res.insert (layout.insert_layer (lp_new));
} else {
res.insert ((unsigned int) lfound);
db::LayerProperties lp_org = layout.get_properties ((unsigned int) lfound);
join_layer_names (lp_org.name, name);
layout.set_properties ((unsigned int) lfound, lp_org);
}
if (l == ll.end ()) {
@@ -724,6 +724,24 @@ TEST(118_density)
run_test (_this, "density", "read:in.lef", "au.oas.gz", default_options (), false);
}
TEST(119_multimapping)
{
db::LEFDEFReaderOptions options = default_options ();
db::LayerMap lm = db::LayerMap::from_string_file_format ("(M1:1/0)\n(M2:3/0)\n+(M1:100/0)\n+(M2:100/0)\n(VIA1:2/0)");
options.set_layer_map (lm);
db::LayerMap lm_read = run_test (_this, "multimap", "def:test.def", "au.oas.gz", options, false);
EXPECT_EQ (lm_read.to_string (),
"layer_map("
"'OUTLINE : OUTLINE (4/0)';"
"'+M1.VIA : M1 (1/0)';"
"'+M1.VIA;M2.VIA : \\'M1;M2\\' (100/0)';"
"'+M2.VIA : M2 (3/0)';"
"'VIA1.VIA : VIA1 (2/0)'"
")"
)
}
TEST(200_lefdef_plugin)
{
db::Layout ly;