From: adam Date: Mon, 26 Feb 2007 11:55:59 +0000 (+0100) Subject: Alu3 bugfixes X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ad838db4c75aab37276a50bc52effa7e6d45d87c;p=fleet.git Alu3 bugfixes --- diff --git a/ships/Alu3.ship b/ships/Alu3.ship index f88fbb8..9a9d95b 100644 --- a/ships/Alu3.ship +++ b/ships/Alu3.ship @@ -50,12 +50,11 @@ public void service() { always @(posedge clk) begin if (have_out1) begin `onwrite(out1_r, out1_a) have_out1 <= 0; end - end - if (have_out2) begin + + end else if (have_out2) begin `onwrite(out2_r, out2_a) have_out2 <= 0; end - end - if (!have_out1 && !have_out2) begin + end else if (!have_out1 && !have_out2) begin if (!have_a) begin `onread(in1_r, in1_a) have_a <= 1; a <= in1_d; end end @@ -67,8 +66,11 @@ public void service() { end if (have_a && have_b && have_c) begin - out1_d <= ((a & b) | (b & c) | (a & c)) << 1; + out1_d <= { { ((a & b) | (b & c) | (a & c)) } , 1'b0 }; out2_d <= a ^ b ^ c; + have_a <= 0; + have_b <= 0; + have_c <= 0; have_out1 <= 1; have_out2 <= 1; end diff --git a/tests/alu3/alu3-simple-test.fleet b/tests/alu3/alu3-simple-test.fleet index 198fa9b..f6778e7 100644 --- a/tests/alu3/alu3-simple-test.fleet +++ b/tests/alu3/alu3-simple-test.fleet @@ -15,13 +15,13 @@ alu3.in3: [*] take, deliver; alu2.in1: [*] take, deliver; alu2.in2: [*] take, deliver; -alu2.inOp: [*] take, deliver; +alu2.inOp: take; [*] deliver; -alu3.out1: take, sendto alu2.in1; -alu3.out2: take, sendto alu2.in2; +alu3.out1: [*] take, sendto alu2.in1; +alu3.out2: [*] take, sendto alu2.in2; Alu2.ADD: sendto alu2.inOp; -alu2.out: take, sendto debug.in; +alu2.out: [*] take, sendto debug.in; debug.in: [*] take, deliver;