mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 09:05:32 +00:00
RTLIL: factor out RTLIL::Module::addMemory. NFC.
This commit is contained in:
parent
ebbbe2156e
commit
9338ff66b9
4 changed files with 16 additions and 14 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -174,15 +174,9 @@ struct TechmapWorker
|
|||
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue