1 from nmigen
import Signal
, Const
, Cat
2 from ieee754
.fpcommon
.getop
import FPPipeContext
3 from soc
.fu
.pipe_data
import IntegerData
4 from soc
.decoder
.power_decoder2
import Data
5 from soc
.fu
.alu
.pipe_data
import ALUOutputData
, CommonPipeSpec
6 from soc
.fu
.logical
.logical_input_record
import CompLogicalOpSubset
9 class LogicalInputData(IntegerData
):
10 regspec
= [('INT', 'ra', '0:63'), # RA
11 ('INT', 'rb', '0:63'), # RB/immediate
13 def __init__(self
, pspec
):
14 super().__init
__(pspec
, False)
16 self
.a
, self
.b
= self
.ra
, self
.rb
19 class LogicalOutputData(IntegerData
):
20 regspec
= [('INT', 'o', '0:63'), # RT
21 ('CR', 'cr_a', '0:3'),
22 ('XER', 'xer_ca', '34,45'), # bit0: ca, bit1: ca32
24 def __init__(self
, pspec
):
25 super().__init
__(pspec
, True)
30 class LogicalPipeSpec(CommonPipeSpec
):
31 regspec
= (LogicalInputData
.regspec
, LogicalOutputData
.regspec
)
32 opsubsetkls
= CompLogicalOpSubset