b = dut.i.b
cr = full_cr_in
full_cr_out = dut.o.full_cr
- o = dut.o.o
+ o = dut.o.o.data
# setup random inputs
comb += [a.eq(AnyConst(64)),
comb += dut.i.ctx.op.eq(rec)
+ o_ok = Signal()
+
# Assert that op gets copied from the input to output
for rec_sig in rec.ports():
name = rec_sig.name
comb += Assert(o[4*i:4*i+4] == 0)
with m.Else(): # mfcrf
comb += Assert(o == cr)
+ comb += o_ok.eq(1)
+
with m.Case(InternalOp.OP_MCRF):
BF = xl_fields.BF[0:-1]
BFA = xl_fields.BFA[0:-1]
# select a or b as output
comb += Assert(o == Mux(cr_bit, a, b))
+ comb += o_ok.eq(1)
+
+ # check that data ok was only enabled when op actioned
+ comb += Assert(dut.o.o.ok == o_ok)
return m
# mfocrf
with m.If(move_one):
# output register RT
- comb += rt_o.eq(full_cr & mask)
+ comb += rt_o.data.eq(full_cr & mask)
# mfcrf
with m.Else():
# output register RT
- comb += rt_o.eq(full_cr)
+ comb += rt_o.data.eq(full_cr)
+ comb += rt_o.ok.eq(1) # indicate "INT reg changed"
# ##### isel #####
with m.Case(InternalOp.OP_ISEL):
# select a or b as output
comb += rt_o.eq(Mux(cr_bit, a, b))
+ comb += rt_o.ok.eq(1) # indicate "INT reg changed"
comb += self.o.ctx.eq(self.i.ctx)