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

Fix for cv32e40s issue #350 (common with cv32e40x). #722

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rtl/cv32e40x_controller_fsm.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ module cv32e40x_controller_fsm import cv32e40x_pkg::*;
end

// Wakeup from sleep
assign ctrl_fsm_o.wake_from_sleep = irq_wu_ctrl_i || pending_async_debug || debug_mode_q || (wfe_in_wb && wu_wfe_i); // Only WFE wakes up for wfe_wu_i
assign ctrl_fsm_o.wake_from_sleep = pending_nmi || irq_wu_ctrl_i || pending_async_debug || debug_mode_q || (wfe_in_wb && wu_wfe_i); // Only WFE wakes up for wfe_wu_i
assign ctrl_fsm_o.debug_wfi_wfe_no_sleep = debug_mode_q || dcsr_i.step;

////////////////////
Expand Down
6 changes: 3 additions & 3 deletions sva/cv32e40x_controller_fsm_sva.sv
Original file line number Diff line number Diff line change
Expand Up @@ -482,17 +482,17 @@ endgenerate
a_no_wfi_wakeup_on_wfe:
assert property (@(posedge clk) disable iff (!rst_n)
(ctrl_fsm_cs == SLEEP) && ex_wb_pipe_i.instr_valid && ex_wb_pipe_i.sys_en && ex_wb_pipe_i.sys_wfi_insn &&
!irq_wu_ctrl_i && wu_wfe_i && !pending_async_debug
!(irq_wu_ctrl_i || pending_nmi) && wu_wfe_i && !pending_async_debug
|=>
(ctrl_fsm_cs == SLEEP))
else `uvm_error("controller", "WFI instruction woke up to wu_wfe_i")

// WFE wakes up to either interrupts or wu_wfe_i
// WFE wakes up to either interrupts (including NMI) or wu_wfe_i
// Disregarding debug related reasons to wake up
a_wfe_wakeup:
assert property (@(posedge clk) disable iff (!rst_n)
(ctrl_fsm_cs == SLEEP) && ex_wb_pipe_i.instr_valid && ex_wb_pipe_i.sys_en && ex_wb_pipe_i.sys_wfe_insn &&
(irq_wu_ctrl_i || wu_wfe_i) && !pending_async_debug
(irq_wu_ctrl_i || wu_wfe_i || pending_nmi) && !pending_async_debug
|->
(ctrl_fsm_ns == FUNCTIONAL))
else `uvm_error("controller", "WFE must wake up to interuppts or wu_wfe_i")
Expand Down