3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-06 06:03:23 +00:00

Initialize RTLIL::Const from std::vector<bool>

This commit is contained in:
Clifford Wolf 2014-09-19 15:50:55 +02:00
parent 309623ff17
commit 00964f2f61
2 changed files with 9 additions and 1 deletions

View file

@ -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())