fix operation of massacre
authoradam <adam@megacz.com>
Wed, 2 Jan 2008 12:58:14 +0000 (13:58 +0100)
committeradam <adam@megacz.com>
Wed, 2 Jan 2008 12:58:14 +0000 (13:58 +0100)
src/edu/berkeley/fleet/fpga/Generator.java

index 835b6da..13d8a4c 100644 (file)
@@ -567,6 +567,20 @@ public class Generator {
         Value instruction_count_instr         = instr   .getBits(OFFSET_COUNT+WIDTH_COUNT-1, OFFSET_COUNT);
         Assignable instruction_count_ififo_in = ififo_in.getAssignableBits(OFFSET_COUNT+WIDTH_COUNT-1, OFFSET_COUNT);
 
+        // Massacre (when enqueued)
+        box.new Event(
+                      new Object[] { ififo_out, "!`instruction_is_massacre("+ififo_out.getName()+")", isMassacreing.isFull() },
+                      new Action[] { ififo_out }
+                      );
+        box.new Event(
+                      new Object[] { ififo_out, "`instruction_is_massacre("+ififo_out.getName()+")" },
+                      new Action[] { ififo_out, isMassacreing.doDrain(), newMayProceed.doFill() }
+                      );
+        box.new Event(
+                      new Object[] { instr, ififo_in, "`instruction_is_massacre(instr)" },
+                      new Action[] { instr, ififo_in, new AssignAction(ififo_in, instr), isMassacreing.doFill(), ondeckFull.doDrain(), newMayProceed.doDrain() }
+                      );
+
         // Clog (must be first)
         box.new Event(
                       new Object[] { ififo_out, newMayProceed.isFull(), "`instruction_is_clog("+ififo_out.getName()+")" },
@@ -579,16 +593,6 @@ public class Generator {
                       new Action[] { instr, isClogged.doDrain(), newMayProceed.doFill()  }
                       );
 
-        // Massacre (when enqueued)
-        box.new Event(
-                      new Object[] { instr, "`instruction_is_massacre(instr)" },
-                      new Action[] { instr, isMassacreing.doFill(), newMayProceed.doFill() }
-                      );
-        box.new Event(
-                      new Object[] { ondeckFull.isFull(), "`instruction_is_massacre(ondeck)" },
-                      new Action[] { ondeckFull.doDrain(), isMassacreing.doDrain() }
-                      );
-
         // First Kill
         box.new Event(
                       new Object[] { instr,