diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 69b7afa6e..316969e6b 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -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 c = try_as_const()) + return c->is_onehot(pos); return false; }