wait a little for wr.rel to activate if wrmask is active
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 6 Jun 2020 18:11:54 +0000 (19:11 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 6 Jun 2020 18:11:54 +0000 (19:11 +0100)
src/soc/fu/compunits/test/test_compunit.py

index d35ad27d848331a11646a44555671bcf1390c823..b32f43da748f2ac0b999eaebfbca3f862aec6df3 100644 (file)
@@ -74,6 +74,16 @@ def set_operand(cu, dec2, sim):
 
 def get_cu_outputs(cu, code):
     res = {}
+    wrmask = yield cu.wrmask
+    print ("get_cu_outputs", cu.n_dst, wrmask)
+    if not wrmask: # no point waiting (however really should doublecheck wr.rel)
+        return {}
+    # wait for at least one result
+    while True:
+        wr_rel_o = yield cu.wr.rel
+        if wr_rel_o:
+            break
+        yield
     for i in range(cu.n_dst):
         wr_rel_o = yield cu.wr.rel[i]
         if wr_rel_o: