-
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
Added support for DBG_NUM_TRIGGERS parameter #700
Added support for DBG_NUM_TRIGGERS parameter #700
Conversation
…module will not be instantiated and any access to trigger CSR will result in an illegal instruction. debug_triggers will instantiate DBG_NUM_TRIGGERS instances of tdata1 and tdata2 and perform instruction address match checks for any enabled triggers. Converted trigger type 2 (mcontrol) to 6 (mcontrol6) and updated trigger match to take EXECUTE and M bit into account. (Passed modified debug_trigger_test). Reset value for tdata1 is updated to reflect mcontrol6. Signed-off-by: Oystein Knauserud <[email protected]>
bhv/cv32e40x_wrapper.sv
Outdated
@@ -560,13 +560,16 @@ endgenerate | |||
.csr_mclicbase_n_i ( core_i.cs_registers_i.mclicbase_n ), | |||
.csr_mclicbase_q_i ( core_i.cs_registers_i.mclicbase_rdata ), | |||
.csr_mclicbase_we_i ( core_i.cs_registers_i.mclicbase_we ), | |||
.csr_tdata1_n_i ( core_i.cs_registers_i.debug_triggers_i.tdata1_n ), | |||
.csr_tdata1_n_i ( core_i.cs_registers_i.triggers.debug_triggers_i.tdata1_n ), // If DBG_NUM_TRIGGERS=0 this connection will fail |
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.
How will that get fixed? At least change into todo.
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.
Refactored code to always include debug_triggers and checking for DBG_NUM_TRIGGERS inside debug_triggers instead. Makes RVFI connection equal for any value of DBG_NUM_TRIGGERS.
rtl/cv32e40x_debug_triggers.sv
Outdated
|
||
logic unused_signals; | ||
|
||
// Write data | ||
always_comb begin | ||
tselect_n = tselect_rdata_o; // todo | ||
// Tselect is WARL (0 -> DBG_NUM_TRIGGERS-1) | ||
tselect_n = (csr_wdata_i < DBG_NUM_TRIGGERS) ? csr_wdata_i : (DBG_NUM_TRIGGERS - 1); |
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.
Resolution is not according to spec.
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_debug_triggers.sv
Outdated
assign tdata3_rdata_o = 32'h00000000; | ||
assign tselect_rdata_o = 32'h00000000; | ||
assign tselect_rdata_o = tselect_q; |
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.
Add todo on tinfo_rdata_o; it still need to be updated
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.
Added todo.
- Always including debug_triggers in cs_registers, not including logic if DBG_NUM_TRIGGERS=0. Makes RVFI connection easier. Signed-off-by: Oystein Knauserud <[email protected]>
Signed-off-by: Oystein Knauserud <[email protected]>
Added support for DBG_NUM_TRIGGER parameter.If 0, the debug_triggers module will not be instantiated and any access to trigger CSR will result in an illegal instruction.
debug_triggers will instantiate DBG_NUM_TRIGGERS instances of tdata1 and tdata2 and perform instruction address match checks for any enabled triggers.
Converted trigger type 2 (mcontrol) to 6 (mcontrol6) and updated trigger match to take EXECUTE and M bit into account. (Passed modified debug_trigger_test). Reset value for tdata1 is updated to reflect mcontrol6.
Without the conversion of mcontrol -> mcontrol6, this PR is SEC clean when DBG_NUM_TRIGGERS=1.
Signed-off-by: Oystein Knauserud [email protected]