From 710117a9970a485513938abf6b2d90f1b0b0fc49 Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Mon, 27 Feb 2023 14:33:39 -0800 Subject: Decrement icount trigger count on external interrupt Spec says: > This trigger matches on every instruction completed or trap > taken from a privilege mode where the trigger is enabled. Other (synchronous) traps were already correctly decrementing count, but external interrupts (i.e. timer interrupts) were not. --- riscv/processor.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/riscv/processor.cc b/riscv/processor.cc index 153ff9d..c757d42 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -696,6 +696,7 @@ void processor_t::take_interrupt(reg_t pending_interrupts) else abort(); + if (check_triggers_icount) TM.detect_icount_match(); throw trap_t(((reg_t)1 << (isa->get_max_xlen() - 1)) | ctz(enabled_interrupts)); } } -- cgit v1.1