From: Luke Kenneth Casson Leighton Date: Wed, 27 Feb 2019 00:12:27 +0000 (+0000) Subject: clear STB immediately after setting, stops add1 repeating computation X-Git-Tag: ls180-24jan2020~1827 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=262f37d15b93a473d8de4b31c0297bb130473bfd;p=ieee754fpu.git clear STB immediately after setting, stops add1 repeating computation --- diff --git a/src/add/fpbase.py b/src/add/fpbase.py index 26528f62..10997be4 100644 --- a/src/add/fpbase.py +++ b/src/add/fpbase.py @@ -347,8 +347,8 @@ class FPOp: if extra is not None: stb = stb & extra return [self.v.eq(in_op.v), # receive value - self.stb.eq(~stb), # receive STB - in_op.ack.eq(~self.ack), # send ACK + self.stb.eq(stb), # receive STB + in_op.ack.eq(self.ack), # send ACK ] def chain_from(self, in_op, extra=None): diff --git a/src/add/test_dual.py b/src/add/test_dual.py index 6f9d8c8e..15f5c762 100644 --- a/src/add/test_dual.py +++ b/src/add/test_dual.py @@ -11,6 +11,8 @@ def get_case(dut, a, b, c): a_ack = (yield dut.a.ack) assert a_ack == 0 + yield dut.a.stb.eq(0) + yield dut.b.v.eq(b) yield dut.b.stb.eq(1) yield @@ -18,6 +20,8 @@ def get_case(dut, a, b, c): b_ack = (yield dut.b.ack) assert b_ack == 0 + yield dut.b.stb.eq(0) + yield dut.c.v.eq(c) yield dut.c.stb.eq(1) yield @@ -25,12 +29,9 @@ def get_case(dut, a, b, c): c_ack = (yield dut.c.ack) assert c_ack == 0 - while True: - out_z_stb = (yield dut.int_stb) - if not out_z_stb: - yield - continue - break + yield dut.c.stb.eq(0) + + yield dut.z.ack.eq(1) while True: out_z_stb = (yield dut.z.stb) @@ -41,12 +42,6 @@ def get_case(dut, a, b, c): out_z = yield dut.z.v yield dut.z.ack.eq(0) - yield dut.a.stb.eq(0) - yield dut.b.stb.eq(0) - yield dut.c.stb.eq(0) - yield - yield dut.z.ack.eq(1) - yield break return out_z