11e85d1568bcdf666b6ce93f59e501a0fbea4804
1 from nmigen
.hdl
.rec
import Record
, Layout
3 from soc
.decoder
.power_enums
import (InternalOp
, Function
)
6 class CompCROpSubset(Record
):
9 a copy of the relevant subset information from Decode2Execute1Type
10 needed for CR operations. use with eq_from_execute1 (below) to
13 def __init__(self
, name
=None):
14 layout
= (('insn_type', InternalOp
),
15 ('fn_unit', Function
),
18 ('write_cr_whole', 1),
21 Record
.__init
__(self
, Layout(layout
), name
=name
)
23 # grrr. Record does not have kwargs
24 self
.insn_type
.reset_less
= True
25 self
.insn
.reset_less
= True
26 self
.fn_unit
.reset_less
= True
27 self
.read_cr_whole
.reset_less
= True
28 self
.write_cr_whole
.reset_less
= True
30 def eq_from_execute1(self
, other
):
31 """ use this to copy in from Decode2Execute1Type
34 for fname
, sig
in self
.fields
.items():
35 eqfrom
= other
.do
.fields
[fname
]
36 res
.append(sig
.eq(eqfrom
))
40 return [self
.insn_type
,