From 1f9205c93b3541b5c2ae19d4a6250aab70977e5f Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Sun, 31 May 2015 18:10:20 -0700 Subject: [PATCH] Execute exactly the # of insns passed to step() Previously, the value was treated as approximate. --- riscv/processor.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/riscv/processor.cc b/riscv/processor.cc index 7162a39..6368c8f 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -261,6 +261,7 @@ void processor_t::step(size_t n) pc = execute_insn(this, pc, fetch); \ if (idx == mmu_t::ICACHE_ENTRIES-1) break; \ if (unlikely(ic_entry->tag != pc)) break; \ + if (unlikely(instret+1 == n)) break; \ instret++; \ state.pc = pc; \ } -- 2.30.2