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)))),
26 Record
.__init
__(self
, Layout(layout
), name
=name
)
28 # grrr. Record does not have kwargs
29 self
.insn_type
.reset_less
= True
30 self
.fn_unit
.reset_less
= True
31 self
.lk
.reset_less
= True
32 self
.is_32bit
.reset_less
= True
33 self
.insn
.reset_less
= True
35 def eq_from_execute1(self
, other
):
36 """ use this to copy in from Decode2Execute1Type
39 for fname
, sig
in self
.fields
.items():
40 eqfrom
= other
.do
.fields
[fname
]
41 res
.append(sig
.eq(eqfrom
))
45 return [self
.insn_type
,