From 9338ff66b9fb86f3485f060b04f4e4b8a1fc18f6 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 3 Jun 2020 14:35:27 +0000 Subject: RTLIL: factor out RTLIL::Module::addMemory. NFC. --- kernel/rtlil.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'kernel/rtlil.cc') diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index ca4201b53..dc1add0ff 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -1884,6 +1884,18 @@ RTLIL::Cell *RTLIL::Module::addCell(RTLIL::IdString name, const RTLIL::Cell *oth return cell; } +RTLIL::Memory *RTLIL::Module::addMemory(RTLIL::IdString name, const RTLIL::Memory *other) +{ + RTLIL::Memory *mem = new RTLIL::Memory; + mem->name = name; + mem->width = other->width; + mem->start_offset = other->start_offset; + mem->size = other->size; + mem->attributes = other->attributes; + memories[mem->name] = mem; + return mem; +} + #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); \ -- cgit v1.2.3