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:
parent
309623ff17
commit
00964f2f61
2 changed files with 9 additions and 1 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue