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

WFE/WFI in wb + pending irq can cause interrupt to be missed #403

Open
silabs-hfegran opened this issue Feb 6, 2023 · 6 comments
Open
Assignees
Labels
Component:Other Non-RTL, non-documentation (e.g. bhv, sva) Status:Resolved Issue has been resolved, but closure is pending on git merge and/or issuer confirmation Type:Bug For bugs in any content (RTL, Documentation, etc.)

Comments

@silabs-hfegran
Copy link
Contributor

WFE/WFI in wb + IRQ can cause interrupt to be missed

An wfi/wfe in wb while there is a pending and enabled interrupt for one cycle causes interrupt to be missed. In the example below the second pending and enabled interrupt wakes up the core and is taken.

Steps to Reproduce

  1. git hash: df6c2cd
  2. Assertion:
    property p_higher_lvl_than_mintthresh_th_can_preempt;
            clic.irq
        ##1 ($past(clic.priv) == current_priv_mode)
        &&  ($past(clic.level) > effective_clic_level)
        &&  mstatus_fields.mie
        &&  is_interrupt_allowed == 1'b1
      |->
            irq_ack
      or
            rvfi_valid[->1:2]
        ##0 rvfi_dbg_mode
      or
            rvfi_valid[->1:2]
        ##0 rvfi_intr.exception
      or
            rvfi_valid[->1:2]
        ##0 rvfi_trap.exception
      or
            rvfi_valid[->1:2]
        ##0 is_cause_nmi
      ;
    endproperty : p_higher_lvl_than_mintthresh_th_can_preempt

    a_higher_lvl_than_mintthresh_th_can_preempt: assert property(p_higher_lvl_than_mintthresh_th_can_preempt)
    else
      `uvm_error(info_tag,
        $sformatf("Higher level than mintthresh should be able to interrupt"));

  1. Logfile and/or wave-dump info (screen shots can be useful)
    image
@silabs-hfegran silabs-hfegran added the Component:RTL For issues in the RTL (e.g. for files in the rtl directory) label Feb 6, 2023
@Silabs-ArjanB Silabs-ArjanB added Component:Other Non-RTL, non-documentation (e.g. bhv, sva) Type:Bug For bugs in any content (RTL, Documentation, etc.) and removed Component:RTL For issues in the RTL (e.g. for files in the rtl directory) labels Feb 6, 2023
@Silabs-ArjanB
Copy link
Contributor

Not an RTL bug, but the interrupt_allowed signal should be fixed nonetheless to have a more logical behavior for 'multi-op' WFE/WFI. Should be SEC clean, but will aid writing assertions.

@Silabs-ArjanB
Copy link
Contributor

Resolved with openhwgroup/cv32e40x#795

@Silabs-ArjanB Silabs-ArjanB added the Status:Resolved Issue has been resolved, but closure is pending on git merge and/or issuer confirmation label Feb 28, 2023
@silabs-oysteink
Copy link
Contributor

The merge from CV32E40X will come shortly.

silabs-oysteink pushed a commit to silabs-oysteink/cv32e40s that referenced this issue Feb 28, 2023
@Silabs-ArjanB
Copy link
Contributor

@silabs-hfegran Can you please close this if it has been fixed?

@silabs-hfegran
Copy link
Contributor Author

@Silabs-ArjanB Will close this issue when verified

@silabs-oysteink
Copy link
Contributor

Is this verified yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:Other Non-RTL, non-documentation (e.g. bhv, sva) Status:Resolved Issue has been resolved, but closure is pending on git merge and/or issuer confirmation Type:Bug For bugs in any content (RTL, Documentation, etc.)
Projects
None yet
Development

No branches or pull requests

3 participants