mirror of
https://github.com/YosysHQ/yosys
synced 2025-11-13 17:41:17 +00:00
Make SigSpec::is_one_hot use try_as_const
This commit is contained in:
parent
ce597dc38c
commit
dd3940c8bb
1 changed files with 2 additions and 6 deletions
|
|
@ -5540,12 +5540,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