code-comments for LDSTCompUnit
[soc.git] / src / soc / fu / ldst / pipe_data.py
1 from soc.fu.ldst.ldst_input_record import CompLDSTOpSubset
2 from soc.fu.pipe_data import FUBaseData, CommonPipeSpec
3 from openpower.exceptions import LDSTException
4
5
6 class LDSTInputData(FUBaseData):
7 regspec = [('INT', 'ra', '0:63'), # RA
8 ('INT', 'rb', '0:63'), # RB/immediate
9 ('INT', 'rc', '0:63'), # RC
10 # XXX TODO, later ('XER', 'xer_so', '32') # XER bit 32: SO
11 ]
12 def __init__(self, pspec):
13 super().__init__(pspec, False)
14 # convenience
15 self.rs = self.rc
16
17
18 class LDSTOutputData(FUBaseData):
19 # these need to tie up with LDSTCompUnit.get_out index numbers
20 # LDSTCompUnit is unusual in that it's non-standard to RegSpecAPI
21 regspec = [('INT', 'o', '0:63'), # RT
22 ('INT', 'o1', '0:63'), # RA (effective address, update mode)
23 # TODO, later ('CR', 'cr_a', '0:3'),
24 # TODO, later ('XER', 'xer_so', '32')
25 ]
26 def __init__(self, pspec):
27 super().__init__(pspec, True, LDSTException)
28 # convenience
29 self.cr0, self.ea = self.cr_a, self.o1
30
31
32 class LDSTPipeSpec(CommonPipeSpec):
33 regspec = (LDSTInputData.regspec, LDSTOutputData.regspec)
34 opsubsetkls = CompLDSTOpSubset