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

Added support for DBG_NUM_TRIGGERS parameter #700

Conversation

silabs-oysteink
Copy link
Contributor

@silabs-oysteink silabs-oysteink commented Nov 16, 2022

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]

…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]>
@silabs-oysteink silabs-oysteink added the Component:RTL For issues in the RTL (e.g. for files in the rtl directory) label Nov 16, 2022
@@ -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
Copy link
Contributor

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.

Copy link
Contributor Author

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.


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);
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

assign tdata3_rdata_o = 32'h00000000;
assign tselect_rdata_o = 32'h00000000;
assign tselect_rdata_o = tselect_q;
Copy link
Contributor

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

Copy link
Contributor Author

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]>
@Silabs-ArjanB Silabs-ArjanB merged commit 1aa0aa3 into openhwgroup:master Nov 17, 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