[pwm,rtl] Rewrite two write-enables more explicitly #25062
+4
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is actually two commits, which both behave essentially the same (with similar notes). The commit message for the first is:
The behaviour will be the same, but it avoids an expression coverage hole being reported for
blink_en_i == 0
andblink_ctr_q == 1
. This can't actually happen:blink_ctr_q
can only be updated by being set toblink_ctr_d
(on this line). Ifblink_en_i
is false thenblink_ctr_d == 0
.The only other way to reach the item would be to have incremented
blink_ctr_q
and then disabled blink. But disabling blink needs a register write, which will set a bit inclr_blink_cntr
inpwm_core
, which means thatclr_blink_cntr_i
is true, zeroingblink_ctr_q
.Coding this write-enable more explicitly gets rid of the expression coverage item.