1 from soc
.fu
.bitmanip
.input_record
import CompBitManipOpSubset
2 from soc
.fu
.pipe_data
import FUBaseData
, CommonPipeSpec
3 from soc
.fu
.alu
.pipe_data
import ALUOutputData
6 class BitManipInputData(FUBaseData
):
8 ('INT', 'ra', '0:63'), # RA
9 ('INT', 'rb', '0:63'), # RB
10 ('INT', 'rc', '0:63'), # RC
11 ('XER', 'xer_so', '32'), # XER bit 32: SO
14 def __init__(self
, pspec
):
15 super().__init
__(pspec
, False)
18 # input to bitmanip final stage (common output)
19 class BitManipOutputData(FUBaseData
):
21 ('INT', 'o', '0:63'), # RT
22 ('CR', 'cr_a', '0:3'),
23 ('XER', 'xer_so', '32'), # bit0: so
26 def __init__(self
, pspec
):
27 super().__init
__(pspec
, True)
32 # output from bitmanip final stage (common output) - note that XER.so
33 # is *not* included (the only reason it's in the input is because of CR0)
34 class BitManipOutputDataFinal(FUBaseData
):
35 regspec
= [('INT', 'o', '0:63'), # RT
36 ('CR', 'cr_a', '0:3'),
39 def __init__(self
, pspec
):
40 super().__init
__(pspec
, True)
45 class BitManipPipeSpec(CommonPipeSpec
):
46 regspec
= (BitManipInputData
.regspec
, BitManipOutputDataFinal
.regspec
)
47 opsubsetkls
= CompBitManipOpSubset