-
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
Implemented DM_REGION #768
Implemented DM_REGION #768
Conversation
Accesses to the DM_REGION while in debug mode gets the following attriutes: - main = 1 - bufferable = 0 - cacheable = 0 - no atomics allowed - no integrity Signed-off-by: Oystein Knauserud <[email protected]>
Signed-off-by: Oystein Knauserud <[email protected]>
rtl/cv32e40x_pma.sv
Outdated
parameter bit A_EXT = 0, | ||
parameter int PMA_NUM_REGIONS = 0, | ||
parameter pma_cfg_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT} | ||
) | ||
( | ||
input logic [31:0] trans_addr_i, | ||
input logic trans_debug_region_i, // Transaction address is inside the debug redion |
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.
redion -> region
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.
Fixed
rtl/cv32e40x_pma.sv
Outdated
@@ -55,6 +65,13 @@ module cv32e40x_pma import cv32e40x_pkg::*; | |||
// PMA is deconfigured | |||
assign pma_cfg = NO_PMA_R_DEFAULT; | |||
|
|||
always_comb begin | |||
// When core is in debug mode, use PMA_DBG as attributes for the DM range |
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.
When core is in debug mode, -> Debug mode transactions within the Debug Module region
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.
Fixed
always_comb begin | ||
// When core is in debug mode, use PMA_DBG as attributes for the DM range | ||
if (trans_debug_region_i) begin | ||
pma_cfg = PMA_DBG; |
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.
Multiple assignment together with line 66
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.
Fixed
rtl/cv32e40x_pma.sv
Outdated
(word_addr[31:PMA_ADDR_LSB] < PMA_CFG[i].word_addr_high[31:PMA_ADDR_LSB])) begin | ||
pma_cfg = PMA_CFG[i]; | ||
end | ||
end | ||
|
||
// When core is in debug mode, use PMA_DBG as attributes for the DM range |
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.
When core is in debug mode, -> Debug mode transactions within the Debug Module region
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.
Fixed
sva/cv32e40x_mpu_sva.sv
Outdated
@@ -216,7 +228,9 @@ module cv32e40x_mpu_sva import cv32e40x_pkg::*; import uvm_pkg::*; | |||
always_comb begin | |||
pma_expected_cfg = NO_PMA_R_DEFAULT; | |||
if (PMA_NUM_REGIONS) begin | |||
pma_expected_cfg = is_pma_matched ? PMA_CFG[pma_lowest_match] : PMA_R_DEFAULT; | |||
pma_expected_cfg = is_pma_matched ? PMA_CFG[pma_lowest_match] : |
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.
Debug mode access within Debug Module region should be highest priority
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.
Fixed
sva/cv32e40x_mpu_sva.sv
Outdated
(!is_addr_match && was_obi_waiting && $past(obi_req)) || | ||
// or we get an address match, but was already outputting the same address (no pma_err) | ||
// but a change in debug mode causes the new transaction the same address to fail | ||
(is_addr_match && was_obi_waiting && $past(obi_req) && (pma_dbg != obi_dbg))) |
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.
"but a change in debug mode causes the new transaction the same address to fail" this comment does not seem to correspond to any logical requirement we have. Please make the check and comment more specific so that it corresponds to logical requirements (this just looks like a 'fix' to a failing assertion).
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.
Updated assertion to be a bit stronger (!pma_dbg && obi_dbg) as discussed. The scenario may happen in the prefetcher when exiting debug mode while there are outstanding transactions waiting for instr_gnt_i.
Signed-off-by: Oystein Knauserud <[email protected]>
No description provided.