-
Notifications
You must be signed in to change notification settings - Fork 53
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
Silabs-ArjanB
merged 4 commits into
openhwgroup:master
from
silabs-oysteink:silabs-oysteink_clic-1
Mar 24, 2022
+69
−33
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f491057
mstatus.mpie and mstatus.mpp are now accessible (RW) via the mcause C…
silabs-oysteink 2547fd2
Added todo.
silabs-oysteink 38b6ce9
Fixed issue where a write to mcause.mpie used the wrong index into ms…
silabs-oysteink 2e66627
Updates after review. Added comments and refactored to avoid code dup…
silabs-oysteink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixed issue where a write to mcause.mpie used the wrong index into ms…
…tatus. Signed-off-by: Oystein Knauserud <[email protected]>
commit 38b6ce930e6226cf1ea0475b160a8c2824c91fa9
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -534,16 +534,33 @@ module cv32e40x_cs_registers import cv32e40x_pkg::*; | |
dscratch1_n = csr_wdata_int; | ||
dscratch1_we = 1'b0; | ||
|
||
// todo: when SD/XS/FS/VS are implemented, a write to mcause.mpp/mpie | ||
// must be handled correctly to not corrupt the mentioned bitfields. | ||
mstatus_n = '{ | ||
tw: 1'b0, | ||
mprv: 1'b0, | ||
mpp: PRIV_LVL_M, | ||
mpie: csr_wdata_int[MSTATUS_MPIE_BIT], | ||
mie: csr_wdata_int[MSTATUS_MIE_BIT], | ||
default: 'b0 | ||
}; | ||
if (SMCLIC) begin | ||
// SMCLIC: A write to mcause.mpp or mcause.mpie is stored in mstatus | ||
if(mcause_we) begin | ||
mstatus_n = mstatus_q; | ||
mstatus_n.mpp = PRIV_LVL_M; | ||
mstatus_n.mpie = csr_wdata_int[MCAUSE_MPIE_BIT]; | ||
end else begin | ||
// TODO: add support for SD/XS/FS/VS | ||
mstatus_n = '{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) |
||
tw: 1'b0, | ||
mprv: 1'b0, | ||
mpp: PRIV_LVL_M, | ||
mpie: csr_wdata_int[MSTATUS_MPIE_BIT], | ||
mie: csr_wdata_int[MSTATUS_MIE_BIT], | ||
default: 'b0 | ||
}; | ||
end | ||
end else begin | ||
mstatus_n = '{ | ||
tw: 1'b0, | ||
mprv: 1'b0, | ||
mpp: PRIV_LVL_M, | ||
mpie: csr_wdata_int[MSTATUS_MPIE_BIT], | ||
mie: csr_wdata_int[MSTATUS_MIE_BIT], | ||
default: 'b0 | ||
}; | ||
end // SMCLIC | ||
mstatus_we = 1'b0; | ||
|
||
// SMCLIC: Not setting mpp or mpie, as these are stored in mstatus | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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'.