argh - need to zero the src_i input after "Read" is actioned
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 1 Jun 2020 17:57:35 +0000 (18:57 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 1 Jun 2020 17:57:35 +0000 (18:57 +0100)
src/soc/fu/compunits/test/test_compunit.py

index 9970c2db24900d66f618ffedb25ee1872d5470a6..08a704dc3165dfe746dc37b543118c93d8a88187 100644 (file)
@@ -33,6 +33,7 @@ def set_cu_input(cu, idx, data):
         print ("rd_rel %d wait HI" % idx, rd_rel_o)
         yield
     yield cu.rd.go[idx].eq(0)
+    yield cu.src_i[idx].eq(0)
 
 
 def get_cu_output(cu, idx, code):
@@ -168,6 +169,11 @@ class TestRunner(FHDLTestCase):
                         fname = find_ok(wrok.fields)
                         yield getattr(wrok, fname).eq(0)
 
+                    # first set inputs to zero
+                    for idx in range(cu.n_src):
+                        cu_in = cu.get_in(idx)
+                        yield cu_in.eq(0)
+
                     # set inputs into CU
                     rd_rel_o = yield cu.rd.rel
                     wr_rel_o = yield cu.wr.rel