Allow the formal engine to perform a same-cycle result in the ALU
[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 # XXX NOTE: neither of these are actually used at present other than regspecs
6 # TODO: make use of them in LDSTCompUnit (somehow)
7
8 class LDSTInputData(FUBaseData):
9 regspec = [('INT', 'ra', '0:63'), # RA
10 ('INT', 'rb', '0:63'), # RB/immediate
11 ('INT', 'rc', '0:63'), # RC
12 # XXX TODO, later ('XER', 'xer_so', '32') # XER bit 32: SO
13 ]
14 def __init__(self, pspec):
15 super().__init__(pspec, False)
16 # convenience
17 self.rs = self.rc
18
19
20 class LDSTOutputData(FUBaseData):
21 # these need to tie up with LDSTCompUnit.get_out index numbers
22 # LDSTCompUnit is unusual in that it's non-standard to RegSpecAPI
23 regspec = [('INT', 'o', '0:63'), # RT
24 ('INT', 'o1', '0:63'), # RA (effective address, update mode)
25 ('CR', 'cr_a', '0:3'),
26 # TODO, later ('XER', 'xer_so', '32')
27 ]
28 def __init__(self, pspec):
29 super().__init__(pspec, True, LDSTException)
30 # convenience
31 self.cr0, self.ea = self.cr_a, self.o1
32
33
34 class LDSTPipeSpec(CommonPipeSpec):
35 regspecklses = (LDSTInputData, LDSTOutputData)
36 opsubsetkls = CompLDSTOpSubset