mirror of
https://github.com/openhwgroup/cve2.git
synced 2025-04-24 14:09:08 -04:00
[rtl] Do not update CSRs upon exceptions in debug mode
In debug mode, exceptions shall not update any CSRs including `mcause`, `mepc`, `mtval`, `dpc` and `mstatus`, see Debug Spec v0.13.2, p.39. This resolves lowRISC/ibex#168. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
This commit is contained in:
parent
8112ba5a24
commit
d117b24a17
1 changed files with 3 additions and 1 deletions
|
@ -522,7 +522,9 @@ module ibex_cs_registers #(
|
|||
dcsr_d.prv = priv_lvl_q;
|
||||
dcsr_d.cause = debug_cause_i;
|
||||
depc_d = exception_pc;
|
||||
end else begin
|
||||
end else if (!debug_mode_i) begin
|
||||
// In debug mode, "exceptions do not update any registers. That
|
||||
// includes cause, epc, tval, dpc and mstatus." [Debug Spec v0.13.2, p.39]
|
||||
mtval_d = csr_mtval_i;
|
||||
mstatus_d.mie = 1'b0; // disable interrupts
|
||||
// save current status
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue