From 0178b4b10b18480f75ddaf5f4e2316bda4286347 Mon Sep 17 00:00:00 2001 From: Sarah Mount Date: Wed, 31 Aug 2016 00:31:46 +0100 Subject: [PATCH] Avoid calling state.fetch_pc(). --- revelation/sim.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/revelation/sim.py b/revelation/sim.py index 94af137..540dda5 100644 --- a/revelation/sim.py +++ b/revelation/sim.py @@ -129,14 +129,12 @@ def run(self): self.start_time = time.time() while True: - self.jitdriver.jit_merge_point(pc=state.fetch_pc(), + self.jitdriver.jit_merge_point(pc=pc, core=core, tick_counter=tick_counter, coreids=coreids, sim=self, state=state,) - pc = state.fetch_pc() - # old_pc = pc # Fetch next instruction. opcode = state.mem.iread(pc, 4, from_core=state.coreid) try: @@ -147,7 +145,7 @@ def run(self): if (state.is_first_core and self.logger and state.debug.enabled('trace')): state.logger.log('%s %s %s %s' % - (pad('%x' % state.fetch_pc(), 8, ' ', False), + (pad('%x' % pc, 8, ' ', False), pad_hex(opcode), pad(instruction.name, 12), pad('%d' % state.num_insts, 8))) # Check whether or not we are in a hardware loop, and set @@ -223,8 +221,11 @@ def run(self): self.states[core].ACTIVE = 1 # Wake up IDLE cores. break state = self.states[core] - # if state.fetch_pc() < old_pc: - # self.jitdriver.can_enter_jit(pc=state.fetch_pc(), + # Move program counter to next instruction. + # old_pc = pc + pc = state.fetch_pc() + # if pc < old_pc: + # self.jitdriver.can_enter_jit(pc=pc, # core=core, # tick_counter=tick_counter, # coreids=coreids,