8dfce155d349b445a56a902dd5811d112592fb16
1 from nmigen
.hdl
.rec
import Record
, Layout
3 from soc
.decoder
.power_enums
import (InternalOp
, Function
)
6 class CompSPROpSubset(Record
):
9 a copy of the relevant subset information from Decode2Execute1Type
10 needed for TRAP operations. use with eq_from_execute1 (below) to
13 def __init__(self
, name
=None):
14 layout
= (('insn_type', InternalOp
),
15 ('fn_unit', Function
),
20 Record
.__init
__(self
, Layout(layout
), name
=name
)
22 # grrr. Record does not have kwargs
23 self
.insn_type
.reset_less
= True
24 self
.insn
.reset_less
= True
25 self
.fn_unit
.reset_less
= True
26 self
.is_32bit
.reset_less
= True
28 def eq_from_execute1(self
, other
):
29 """ use this to copy in from Decode2Execute1Type
32 for fname
, sig
in self
.fields
.items():
33 eqfrom
= other
.do
.fields
[fname
]
34 res
.append(sig
.eq(eqfrom
))
38 return [self
.insn_type
,