DIV and other long pipelines only set wrmask when a result is available
the previous test, "is wrmask zero if so exit" was therefore reading
invalid data.
it was a matter of coincidence that all other compunit tests were only
one stage long that the wrmask *happened* to be valid
def get_cu_outputs(cu, code):
res = {}
+ # wait for pipeline to indicate valid. this because for long
+ # pipelines (or FSMs) the write mask is only valid at that time.
+ while True:
+ valid_o = yield cu.alu.n.valid_o
+ if valid_o:
+ break
+ yield
wrmask = yield cu.wrmask
wr_rel_o = yield cu.wr.rel
print("get_cu_outputs", cu.n_dst, wrmask, wr_rel_o)