diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-09-19 15:50:55 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-09-19 15:50:55 +0200 |
commit | 00964f2f618d241a2e5cd32f4e7dbbcf55de4fb4 (patch) | |
tree | ed21e65940902aaee63449509555255620383996 /kernel/rtlil.cc | |
parent | 309623ff177f2538a4c529dbc025374008d85880 (diff) |
Initialize RTLIL::Const from std::vector<bool>
Diffstat (limited to 'kernel/rtlil.cc')
-rw-r--r-- | kernel/rtlil.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 6556b82e..00be796f 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -65,6 +65,13 @@ RTLIL::Const::Const(RTLIL::State bit, int width) bits.push_back(bit); } +RTLIL::Const::Const(const std::vector<bool> &bits) +{ + flags = RTLIL::CONST_FLAG_NONE; + for (auto b : bits) + this->bits.push_back(b ? RTLIL::S1 : RTLIL::S0); +} + bool RTLIL::Const::operator <(const RTLIL::Const &other) const { if (bits.size() != other.bits.size()) |