mirror of
https://github.com/YosysHQ/yosys.git
synced 2026-08-29 01:24:25 +02:00
Add RTLIL::Const::is_fully_ones()
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -480,6 +480,7 @@ struct RTLIL::Const
|
||||
inline const RTLIL::State &operator[](int index) const { return bits.at(index); }
|
||||
|
||||
bool is_fully_zero() const;
|
||||
bool is_fully_ones() const;
|
||||
bool is_fully_def() const;
|
||||
bool is_fully_undef() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user