-
- # op requests inversion of the output...
- o = Signal.like(self.i.o)
- if hasattr(op, "invert_out"): # ... optionally
- with m.If(op.invert_out):
- comb += o.eq(~self.i.o.data)
+ # ok so there are two different ways this goes:
+ # (1) something involving XER ov in which case so gets modified
+ # and that means we need the modified version of so in CR0
+ # (2) something that does *not* have XER ov, in which case so
+ # has been pass-through just to get it into CR0
+ # in case (1) we don't *have* an xer_so output so put xer_so *input*
+ # into CR0.
+ xer_so_i = self.i.xer_so.data[0]
+ if hasattr(self.o, "xer_so"):
+ xer_so_o = self.o.xer_so.data[0]
+ so = Signal(reset_less=True)
+ oe = Signal(reset_less=True)
+ comb += oe.eq(op.oe.oe & op.oe.ok)
+ with m.If(oe):
+ comb += so.eq(xer_so_o)