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

CLIC: Spec chapter 5.1 #485

Merged

Conversation

silabs-oysteink
Copy link
Contributor

Making mstatus.mpie and mstatus.mpp accessible via mcause.

SEC clean with SMCLIC=0

CSR_MCAUSE: begin
if (SMCLIC) begin
// For CLIC, the mpp and mpie bits from mstatus
// are readable via mcause
Copy link
Contributor

Choose a reason for hiding this comment

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

Add note that 'CLIC mode is assumed when SMCLIC = 1'. RTL should actually have checked on 'clic mode' instead of SMCLIC, but let's keep it like this as these two things are the same for our subset of the Smclic implementation (and your implementation is better for coverage reasons)

default: 'b0
};
if (SMCLIC) begin
// SMCLIC: A write to mcause.mpp or mcause.mpie is stored in mstatus
Copy link
Contributor

Choose a reason for hiding this comment

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

Same remark as above: 'CLIC mode is assumed when SMCLIC = 1'.

mstatus_n.mpie = csr_wdata_int[MCAUSE_MPIE_BIT];
end else begin
// TODO: add support for SD/XS/FS/VS
mstatus_n = '{
Copy link
Contributor

Choose a reason for hiding this comment

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

Reorganize code to avoid this code duplication. Simply first do the original mstatus_n assignment and then a if (SMCLIC) if (mcause_we)

@Silabs-ArjanB Silabs-ArjanB added the Component:RTL For issues in the RTL (e.g. for files in the rtl directory) label Mar 24, 2022
@Silabs-ArjanB Silabs-ArjanB merged commit 243bb9c into openhwgroup:master Mar 24, 2022
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