MulOutputData was only 64-bit output not 128-bit
[soc.git] / src / soc / fu / mul / pipe_data.py
index bb77c5ce2988ddad420006b3005b6548cefc2978..a5047be722cc36559018cfd9485c7b7b82ce70ac 100644 (file)
@@ -1,5 +1,5 @@
 from soc.fu.mul.mul_input_record import CompMULOpSubset
-from soc.fu.pipe_data import IntegerData, CommonPipeSpec
+from soc.fu.pipe_data import FUBaseData, CommonPipeSpec
 from soc.fu.div.pipe_data import DivInputData, DivMulOutputData
 from nmigen import Signal
 
@@ -14,9 +14,7 @@ class MulIntermediateData(DivInputData):
         self.data.append(self.neg_res32)
 
 
-class MulOutputData(IntegerData):
-    regspec = [('INT', 'o', '0:128'),
-               ('XER', 'xer_so', '32')] # XER bit 32: SO
+class MulOutputData(FUBaseData):
     def __init__(self, pspec):
         super().__init__(pspec, False) # still input style
 
@@ -25,7 +23,12 @@ class MulOutputData(IntegerData):
         self.data.append(self.neg_res)
         self.data.append(self.neg_res32)
 
+    @property
+    def regspec(self):
+        return [('INT', 'o', "0:%d" % (self.pspec.XLEN*2)), # 2xXLEN
+               ('XER', 'xer_so', '32')] # XER bit 32: SO
+
 
 class MulPipeSpec(CommonPipeSpec):
-    regspec = (DivInputData.regspec, DivMulOutputData.regspec)
+    regspecklses = (DivInputData, DivMulOutputData)
     opsubsetkls = CompMULOpSubset