diff options
-rw-r--r-- | riscv/execute.cc | 2 | ||||
-rw-r--r-- | riscv/processor.cc | 1 | ||||
-rw-r--r-- | riscv/triggers.h | 10 |
3 files changed, 7 insertions, 6 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc index f412a35..acf0e90 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -263,7 +263,7 @@ void processor_t::step(size_t n) state.single_step = state.STEP_STEPPED; } - if (!state.serialized) { + if (!state.serialized && check_triggers_icount) { auto match = TM.detect_icount_match(); if (match.has_value()) { assert(match->timing == triggers::TIMING_BEFORE); 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)); } } diff --git a/riscv/triggers.h b/riscv/triggers.h index 199a3c2..0c9dabc 100644 --- a/riscv/triggers.h +++ b/riscv/triggers.h @@ -249,11 +249,11 @@ public: virtual std::optional<match_result_t> detect_icount_match(processor_t * const proc) noexcept override; private: - bool dmode; - bool hit; - unsigned count, count_read_value; - bool pending, pending_read_value; - action_t action; + bool dmode = false; + bool hit = false; + unsigned count = 1, count_read_value = 1; + bool pending = false, pending_read_value = false; + action_t action = (action_t)0; }; class module_t { |