Skip to content

Commit

Permalink
Avoid calling state.fetch_pc().
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah Mount committed Aug 30, 2016
1 parent 12e123a commit 0178b4b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions revelation/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0178b4b

Please sign in to comment.