rtlil: Add const append helper

This commit is contained in:
Martin Povišer 2024-12-13 18:59:35 +01:00
parent 3d35f367cf
commit 08394c51a2
2 changed files with 8 additions and 0 deletions

View File

@ -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];

View File

@ -738,6 +738,8 @@ public:
bool empty() const;
void bitvectorize() const;
void append(const RTLIL::Const &other);
class const_iterator {
private:
const Const& parent;