4904ba7e4671e4e20a2f14247444801383e74e83
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 self
.nia
= Signal(64, reset_less
=True)
31 yield from super().__iter
__()
39 return lst
+ [self
.lr
.eq(i
.lr
), self
.spr
.eq(i
.lr
),
40 self
.cr
.eq(i
.cr
), self
.nia
.eq(i
.nia
)]
43 class BranchOutputData(IntegerData
):
44 def __init__(self
, pspec
):
45 super().__init
__(pspec
)
46 self
.lr
= Data(64, name
="lr")
47 self
.spr
= Data(64, name
="spr")
48 self
.nia_out
= Data(64, name
="nia_out")
51 yield from super().__iter
__()
54 yield from self
.nia_out
58 return lst
+ [self
.lr
.eq(i
.lr
), self
.spr
.eq(i
.spr
),
59 self
.nia_out
.eq(i
.nia_out
)]