Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pwm,rtl] Rewrite two write-enables more explicitly #25062

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 12, 2024

  1. [pwm,rtl] Rewrite a pair of write-enables more explicitly

    The behaviour will be the same, but the first change avoids an
    expression coverage hole being reported for `blink_en_i == 0` and
    `blink_ctr_q == 1`. This can't actually happen: `blink_ctr_q` can only
    be updated by being set to `blink_ctr_d` (on this line). If
    `blink_en_i` is false then `blink_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 in `clr_blink_cntr` in
    `pwm_core`, which means that `clr_blink_cntr_i` is true, zeroing
    `blink_ctr_q`.
    
    Coding this write-enable more explicitly gets rid of the expression
    coverage item.
    
    The second change covers two further coverage holes, that have
    htbt_ctr_q and the write predicate false (either because blink_en_i is
    false or htbt_en_i is false).
    
    As before, this isn't possible. If the predicate is not true then
    htbt_ctr_d will be zero (so htbt_ctr_q cannot become nonzero). If it
    was nonzero before and we are changing the predicate to become false,
    the register write will cause clr_blink_cntr_i to go high, zeroing
    htbt_ctr_q.
    
    Signed-off-by: Rupert Swarbrick <[email protected]>
    rswarbrick committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    5304fe6 View commit details
    Browse the repository at this point in the history