From ad9420787c02c507242caa23230e1b23f2ca1b58 Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Wed, 27 Jan 2021 16:16:29 -0800 Subject: [PATCH] Increment minstret when WFI completes (#636) See https://github.com/riscv/riscv-isa-manual/issues/189#issuecomment-768525017 --- riscv/execute.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv/execute.cc b/riscv/execute.cc index a810d53c..51d75b56 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -371,7 +371,7 @@ void processor_t::step(size_t n) // In the debug ROM this prevents us from wasting time looping, but also // allows us to switch to other threads only once per idle loop in case // there is activity. - n = instret; + n = ++instret; } state.minstret += instret;