1. Sam Mussmann
  2. tomasulo


Sam Mussmann  committed 86d425b

Remove flag variable 'done' from tracker.

  • Participants
  • Parent commits 02bb292
  • Branches master

Comments (0)

Files changed (1)

File tomasulo.py

View file
  • Ignore whitespace
   Therefore also knows which instruction(s) are next to issue and when the
   instructions are all done executing.
-  done = False
   class _Instruction:
     """ Internal representation of an instruction.
     for instruction in self.instructions:
     if self.instructions[-1].cur_state == 'CM':
-      self.done = True
+      return True
     if new_cycle > 1000:
       print "failed to stop"
-      self.done = True
+      return True
 class _ReorderBuffer:
   """Mimics a reorder buffer.
   cdb = list()
   functional_units = _FunctionalUnits()
-  while not instruction_tracker.done:
+  while not instruction_tracker.update(cycle):
     # Set up next instruction to issue next time
     cycle += 1
-    instruction_tracker.update(cycle)
 # This is debug stuff to dump the state of various hardware pieces.  I'm
 # leaving it here should you need it to debug stuff.