diff options
| author | Jannis Harder <me@jix.one> | 2023-01-30 16:14:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-30 16:14:24 +0100 |
| commit | c235802f4acf85b04c175a6b643aed17dd4c6f8c (patch) | |
| tree | fdef94bb6219fec593acaf4b4ec2b75edc291805 /kernel/rtlil.cc | |
| parent | 419f91a2b99fbd1b61b09682947dbb782c19a97d (diff) | |
| parent | b08a8807044980b7906362848f62291ede50e696 (diff) | |
| download | yosys-c235802f4acf85b04c175a6b643aed17dd4c6f8c.tar.gz yosys-c235802f4acf85b04c175a6b643aed17dd4c6f8c.tar.bz2 yosys-c235802f4acf85b04c175a6b643aed17dd4c6f8c.zip | |
Merge pull request #3650 from jix/rtlil_roundtrip_z_bits
backends/rtlil: Do not shorten a value with z bits to 'x
Diffstat (limited to 'kernel/rtlil.cc')
| -rw-r--r-- | kernel/rtlil.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index eee014c54..7f3508b2f 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -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"); |
