special test for mul hw to cope with ignoring OE flag
[soc.git] / src / soc / decoder / power_decoder2.py
index 20c40075617bae978113b3fd8259552c3800afc0..5ad8a89fabebfcf3fbd1d5da815f779edfb51cd9 100644 (file)
@@ -429,12 +429,18 @@ class DecodeOE(Elaboratable):
     def elaborate(self, platform):
         m = Module()
         comb = m.d.comb
+        op = self.dec.op
 
-        # select OE bit out field
-        with m.Switch(self.sel_in):
-            with m.Case(RC.RC):
-                comb += self.oe_out.data.eq(self.dec.OE)
-                comb += self.oe_out.ok.eq(1)
+        with m.If((op.internal_op == InternalOp.OP_MUL_H64) |
+                  (op.internal_op == InternalOp.OP_MUL_H32)):
+            # mulhw, mulhwu, mulhd, mulhdu - these *ignore* OE
+            pass
+        with m.Else():
+            # select OE bit out field
+            with m.Switch(self.sel_in):
+                with m.Case(RC.RC):
+                    comb += self.oe_out.data.eq(self.dec.OE)
+                    comb += self.oe_out.ok.eq(1)
 
         return m