-
Notifications
You must be signed in to change notification settings - Fork 52
Initroduced privilege level to align with CV32E40S. #716
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
Silabs-ArjanB
merged 2 commits into
openhwgroup:master
from
silabs-oysteink:silabs-oysteink_if-stage-privlvl
Dec 6, 2022
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
|
@@ -37,7 +37,7 @@ | |
// // | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
module cv32e40x_prefetcher | ||
module cv32e40x_prefetcher import cv32e40x_pkg::*; | ||
#( | ||
parameter bit SMCLIC = 1'b0 | ||
) | ||
|
@@ -52,6 +52,8 @@ module cv32e40x_prefetcher | |
output logic fetch_ready_o, | ||
input logic fetch_ptr_access_i, // Access is data access (CLIC) // todo: add similar for table jump | ||
output logic fetch_ptr_access_o, // Handshake is for a pointer access (CLIC and Zc) | ||
input privlvl_t fetch_priv_lvl_access_i, // Priv level of access | ||
output privlvl_t fetch_priv_lvl_access_o, // Priv level for handshake | ||
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. Which handshake? 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. Updated comment to explain it |
||
|
||
// Transaction request interface | ||
output logic trans_valid_o, // Transaction request valid (to bus interface adapter) | ||
|
@@ -61,13 +63,13 @@ module cv32e40x_prefetcher | |
|
||
); | ||
|
||
import cv32e40x_pkg::*; | ||
|
||
prefetch_state_e state_q, next_state; | ||
|
||
// Transaction address | ||
logic [31:0] trans_addr_q, trans_addr_incr; | ||
logic trans_ptr_access_q; | ||
privlvl_t trans_priv_lvl_q; | ||
|
||
// Increment address (address will be made word aligned at core level) | ||
assign trans_addr_incr = {trans_addr_q[31:1], 1'b0} + 32'd4; | ||
|
@@ -86,6 +88,7 @@ module cv32e40x_prefetcher | |
next_state = state_q; | ||
trans_addr_o = trans_addr_q; | ||
fetch_ptr_access_o = trans_ptr_access_q; | ||
fetch_priv_lvl_access_o = trans_priv_lvl_q; | ||
|
||
case(state_q) | ||
// Default state (pass on branch target address or transaction with incremented address) | ||
|
@@ -96,9 +99,11 @@ module cv32e40x_prefetcher | |
if (fetch_branch_i) begin | ||
trans_addr_o = fetch_branch_addr_i; | ||
fetch_ptr_access_o = fetch_ptr_access_i; | ||
fetch_priv_lvl_access_o = fetch_priv_lvl_access_i; | ||
end else begin | ||
trans_addr_o = trans_addr_incr; | ||
fetch_ptr_access_o = 1'b0; // No incremental pointer fetches | ||
fetch_priv_lvl_access_o = fetch_priv_lvl_access_i; | ||
end | ||
end | ||
if ((fetch_branch_i) && !(trans_valid_o && trans_ready_i)) begin | ||
|
@@ -114,6 +119,7 @@ module cv32e40x_prefetcher | |
// yet have its target address accepted by the bus interface adapter. | ||
trans_addr_o = fetch_branch_i ? fetch_branch_addr_i : trans_addr_q; | ||
fetch_ptr_access_o = fetch_branch_i ? fetch_ptr_access_i : trans_ptr_access_q; | ||
fetch_priv_lvl_access_o = fetch_branch_i ? fetch_priv_lvl_access_i : trans_priv_lvl_q; | ||
if (trans_valid_o && trans_ready_i) begin | ||
// Transaction with branch target address has been accepted. Start regular prefetch again. | ||
next_state = IDLE; | ||
|
@@ -143,6 +149,7 @@ module cv32e40x_prefetcher | |
if (fetch_branch_i || (trans_valid_o && trans_ready_i)) begin | ||
trans_addr_q <= trans_addr_o; | ||
trans_ptr_access_q <= fetch_ptr_access_o; | ||
trans_priv_lvl_q <= fetch_priv_lvl_access_o; | ||
end | ||
end | ||
end | ||
|
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.