From: Luke Kenneth Casson Leighton Date: Wed, 27 Feb 2019 00:29:50 +0000 (+0000) Subject: clean up unit_test_single get_case based on how dual_add works X-Git-Tag: ls180-24jan2020~1826 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7cbd033401d511e83145d91ce0061eb2d750e9c8;p=ieee754fpu.git clean up unit_test_single get_case based on how dual_add works --- diff --git a/src/add/unit_test_single.py b/src/add/unit_test_single.py index ca5c14aa..609ff892 100644 --- a/src/add/unit_test_single.py +++ b/src/add/unit_test_single.py @@ -43,22 +43,28 @@ def get_case(dut, a, b): yield a_ack = (yield dut.in_a.ack) assert a_ack == 0 + + yield dut.in_a.stb.eq(0) + yield dut.in_b.v.eq(b) yield dut.in_b.stb.eq(1) + yield + yield b_ack = (yield dut.in_b.ack) assert b_ack == 0 + yield dut.in_b.stb.eq(0) + + yield dut.out_z.ack.eq(1) + while True: - yield out_z_stb = (yield dut.out_z.stb) if not out_z_stb: + yield continue out_z = yield dut.out_z.v yield dut.out_z.ack.eq(0) - yield dut.in_a.stb.eq(0) - yield dut.in_b.stb.eq(0) yield - yield dut.out_z.ack.eq(1) break return out_z