diff options
Diffstat (limited to 'kernel/rtlil.cc')
-rw-r--r-- | kernel/rtlil.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index b876862c8..ef81cac01 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -1536,13 +1536,13 @@ void RTLIL::Module::cloneInto(RTLIL::Module *new_mod) const new_mod->addWire(it.first, it.second); for (auto &it : memories) - new_mod->memories[it.first] = new RTLIL::Memory(*it.second); + new_mod->addMemory(it.first, it.second); for (auto &it : cells_) new_mod->addCell(it.first, it.second); for (auto &it : processes) - new_mod->processes[it.first] = it.second->clone(); + new_mod->addProcess(it.first, it.second); struct RewriteSigSpecWorker { @@ -1913,6 +1913,14 @@ RTLIL::Memory *RTLIL::Module::addMemory(RTLIL::IdString name, const RTLIL::Memor return mem; } +RTLIL::Process *RTLIL::Module::addProcess(RTLIL::IdString name, const RTLIL::Process *other) +{ + RTLIL::Process *proc = other->clone(); + proc->name = name; + processes[name] = proc; + return proc; +} + #define DEF_METHOD(_func, _y_size, _type) \ RTLIL::Cell* RTLIL::Module::add ## _func(RTLIL::IdString name, const RTLIL::SigSpec &sig_a, const RTLIL::SigSpec &sig_y, bool is_signed, const std::string &src) { \ RTLIL::Cell *cell = addCell(name, _type); \ |