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

Take MRET debug exception from WB #458

Closed
Silabs-ArjanB opened this issue Feb 25, 2022 · 3 comments
Closed

Take MRET debug exception from WB #458

Silabs-ArjanB opened this issue Feb 25, 2022 · 3 comments
Assignees
Labels
Component:RTL For issues in the RTL (e.g. for files in the rtl directory) Type:Task For any task except bug fixes

Comments

@Silabs-ArjanB
Copy link
Contributor

In #456 an RVFI fix was done that likely could better have been done in the RTL instead.

Fix that should be undone in RVFI:

assign pc_mux_exception = (ctrl_fsm_i.pc_mux == PC_TRAP_EXC) || (ctrl_fsm_i.pc_mux == PC_TRAP_DBE);

vs.

assign pc_mux_exception = (ctrl_fsm_i.pc_mux == PC_TRAP_EXC) || pc_mux_debug_exception ;
assign pc_mux_debug_exception = (ctrl_fsm_i.pc_mux == PC_TRAP_DBE) && !dret_in_ex_i; // Ignore exceptions from instructons that will never be executed

In the RTL we should consider taking the MRET related debug exception from WB instead (as we do for other exceptions). Check potential impact on PC hardening logic as well.

@Silabs-ArjanB Silabs-ArjanB added Component:RTL For issues in the RTL (e.g. for files in the rtl directory) Type:Task For any task except bug fixes labels Feb 25, 2022
@Silabs-ArjanB
Copy link
Contributor Author

The following code should be updated as well:

assign ctrl_fsm_o.jump_in_id_raw = (alu_jmp_id_i && alu_en_id_i) || (sys_mret_id_i && sys_en_id_i && !debug_mode_q);

@Silabs-ArjanB
Copy link
Contributor Author

Some further updates are needed here

@silabs-oysteink
Copy link
Contributor

I believe this should be fixed now with the merge of PR #442 on cv32e40s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:RTL For issues in the RTL (e.g. for files in the rtl directory) Type:Task For any task except bug fixes
Projects
None yet
Development

No branches or pull requests

2 participants