3 == Ports ===========================================================
16 == Constants ========================================================
17 == TeX ==============================================================
19 == Fleeterpreter ====================================================
21 Bitfifo.BitStorage bits = new Bitfifo.BitStorage(74);
22 public void service() {
23 if (box_in1.dataReadyForShip() &&
24 box_in2.dataReadyForShip() &&
25 box_in3.dataReadyForShip() &&
27 box_out1.readyForDataFromShip() &&
28 box_out2.readyForDataFromShip() &&
29 box_out3.readyForDataFromShip()) {
30 long v1 = box_in1.removeDataForShip();
31 long v2 = box_in2.removeDataForShip();
32 long v3 = box_in3.removeDataForShip();
37 o3 = ((v2 & 0x1L) == 0) ? 0 : v1;
39 o1 = ((v1 & v2) | (v2 & v3) | (v1 & v3))/* << 1*/;
40 o2 = (v1 ^ v2 ^ v3) >> 1;
42 bits.add((v1 ^ v2 ^ v3) & 0x1L, 1);
43 System.out.println("size is now " + bits.size());
45 box_out1.addDataFromShip(o1);
46 box_out2.addDataFromShip(o2);
47 box_out3.addDataFromShip(o3);
49 // This should be removed
51 for (int i = 0; i < 37; i++) {
55 o1 = ((v1 & v2) | (v2 & v3) | (v1 & v3))/* << 1*/;
56 o2 = (v1 ^ v2 ^ v3) >> 1;
58 bits.add((v1 ^ v2 ^ v3) & 0x1L, 1);
59 System.out.println("size is now " + bits.size());
64 if (box_outBits.readyForDataFromShip() &&
66 box_outBits.addDataFromShip(bits.get(37));
70 == FleetSim ==============================================================
72 == FPGA ==============================================================
75 reg [(`DATAWIDTH-1):0] a;
77 reg [(`DATAWIDTH-1):0] b;
79 reg [(`DATAWIDTH-1):0] c;
83 always @(posedge clk) begin
85 `onwrite(out1_r, out1_a) have_out1 <= 0; end
87 end else if (have_out2) begin
88 `onwrite(out2_r, out2_a) have_out2 <= 0; end
90 end else if (!have_out1 && !have_out2) begin
92 `onread(in1_r, in1_a) have_a <= 1; a <= in1_d; end
95 `onread(in2_r, in2_a) have_b <= 1; b <= in2_d; end
98 `onread(in3_r, in3_a) have_c <= 1; c <= in3_d; end
101 if (have_a && have_b && have_c) begin
102 out1_d <= { { ((a & b) | (b & c) | (a & c)) } , 1'b0 };
114 == Test ========================================================================
121 debug.in: [*] take, deliver;
124 == Contributors =========================================================
125 Amir Kamil <kamil@cs.berkeley.edu>
126 Adam Megacz <megacz@cs.berkeley.edu>