Skip to content

Optimized CSR stalls #917

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

Merged

Conversation

silabs-oysteink
Copy link
Contributor

Conservatively stalling ID for any implicit CSR read while any implicit or explicit CSR write is in EX or WB (unchanged)
Conservatively stalling EX for any implicit CSR read while any implicit or explicit CSR write is in WB
Conservatively stalling EX for any explicit CSR rad while any implicit CSR write is in WB
Precisely stalling EX for any explicit CSR read while an explicit CSR write to the same CSR is in WB.

1: ID stage stalls are kept as before for implicit CSR reads (mret and tablejumps). They stall on any CSR accesses in EX or WB.
2: EX stage is stalled for:
2.1: CSR instruction reading multiple CSRs (imiiplicit reads) are stalled when any CSR access is in WB
2.2: CSR instructions are stalled when any implicit CSR write is in WB
2.3: CSR instructions are stalled on a true RAW hazard with another regular CSR instruction in WB.

Signed-off-by: Oystein Knauserud <[email protected]>
@silabs-oysteink silabs-oysteink added the Component:RTL For issues in the RTL (e.g. for files in the rtl directory) label Aug 24, 2023
…out stall signals being conservative i.e not factoring inn kill or halt.

Signed-off-by: Oystein Knauserud <[email protected]>
Signed-off-by: Oystein Knauserud <[email protected]>
ex_wb_pipe_i.csr_en && ex_wb_pipe_i.csr_impl_wr));

// Detect implicit and explicit CSR writes in EX
assign csr_write_in_ex = (id_ex_pipe_i.instr_valid && (id_ex_pipe_i.csr_en || csr_impl_write_in_ex));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unneeded outer brackets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Signed-off-by: Oystein Knauserud <[email protected]>
@Silabs-ArjanB Silabs-ArjanB merged commit 268b980 into openhwgroup:master Aug 28, 2023
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants