Skip to content

Commit

Permalink
formalff -setundef: Fix handling for has_srst FFs
Browse files Browse the repository at this point in the history
The `has_srst`` case was checking `sig_ce` instead of `sig_srst` due to
a copy and paste error.

This would crash when `has_ce` was false and could incorrectly determine
that an initial value is unused when `has_ce` and `has_srst` are both
set.
  • Loading branch information
jix committed Apr 15, 2024
1 parent 7bb2746 commit 2bd889a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion passes/sat/formalff.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ struct InitValWorker
return true;
if (ff.has_ce && initconst(ff.sig_ce.as_bit()) == (ff.pol_ce ? State::S0 : State::S1))
continue;
if (ff.has_srst && initconst(ff.sig_ce.as_bit()) == (ff.pol_srst ? State::S1 : State::S0))
if (ff.has_srst && initconst(ff.sig_srst.as_bit()) == (ff.pol_srst ? State::S1 : State::S0))
continue;

return true;
Expand Down

0 comments on commit 2bd889a

Please sign in to comment.