Fix detection of exception-like vs IRQ-like halt/trap entries

This commit is contained in:
Luke Wren 2021-07-15 19:41:35 +01:00
parent 71ec9fa283
commit 011008efd1
1 changed files with 5 additions and 1 deletions

View File

@ -1003,7 +1003,11 @@ assign trap_addr =
except == EXCEPT_MRET ? mepc :
pending_dbg_resume ? dpc : mtvec | {24'h0, vector_sel, 2'h0};
assign trap_is_irq = !exception_req_any || (DEBUG_SUPPORT && want_halt_irq);
// Check for exception-like or IRQ-like trap entry; any debug mode entry takes
// priority over any regular trap.
assign trap_is_irq = DEBUG_SUPPORT && (want_halt_except || want_halt_irq) ?
!want_halt_except : !exception_req_any;
assign trap_enter_vld =
CSR_M_TRAP && (exception_req_any ||
!delay_irq_entry && (standard_irq_active || external_irq_active)) ||