update tests for transition from Icache to Memory
authoradam <adam@megacz.com>
Thu, 22 Feb 2007 15:32:16 +0000 (16:32 +0100)
committeradam <adam@megacz.com>
Thu, 22 Feb 2007 15:32:16 +0000 (16:32 +0100)
tests/memory/instruction-dispatch.fleet [moved from tests/icache/icache-test.fleet with 83% similarity]
tests/memory/memory-test.fleet [new file with mode: 0644]

similarity index 83%
rename from tests/icache/icache-test.fleet
rename to tests/memory/instruction-dispatch.fleet
index ff3d894..fd2d6dc 100644 (file)
@@ -5,13 +5,13 @@
 
 // ships required in order to run this code
 #ship debug          : Debug
-#ship iscratch       : Iscratch
+#ship memory         : Memory
 
 // instructions not in any codebag are part of the "root codebag"
 // which is dispatched when the code is loaded
 
-BOB:              sendto iscratch.inCBD;
-iscratch.inCBD:   [*] take, deliver;
+BOB:              sendto memory.inCBD;
+memory.inCBD:     [*] take, deliver;
 debug.in:         [*] take, deliver;
 
 
diff --git a/tests/memory/memory-test.fleet b/tests/memory/memory-test.fleet
new file mode 100644 (file)
index 0000000..5a08f8d
--- /dev/null
@@ -0,0 +1,44 @@
+// output ///////////////////////////////////////////////////////////////////
+#expect 14
+#expect 13
+#expect 12
+#expect 11
+
+// program //////////////////////////////////////////////////////////////////
+#ship debug        : Debug
+#ship memory       : Memory
+#ship fifo         : Fifo
+
+// dumb configurations
+debug.in:        [*] take, deliver;
+memory.inAddr:   [*] take, deliver;
+memory.inData:   [*] take, deliver;
+fifo.in:         [*] take, deliver;
+
+// addresses and values to initialize the memory with
+1:  sendto memory.inAddr.write;
+2:  sendto memory.inAddr.write;
+3:  sendto memory.inAddr.write;
+4:  sendto memory.inAddr.write;
+11: sendto memory.inData;
+12: sendto memory.inData;
+13: sendto memory.inData;
+14: sendto memory.inData;
+
+// send write-completion tokens to the fifo output
+memory.out:
+  [4] take, notify fifo.out;
+  [*] take, sendto debug.in;
+
+// when the write-completion tokens accumulate, unleash
+// the read addresses
+fifo.out:
+  [4] wait;
+  [4] take, sendto memory.inAddr.read;
+
+// read addresses
+4:  sendto fifo.in;
+3:  sendto fifo.in;
+2:  sendto fifo.in;
+1:  sendto fifo.in;
+