10170f7492b888e7bc1ccb8bc937713f8502f2c1
[fleet.git] / ships / Alu1.ship
1 ship: Alu1
2
3 == Ports ===========================================================
4 data  in:   in
5 data  in:   inOp
6
7 data  out:  out
8
9 == Constants ========================================================
10 == TeX ==============================================================
11 == Fleeterpreter ====================================================
12     public void service() {
13 /*
14         if (in.dataReadyForShip() && op.dataReadyForShip()) {
15             int data   = in.removeDataForShip();
16             int opcode = in.removeDataForShip();
17             switch(opcode) {
18                 case 0: out.addDataFromShip(-1 * data);      // NEG
19                     break;
20                 case 1: out.addDataFromShip(data+1);         // INC
21                     break;
22                 case 2: out.addDataFromShip(data-1);         // DEC
23                     break;
24                 case 3: out.addDataFromShip(Math.abs(data)); // ABS
25                     break;
26                 default: out.addDataFromShip(0);
27                     break;
28             }
29         }
30 */
31     }
32
33 == ArchSim ==============================================================
34 == FPGA ==============================================================
35
36 == Contributors =========================================================
37 Adam Megacz <megacz@cs.berkeley.edu>