From 65fb62901ee02d5c8398ce35d17e72ac6e0b29df Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Mon, 19 Jul 2021 00:19:56 +0100 Subject: [PATCH] Mask off trap entry assertion from IRQs when in debug mode. Because the IRQ is level-sensitive, this caused trap entry to be held asserted when an IRQ fired in debug mode. This was exposed by the last bug fix -- it is only seen now that MIE+MPIE shuffling is correctly disabled in debug mode. --- hdl/hazard3_csr.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hdl/hazard3_csr.v b/hdl/hazard3_csr.v index bfb1389..390d031 100644 --- a/hdl/hazard3_csr.v +++ b/hdl/hazard3_csr.v @@ -1018,7 +1018,7 @@ assign trap_is_irq = DEBUG_SUPPORT && (want_halt_except || want_halt_irq) ? assign trap_enter_vld = CSR_M_TRAP && (exception_req_any || - !delay_irq_entry && (standard_irq_active || external_irq_active)) || + !delay_irq_entry && !debug_mode && (standard_irq_active || external_irq_active)) || DEBUG_SUPPORT && (want_halt_irq || want_halt_except || pending_dbg_resume); assign mcause_irq_next = !exception_req_any;