also set so only if OE requires it
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 9 Jul 2020 21:08:55 +0000 (22:08 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 9 Jul 2020 21:08:55 +0000 (22:08 +0100)
src/soc/fu/alu/output_stage.py

index 0080ca54dfdf205f378dd243bb96aec3ed54e7a2..58d9708da2ac37cc1b74ccc5faae2342ade872b3 100644 (file)
@@ -22,15 +22,14 @@ class ALUOutputStage(CommonOutputStage):
         op = self.i.ctx.op
         xer_so_i, xer_ov_i = self.i.xer_so.data, self.i.xer_ov.data
 
-        # XXX see https://bugs.libre-soc.org/show_bug.cgi?id=319#c5
-        comb += self.so.eq(xer_so_i[0] | xer_ov_i[0]) # SO
-
         # copy overflow and sticky-overflow.  indicate to CompALU if they
         # are actually required (oe enabled/set) otherwise the CompALU
         # can (will) ignore them.
         oe = Signal(reset_less=True)
         comb += oe.eq(op.oe.oe & op.oe.oe_ok)
         with m.If(oe):
+            # XXX see https://bugs.libre-soc.org/show_bug.cgi?id=319#c5
+            comb += self.so.eq(xer_so_i[0] | xer_ov_i[0]) # SO
             comb += self.o.xer_so.data.eq(self.so)
             comb += self.o.xer_so.ok.eq(1)
             comb += self.o.xer_ov.data.eq(xer_ov_i)