2 Optional Register allocation listed below. mandatory input
3 (CompBROpSubset, CIA) not included.
5 * CR is Condition Register (not an SPR)
6 * SPR1, SPR2 and SPR3 are all from the SPR regfile. 3 ports are needed
17 op_bcla CR, xx, CTR xx
18 op_bclr CR, LR, CTR xx
19 op_bclrl CR, LR, CTR xx
20 op_bcctr CR, xx, CTR xx
21 op_bcctrl CR, xx, CTR xx
22 op_bctar CR, TAR, CTR, xx
23 op_bctarl CR, TAR, CTR, xx
26 op_scv xx LR, SRR1, MSR
27 op_rfscv xx LR, CTR, MSR
28 op_rfid xx SRR0, SRR1, MSR
29 op_hrfid xx HSRR0, HSRR1, MSR
32 from nmigen
import Signal
, Const
33 from ieee754
.fpcommon
.getop
import FPPipeContext
34 from soc
.decoder
.power_decoder2
import Data
35 from soc
.alu
.pipe_data
import IntegerData
38 class BranchInputData(IntegerData
):
39 def __init__(self
, pspec
):
40 super().__init
__(pspec
)
41 # Note: for OP_BCREG, SPR1 will either be CTR, LR, or TAR
42 # this involves the *decode* unit selecting the register, based
43 # on detecting the operand being bcctr, bclr or bctar
45 self
.spr1
= Signal(64, reset_less
=True) # see table above, SPR1
46 self
.spr2
= Signal(64, reset_less
=True) # see table above, SPR2
47 self
.spr3
= Signal(64, reset_less
=True) # see table above, SPR3
48 self
.cr
= Signal(32, reset_less
=True) # Condition Register(s) CR0-7
49 self
.cia
= Signal(64, reset_less
=True) # Current Instruction Address
51 # convenience variables. not all of these are used at once
52 self
.ctr
= self
.srr0
= self
.hsrr0
= self
.spr2
53 self
.lr
= self
.tar
= self
.srr1
= self
.hsrr1
= self
.spr1
57 yield from super().__iter
__()
66 return lst
+ [self
.spr1
.eq(i
.spr1
), self
.spr2
.eq(i
.spr2
),
68 self
.cr
.eq(i
.cr
), self
.cia
.eq(i
.cia
)]
71 class BranchOutputData(IntegerData
):
72 def __init__(self
, pspec
):
73 super().__init
__(pspec
)
74 self
.lr
= Data(64, name
="lr")
75 self
.spr
= Data(64, name
="spr")
76 self
.nia
= Data(64, name
="nia")
78 # convenience variables.
82 yield from super().__iter
__()
89 return lst
+ [self
.lr
.eq(i
.lr
), self
.spr
.eq(i
.spr
),