convert from public static functions/properties for regspecs
[soc.git] / src / soc / fu / ldst / pipe_data.py
index 8200c994481255d03fb330059ee8e19e7ca38d0c..caf8bf5a15fca0dc01692225738ca70b00ae60bf 100644 (file)
@@ -1,12 +1,15 @@
 from soc.fu.ldst.ldst_input_record import CompLDSTOpSubset
-from soc.fu.pipe_data import IntegerData, CommonPipeSpec
+from soc.fu.pipe_data import FUBaseData, CommonPipeSpec
+from openpower.exceptions import LDSTException
 
+# XXX NOTE: neither of these are actually used at present other than regspecs
+# TODO: make use of them in LDSTCompUnit (somehow)
 
-class LDSTInputData(IntegerData):
+class LDSTInputData(FUBaseData):
     regspec = [('INT', 'ra', '0:63'), # RA
                ('INT', 'rb', '0:63'), # RB/immediate
                ('INT', 'rc', '0:63'), # RC
-               ('XER', 'xer_so', '32') # XER bit 32: SO
+               # XXX TODO, later ('XER', 'xer_so', '32') # XER bit 32: SO
                ]
     def __init__(self, pspec):
         super().__init__(pspec, False)
@@ -14,17 +17,20 @@ class LDSTInputData(IntegerData):
         self.rs = self.rc
 
 
-class LDSTOutputData(IntegerData):
+class LDSTOutputData(FUBaseData):
+    # these need to tie up with LDSTCompUnit.get_out index numbers
+    # LDSTCompUnit is unusual in that it's non-standard to RegSpecAPI
     regspec = [('INT', 'o', '0:63'),   # RT
                ('INT', 'o1', '0:63'),  # RA (effective address, update mode)
                ('CR', 'cr_a', '0:3'),
-               ('XER', 'xer_so', '32')]
+               # TODO, later ('XER', 'xer_so', '32')
+                ]
     def __init__(self, pspec):
-        super().__init__(pspec, True)
+        super().__init__(pspec, True, LDSTException)
         # convenience
         self.cr0, self.ea = self.cr_a, self.o1
 
 
 class LDSTPipeSpec(CommonPipeSpec):
-    regspec = (LDSTInputData.regspec, LDSTOutputData.regspec)
+    regspecklses = (LDSTInputData, LDSTOutputData)
     opsubsetkls = CompLDSTOpSubset