mirror of https://github.com/YosysHQ/yosys.git
rtlil: Add const append helper
This commit is contained in:
parent
3d35f367cf
commit
08394c51a2
|
@ -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];
|
||||
|
|
|
@ -738,6 +738,8 @@ public:
|
|||
bool empty() const;
|
||||
void bitvectorize() const;
|
||||
|
||||
void append(const RTLIL::Const &other);
|
||||
|
||||
class const_iterator {
|
||||
private:
|
||||
const Const& parent;
|
||||
|
|
Loading…
Reference in New Issue