m.d.comb += wr_any.eq(self.wr.go.bool())
m.d.comb += req_done.eq(wr_any & ~self.alu.n.ready_i & \
((req_l.q & self.wrmask) == 0))
+ # argh, complicated hack: if there are no regs to write,
+ # instead of waiting for regs that are never going to happen,
+ # we indicate "done" when the ALU is "done"
+ with m.If((self.wrmask == 0) & \
+ self.alu.n.ready_i & self.alu.n.valid_o & self.busy_o):
+ m.d.comb += req_done.eq(1)
# shadow/go_die
reset = Signal(reset_less=True)
wr_rel_o = yield cu.wr.rel
print ("before inputs, rd_rel, wr_rel: ",
bin(rd_rel_o), bin(wr_rel_o))
+ assert wr_rel_o == 0, "wr.rel %s must be zero. "\
+ "previous instr not written all regs\n"\
+ "respec %s" % \
+ (bin(wr_rel_o), cu.rwid[1])
yield from set_cu_inputs(cu, inp)
yield
rd_rel_o = yield cu.rd.rel
yield from sim.call(opname)
index = sim.pc.CIA.value//4
+ yield Settle()
# get all outputs (one by one, just "because")
res = yield from get_cu_outputs(cu, code)