diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index cb0f7da7807..d705813d9f0 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -540,6 +540,12 @@ void RTLIL::Const::bitvectorize() const { } } +void RTLIL::Const::append(const RTLIL::Const &other) { + bitvectorize(); + bitvectype& bv = get_bits(); + bv.insert(bv.end(), other.begin(), other.end()); +} + RTLIL::State RTLIL::Const::const_iterator::operator*() const { if (auto bv = parent.get_if_bits()) return (*bv)[idx]; diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 330af649f74..f4a0126e56b 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -735,6 +735,8 @@ struct RTLIL::Const bool empty() const; void bitvectorize() const; + void append(const RTLIL::Const &other); + class const_iterator { private: const Const& parent;