1 from nmigen
import Signal
, Const
2 from ieee754
.fpcommon
.getop
import FPPipeContext
3 from soc
.decoder
.power_decoder2
import Data
8 def __init__(self
, pspec
):
9 self
.ctx
= FPPipeContext(pspec
)
10 self
.muxid
= self
.ctx
.muxid
16 return [self
.ctx
.eq(i
.ctx
)]
19 class BranchInputData(IntegerData
):
20 def __init__(self
, pspec
):
21 super().__init
__(pspec
)
22 # We need both lr and spr for bclr and bcctrl. Bclr can read
23 # from both ctr and lr, and bcctrl can write to both ctr and
25 self
.lr
= Signal(64, reset_less
=True)
26 self
.spr
= Signal(64, reset_less
=True)
27 self
.cr
= Signal(32, reset_less
=True)
28 # NIA not needed, it's already part of ctx
31 yield from super().__iter
__()
38 return lst
+ [self
.lr
.eq(i
.lr
), self
.spr
.eq(i
.lr
),
42 class BranchOutputData(IntegerData
):
43 def __init__(self
, pspec
):
44 super().__init
__(pspec
)
45 self
.lr
= Signal(64, reset_less
=True)
46 self
.spr
= Signal(64, reset_less
=True)
47 self
.nia_out
= Data(64, name
="nia_out")
50 yield from super().__iter
__()
53 yield from self
.nia_out
57 return lst
+ [self
.lr
.eq(i
.lr
), self
.spr
.eq(i
.spr
),
58 self
.nia_out
.eq(i
.nia_out
)]