From 7cbd033401d511e83145d91ce0061eb2d750e9c8 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 27 Feb 2019 00:29:50 +0000 Subject: [PATCH] clean up unit_test_single get_case based on how dual_add works --- src/add/unit_test_single.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 -- 2.30.2