From: Andrew Waterman Date: Mon, 1 Jun 2015 01:10:20 +0000 (-0700) Subject: Execute exactly the # of insns passed to step() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1f9205c93b3541b5c2ae19d4a6250aab70977e5f;p=riscv-isa-sim.git Execute exactly the # of insns passed to step() Previously, the value was treated as approximate. --- 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; \ }