From 7a0c19316b04e060d2a17e5b30d8d7f7eca1b496 Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 22 Feb 2007 16:32:16 +0100 Subject: [PATCH 1/1] update tests for transition from Icache to Memory --- .../instruction-dispatch.fleet} | 6 +-- tests/memory/memory-test.fleet | 44 ++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) rename tests/{icache/icache-test.fleet => memory/instruction-dispatch.fleet} (83%) create mode 100644 tests/memory/memory-test.fleet diff --git a/tests/icache/icache-test.fleet b/tests/memory/instruction-dispatch.fleet similarity index 83% rename from tests/icache/icache-test.fleet rename to tests/memory/instruction-dispatch.fleet index ff3d894..fd2d6dc 100644 --- a/tests/icache/icache-test.fleet +++ b/tests/memory/instruction-dispatch.fleet @@ -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 index 0000000..5a08f8d --- /dev/null +++ b/tests/memory/memory-test.fleet @@ -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; + -- 1.7.10.4