1 from nmigen
.hdl
.rec
import Record
, Layout
3 from soc
.decoder
.power_enums
import InternalOp
, Function
, CryIn
6 class CompBROpSubset(Record
):
9 TODO: remove anything not needed by the Branch pipeline (determine this
10 after all branch operations have been written. see
11 https://bugs.libre-soc.org/show_bug.cgi?id=313#c3)
13 a copy of the relevant subset information from Decode2Execute1Type
14 needed for Branch operations. use with eq_from_execute1 (below) to
17 def __init__(self
, name
=None):
18 layout
= (('insn_type', InternalOp
),
19 ('fn_unit', Function
),
20 ('imm_data', Layout((("imm", 64), ("imm_ok", 1)))),
21 #'cr = Signal(32) # NO: this is from the CR SPR
22 #'xerc = XerBits() # NO: this is from the XER SPR
24 ('rc', Layout((("rc", 1), ("rc_ok", 1)))),
25 ('oe', Layout((("oe", 1), ("oe_ok", 1)))),
28 ('input_carry', CryIn
),
38 Record
.__init
__(self
, Layout(layout
), name
=name
)
40 # grrr. Record does not have kwargs
41 self
.insn_type
.reset_less
= True
42 self
.fn_unit
.reset_less
= True
43 #self.cr = Signal(32, reset_less = True
45 self
.lk
.reset_less
= True
46 self
.invert_a
.reset_less
= True
47 self
.invert_out
.reset_less
= True
48 self
.input_carry
.reset_less
= True
49 self
.output_carry
.reset_less
= True
50 self
.input_cr
.reset_less
= True
51 self
.output_cr
.reset_less
= True
52 self
.is_32bit
.reset_less
= True
53 self
.is_signed
.reset_less
= True
54 self
.byte_reverse
.reset_less
= True
55 self
.sign_extend
.reset_less
= True
57 def eq_from_execute1(self
, other
):
58 """ use this to copy in from Decode2Execute1Type
61 for fname
, sig
in self
.fields
.items():
62 eqfrom
= other
.fields
[fname
]
63 res
.append(sig
.eq(eqfrom
))
67 return [self
.insn_type
,