NCC clean newCell
[fleet.git] / tests / multiply.test-
1 #skip
2 #ship alu3    : Alu3
3 #ship lut3    : Lut3
4 #ship bitfifo : BitFifo
5 #ship debug   : Debug
6 #ship fifo    : Fifo
7 #ship rotator : Rotator
8
9 #expect -66848683
10 #expect 18682
11
12 // 0:  100100100111110000000
13 // sel 011110100001001000000
14 // 1:  111000101000011000011
15 // r:  111000100110111000000
16
17 bitfifo.in:
18   deliver;      // deliver a junk word
19   set word= 10000;
20   set ilc=37; deliver; // deliver it 37 times (once per bit)
21   set word= 0;
22   set ilc=38; deliver; // deliver it 37 times
23
24 // insert bits in lsb order
25 bitfifo.inOp:
26   set word= BitFifo.inOp[lsbFirst,take=37];
27   set ilc=*;  deliver;
28
29 // toss out 37 bits, take one, repeat.  sign extend the result
30 bitfifo.outOp:
31   set word= BitFifo.outOp[drop=37,take=1,signExtend];
32   set ilc=*;  deliver;
33
34 bitfifo.out:        set ilc=*;  recv token, take, send to lut3.in2;
35 lut3.in2:           set ilc=4; send token to bitfifo.out;
36                     set ilc=63;
37                     take, deliver, send token to bitfifo.out;
38                     set ilc=11;
39                     take, deliver, send token to bitfifo.out;
40
41 // mux on second input
42 lut3.inLut:         set word= 226;
43                     set ilc=*;  deliver;
44
45 lut3.in1:           set word= 18683;
46                     set ilc=37; deliver;
47                     set word= 0;
48                     set ilc=37; deliver;
49
50 lut3.in3:           set word= 12000;
51                     set ilc=37; deliver;
52                     set word= 0;
53                     set ilc=37; deliver;
54
55 lut3.out:           set ilc=*;  recv token, take, send to alu3.in2;
56
57 alu3.in1:      set word= 0; deliver; set ilc=*;  take, deliver;
58 alu3.in2:      send token to lut3.out; set ilc=*;  take, deliver, send token to lut3.out;
59 alu3.in3:      set word= 0; deliver; set ilc=*;  take, deliver;
60 alu3.outBits:  set ilc=*;  take, send to debug.in;
61
62 alu3.out1:     set ilc=*;  take, send to alu3.in1;
63 alu3.out2:     set ilc=*;  take, send to alu3.in3;
64
65 debug.in:      set ilc=*;  take, deliver;
66