cdaf598dc80b0e54e064ab380a576e3489266494
[fleet.git] / contrib / dcache-demo.fleet
1
2 // ships required in order to run this code
3 #ship debug        : Debug
4 #ship dscratch     : Dscratch
5 #ship fifo         : Fifo
6
7 // dumb configurations
8 debug.data:        [*] take, deliver;
9 dscratch.write_addr: [*] take, deliver;
10 dscratch.write_data: [*] take, deliver;
11 dscratch.read_addr:  [*] take, deliver;
12 fifo.in:           [*] take, deliver;
13
14 // addresses and values to initialize the dscratch with
15 1:  sendto dscratch.write_addr;
16 2:  sendto dscratch.write_addr;
17 3:  sendto dscratch.write_addr;
18 4:  sendto dscratch.write_addr;
19 11: sendto dscratch.write_data;
20 12: sendto dscratch.write_data;
21 13: sendto dscratch.write_data;
22 14: sendto dscratch.write_data;
23
24 // send write-completion tokens to the fifo output
25 dscratch.write_done:
26   [*] take, sendto fifo.out;
27
28 // when the write-completion tokens accumulate, unleash
29 // the read addresses
30 fifo.out:
31   [4] wait;
32   [4] take, sendto dscratch.read_addr;
33
34 // read addresses
35 4:  sendto fifo.in;
36 3:  sendto fifo.in;
37 2:  sendto fifo.in;
38 1:  sendto fifo.in;
39
40 // data read from dscratch goes to the debug ship
41 dscratch.read_data:
42   [*] take, sendto debug.data;