1 from nmigen
import Signal
, Const
2 from ieee754
.fpcommon
.getop
import FPPipeContext
3 from soc
.fu
.alu
.pipe_data
import IntegerData
4 from nmutil
.dynamicpipe
import SimpleHandshakeRedir
5 from soc
.fu
.alu
.alu_input_record
import CompALUOpSubset
# TODO: replace
8 class CRInputData(IntegerData
):
9 regspec
= [('INT', 'a', '0:63'),
11 def __init__(self
, pspec
):
12 super().__init
__(pspec
)
13 self
.a
= Signal(64, reset_less
=True) # RA
14 self
.cr
= Signal(32, reset_less
=True) # CR in
17 yield from super().__iter
__()
23 return lst
+ [self
.a
.eq(i
.a
),
26 class CROutputData(IntegerData
):
27 regspec
= [('INT', 'o', '0:63'),
29 def __init__(self
, pspec
):
30 super().__init
__(pspec
)
31 self
.o
= Signal(64, reset_less
=True) # RA
32 self
.cr
= Signal(32, reset_less
=True, name
="cr_out") # CR in
35 yield from super().__iter
__()
41 return lst
+ [self
.o
.eq(i
.o
),
44 # TODO: replace CompALUOpSubset with CompCROpSubset
46 regspec
= (CRInputData
.regspec
, CROutputData
.regspec
)
47 opsubsetkls
= CompALUOpSubset
48 def __init__(self
, id_wid
, op_wid
):
51 self
.opkls
= lambda _
: self
.opsubsetkls(name
="op")
53 self
.pipekls
= SimpleHandshakeRedir