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

Add RTLIL::Const::is_fully_ones()

This commit is contained in:
Clifford Wolf 2017-12-14 02:06:39 +01:00
parent 96ad688849
commit 76afff7ef6
2 changed files with 12 additions and 0 deletions

View file

@ -172,6 +172,17 @@ bool RTLIL::Const::is_fully_zero() const
return true;
}
bool RTLIL::Const::is_fully_ones() const
{
cover("kernel.rtlil.const.is_fully_ones");
for (auto bit : bits)
if (bit != RTLIL::State::S1)
return false;
return true;
}
bool RTLIL::Const::is_fully_def() const
{
cover("kernel.rtlil.const.is_fully_def");