Skip to content

Commit

Permalink
old_pc per core was nonsense.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah Mount committed Aug 3, 2016
1 parent 8eb0f23 commit cf21a80
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions revelation/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def __init__(self):
if self.jit_enabled:
self.jitdriver = JitDriver(
greens = ['pc', 'core', 'coreid', 'opcode'],
reds = ['tick_counter', 'halted_cores', 'idle_cores',
'old_pcs', 'memory', 'sim', 'state', 'start_time'],
reds = ['tick_counter', 'old_pc', 'halted_cores', 'idle_cores',
'memory', 'sim', 'state', 'start_time'],
virtualizables = ['state'],
get_printable_location=get_printable_location)
self.default_trace_limit = 400000
Expand Down Expand Up @@ -199,7 +199,7 @@ def run(self):
opcode = 0 # a more meaningful trace in the JIT log.
tick_counter = 0 # Number of instructions executed by all cores.
halted_cores, idle_cores = [], []
old_pcs = [0] * len(self.states)
old_pc = 0
start_time, end_time = time.time(), .0

while True:
Expand All @@ -208,17 +208,17 @@ def run(self):
coreid=coreid,
opcode=opcode,
tick_counter=tick_counter,
old_pc=old_pc,
halted_cores=halted_cores,
idle_cores=idle_cores,
old_pcs=old_pcs,
memory=memory,
sim=self,
state=self.states[self.core],
start_time=start_time)
# Fetch PC, decode instruction and execute.
pc = hint(self.states[self.core].fetch_pc(), promote=True)
coreid = hint(self.states[self.core].coreid, promote=True)
old_pcs[self.core] = pc
old_pc = pc
opcode = memory.iread(pc, 4, from_core=self.states[self.core].coreid)
try:
instruction, exec_fun = self.decode(opcode)
Expand Down Expand Up @@ -256,15 +256,15 @@ def run(self):
elif (self.core in idle_cores and self.fetch_latch() > 0):
idle_cores.remove(self.core)
self._service_interrupts()
if self.states[self.core].fetch_pc() < old_pcs[self.core]:
if self.states[self.core].fetch_pc() < old_pc:
self.jitdriver.can_enter_jit(pc=self.states[self.core].fetch_pc(),
core=self.core,
coreid=coreid,
opcode=opcode,
tick_counter=tick_counter,
old_pc=old_pc,
halted_cores=halted_cores,
idle_cores=idle_cores,
old_pcs=old_pcs,
memory=memory,
sim=self,
state=self.states[self.core],
Expand Down

0 comments on commit cf21a80

Please sign in to comment.