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
5 # XXX NOTE: neither of these are actually used at present other than regspecs
6 # TODO: make use of them in LDSTCompUnit (somehow)
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 ('STATE', 'msr', '0:63'), # MSR
15 def __init__(self
, pspec
):
16 super().__init
__(pspec
, False)
21 class LDSTOutputData(FUBaseData
):
22 # these need to tie up with LDSTCompUnit.get_out index numbers
23 # LDSTCompUnit is unusual in that it's non-standard to RegSpecAPI
24 regspec
= [('INT', 'o', '0:63'), # RT
25 ('INT', 'o1', '0:63'), # RA (effective address, update mode)
26 # TODO, later ('CR', 'cr_a', '0:3'),
27 # TODO, later ('XER', 'xer_so', '32')
29 def __init__(self
, pspec
):
30 super().__init
__(pspec
, True, LDSTException
)
32 self
.cr0
, self
.ea
= self
.cr_a
, self
.o1
35 class LDSTPipeSpec(CommonPipeSpec
):
36 regspec
= (LDSTInputData
.regspec
, LDSTOutputData
.regspec
)
37 opsubsetkls
= CompLDSTOpSubset