add LDSTException decode/handling in PowerDecoder2
[soc.git] / src / soc / fu / trap / trap_input_record.py
1 from soc.fu.base_input_record import CompOpSubsetBase
2 from soc.decoder.power_enums import (MicrOp, Function)
3 from soc.consts import TT
4 from soc.experiment.mem_types import LDSTException
5
6 class CompTrapOpSubset(CompOpSubsetBase):
7 """CompTrapOpSubset
8
9 a copy of the relevant subset information from Decode2Execute1Type
10 needed for TRAP operations. use with eq_from_execute1 (below) to
11 grab subsets.
12 """
13 def __init__(self, name=None):
14 layout = [('insn_type', MicrOp),
15 ('fn_unit', Function),
16 ('insn', 32),
17 ('msr', 64), # TODO: "state" in separate Record
18 ('cia', 64), # likewise
19 ('is_32bit', 1),
20 ('traptype', TT.size), # see trap main_stage.py, PowerDecoder2
21 ('trapaddr', 13),
22 ]
23
24 # add LDST field exception types
25 #for f in LDSTException._exc_types:
26 # layout.append((f, 1))
27
28 super().__init__(layout, name=name)
29