update to AM15
[fleet.git] / contrib / demo.fleet
1 #include "contrib/demo.ships"
2
3 //22: sendto debug.data
4 //22: sendto debug.data
5 //alu1.out: ack debug.data
6
7 299:        sendto alu2.a
8 120:        sendto alu2.b
9 0:          sendto alu2.op
10 alu2.out:   take, sendto debug.data
11
12
13 //22: sendto alu3.b
14
15 // route the "max" output to the demux, and that to either
16 // the finished-value output (debug.data) or the subtractor
17 //sort.max: [*] take, sendto demux1.in
18 //                           demux1.false: [*] take, sendto debug.data
19 //                           demux1.true:  [*] take, sendto alu.a
20 //
21 //// route the "min" value to the demux selector to decide if  we are
22 //// done; also send copies to the ALU and the secondary sort input
23 //sort.min: [*] take, sendto dup3.in
24 //                           dup3.a:  [*] take, sendto demux1.select
25 //                           dup3.b:  [*] take, sendto alu.b
26 //                           dup3.c:  [*] take, sendto sort.b
27 //
28 //// "plug up" the ALU opcode input with a "1" (subtraction)
29 //1: sendto alu.op
30 //          alu.op: take [*] accept
31 //
32 //// route all data emerging from the ALU back to the primary sort input
33 //alu.out: [*] take, sendto sort.a
34 //
35 //// all other inputs are in default mode
36 //sort.a:        [*] take, accept
37 //sort.b:        [*] take, accept
38 //alu.a:         [*] take, accept
39 //alu.b:         [*] take, accept
40 //dup3.in:       [*] take, accept
41 //demux1.select: [*] take, accept
42 //demux1.in:     [*] take, accept
43 //
44 //// gcd(377,221)=13  (we hope!)
45 ////377: sendto sort.a
46 ////221: sendto sort.b
47 //