From 147922a1c102af8d08dc2e5fe2f118b859df663a Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 6 Jun 2020 19:11:54 +0100 Subject: [PATCH] wait a little for wr.rel to activate if wrmask is active --- src/soc/fu/compunits/test/test_compunit.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/soc/fu/compunits/test/test_compunit.py b/src/soc/fu/compunits/test/test_compunit.py index d35ad27d..b32f43da 100644 --- a/src/soc/fu/compunits/test/test_compunit.py +++ b/src/soc/fu/compunits/test/test_compunit.py @@ -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: -- 2.30.2