3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-29 07:27:58 +00:00

backends/rtlil: Do not shorten a value with z bits to 'x

This commit is contained in:
Jannis Harder 2023-01-29 13:54:02 +01:00
parent 541fdffff2
commit b08a880704
4 changed files with 22 additions and 1 deletions

View file

@ -370,6 +370,17 @@ bool RTLIL::Const::is_fully_undef() const
return true;
}
bool RTLIL::Const::is_fully_undef_x_only() const
{
cover("kernel.rtlil.const.is_fully_undef_x_only");
for (const auto &bit : bits)
if (bit != RTLIL::State::Sx)
return false;
return true;
}
bool RTLIL::Const::is_onehot(int *pos) const
{
cover("kernel.rtlil.const.is_onehot");