aboutsummaryrefslogtreecommitdiffstats
path: root/passes/techmap/flatten.cc
diff options
context:
space:
mode:
Diffstat (limited to 'passes/techmap/flatten.cc')
-rw-r--r--passes/techmap/flatten.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/passes/techmap/flatten.cc b/passes/techmap/flatten.cc
index 605759bec..dbea12dca 100644
--- a/passes/techmap/flatten.cc
+++ b/passes/techmap/flatten.cc
@@ -79,15 +79,9 @@ struct FlattenWorker
for (auto &it : tpl->memories) {
IdString m_name = it.first;
apply_prefix(cell->name, m_name);
- RTLIL::Memory *m = new RTLIL::Memory;
- m->name = m_name;
- m->width = it.second->width;
- m->start_offset = it.second->start_offset;
- m->size = it.second->size;
- m->attributes = it.second->attributes;
+ RTLIL::Memory *m = module->addMemory(m_name, it.second);
if (m->attributes.count(ID::src))
m->add_strpool_attribute(ID::src, extra_src_attrs);
- module->memories[m->name] = m;
memory_renames[it.first] = m->name;
design->select(module, m);
}