X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fsoc%2Ffu%2Flogical%2Fpipe_data.py;h=3d9077aaf1721b0aea1bbc65c29023e6d8638164;hb=HEAD;hp=16cd3f5cae74ca683b3d1a26a43aa28cce09934e;hpb=87561eb392c5c7cc0cea1bc6ec6012209b9c94fb;p=soc.git diff --git a/src/soc/fu/logical/pipe_data.py b/src/soc/fu/logical/pipe_data.py index 16cd3f5c..359a2a59 100644 --- a/src/soc/fu/logical/pipe_data.py +++ b/src/soc/fu/logical/pipe_data.py @@ -1,32 +1,51 @@ -from nmigen import Signal, Const, Cat -from ieee754.fpcommon.getop import FPPipeContext -from soc.fu.pipe_data import IntegerData -from soc.decoder.power_decoder2 import Data +from soc.fu.pipe_data import FUBaseData from soc.fu.alu.pipe_data import ALUOutputData, CommonPipeSpec from soc.fu.logical.logical_input_record import CompLogicalOpSubset -class LogicalInputData(IntegerData): - regspec = [('INT', 'ra', '0:63'), # RA - ('INT', 'rb', '0:63'), # RB/immediate - ] +# input (and output) for logical initial stage (common input) +class LogicalInputData(FUBaseData): def __init__(self, pspec): super().__init__(pspec, False) # convenience self.a, self.b = self.ra, self.rb + @property + def regspec(self): + return [('INT', 'ra', self.intrange), # RA + ('INT', 'rb', self.intrange), # RB/immediate + ('XER', 'xer_so', '32'), # bit0: so + ] -class LogicalOutputData(IntegerData): - regspec = [('INT', 'o', '0:63'), # RT +# input to logical final stage (common output) +class LogicalOutputData(FUBaseData): + def __init__(self, pspec): + super().__init__(pspec, True) + # convenience + self.cr0 = self.cr_a + + @property + def regspec(self): + return [('INT', 'o', self.intrange), ('CR', 'cr_a', '0:3'), - ('XER', 'xer_ca', '34,45'), # bit0: ca, bit1: ca32 + ('XER', 'xer_so', '32'), # bit0: so ] + + +# output from logical final stage (common output) - note that XER.so +# is *not* included (the only reason it's in the input is because of CR0) +class LogicalOutputDataFinal(FUBaseData): def __init__(self, pspec): super().__init__(pspec, True) # convenience self.cr0 = self.cr_a + @property + def regspec(self): + return [('INT', 'o', self.intrange), + ('CR', 'cr_a', '0:3'), + ] class LogicalPipeSpec(CommonPipeSpec): - regspec = (LogicalInputData.regspec, LogicalOutputData.regspec) + regspecklses = (LogicalInputData, LogicalOutputDataFinal) opsubsetkls = CompLogicalOpSubset