1 from nmigen
.hdl
.rec
import Record
, Layout
3 from soc
.decoder
.power_enums
import (MicrOp
, Function
)
6 class CompTrapOpSubset(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', MicrOp
),
15 ('fn_unit', Function
),
18 ('traptype', 5), # see trap main_stage.py and PowerDecoder2
22 Record
.__init
__(self
, Layout(layout
), name
=name
)
24 # grrr. Record does not have kwargs
25 self
.insn_type
.reset_less
= True
26 self
.insn
.reset_less
= True
27 self
.fn_unit
.reset_less
= True
28 self
.is_32bit
.reset_less
= True
29 self
.traptype
.reset_less
= True
30 self
.trapaddr
.reset_less
= True
32 def eq_from_execute1(self
, other
):
33 """ use this to copy in from Decode2Execute1Type
36 for fname
, sig
in self
.fields
.items():
37 eqfrom
= other
.do
.fields
[fname
]
38 res
.append(sig
.eq(eqfrom
))
42 return [self
.insn_type
,