From fb18fe2d93988e3b9d469f6681c48cdb6c6a7835 Mon Sep 17 00:00:00 2001 From: YenHaoChen Date: Thu, 4 May 2023 08:11:32 +0800 Subject: triggers: icount: not to decrease on firing icount trigger with Debug Mode action The icount decreases on firing beakpoint action but not on entering Debug Mode action. Reference: https://github.com/riscv/riscv-debug-spec/issues/842 --- riscv/triggers.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv/triggers.cc b/riscv/triggers.cc index 65ba4c9..39a7330 100644 --- a/riscv/triggers.cc +++ b/riscv/triggers.cc @@ -317,7 +317,7 @@ std::optional icount_t::detect_icount_match(processor_t * const ret = match_result_t(TIMING_BEFORE, action); } - if (count >= 1) { + if (count >= 1 && (ret == std::nullopt || action != MCONTROL_ACTION_DEBUG_MODE)) { if (count == 1) pending = 1; count = count - 1; -- cgit v1.1