1 from soc
.fu
.pipe_data
import FUBaseData
2 from soc
.fu
.alu
.pipe_data
import ALUOutputData
, CommonPipeSpec
3 from soc
.fu
.logical
.logical_input_record
import CompLogicalOpSubset
6 # input (and output) for logical initial stage (common input)
7 class LogicalInputData(FUBaseData
):
8 def __init__(self
, pspec
):
9 super().__init
__(pspec
, False)
11 self
.a
, self
.b
= self
.ra
, self
.rb
15 return [('INT', 'ra', self
.intrange
), # RA
16 ('INT', 'rb', self
.intrange
), # RB/immediate
17 ('XER', 'xer_so', '32'), # bit0: so
20 # input to logical final stage (common output)
21 class LogicalOutputData(FUBaseData
):
22 def __init__(self
, pspec
):
23 super().__init
__(pspec
, True)
29 return [('INT', 'o', self
.intrange
),
30 ('CR', 'cr_a', '0:3'),
31 ('XER', 'xer_so', '32'), # bit0: so
35 # output from logical final stage (common output) - note that XER.so
36 # is *not* included (the only reason it's in the input is because of CR0)
37 class LogicalOutputDataFinal(FUBaseData
):
38 def __init__(self
, pspec
):
39 super().__init
__(pspec
, True)
44 return [('INT', 'o', self
.intrange
),
45 ('CR', 'cr_a', '0:3'),
49 class LogicalPipeSpec(CommonPipeSpec
):
50 regspecklses
= (LogicalInputData
, LogicalOutputDataFinal
)
51 opsubsetkls
= CompLogicalOpSubset