mirror of
https://github.com/YosysHQ/yosys
synced 2025-11-03 13:07:58 +00:00
Make SigSpec::is_one_hot use try_as_const
This commit is contained in:
parent
a0e9e2d364
commit
0d45d9cc6e
1 changed files with 2 additions and 6 deletions
|
|
@ -5532,12 +5532,8 @@ bool RTLIL::SigSpec::is_onehot(int *pos) const
|
|||
{
|
||||
cover("kernel.rtlil.sigspec.is_onehot");
|
||||
|
||||
pack();
|
||||
if (!is_fully_const())
|
||||
return false;
|
||||
log_assert(GetSize(chunks_) <= 1);
|
||||
if (width_)
|
||||
return RTLIL::Const(chunks_[0].data).is_onehot(pos);
|
||||
if (std::optional<RTLIL::Const> c = try_as_const())
|
||||
return c->is_onehot(pos);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue