TRAP = 1<<2
ADDR = 1<<3
ILLEG = 1<<4 # currently the max, therefore traptype must be 5 bits
+ # TODO: support for TM_BAD_THING (not included yet in trap main_stage.py)
+ size = 5 # MUST update this to contain the full number of Trap Types
from nmigen import Signal, Record
from nmutil.iocontrol import RecordObject
from soc.decoder.power_enums import MicrOp, CryIn, Function, SPR, LDSTMode
+from soc.consts import TT
class Data(Record):
self.byte_reverse = Signal(reset_less=True)
self.sign_extend = Signal(reset_less=True)# do we need this?
self.ldst_mode = Signal(LDSTMode, reset_less=True) # LD/ST mode
- self.traptype = Signal(5, reset_less=True) # see trap main_stage.py
+ self.traptype = Signal(TT.size, reset_less=True) # trap main_stage.py
self.trapaddr = Signal(13, reset_less=True)
self.read_cr_whole = Signal(reset_less=True)
self.write_cr_whole = Signal(reset_less=True)
from soc.fu.base_input_record import CompOpSubsetBase
from soc.decoder.power_enums import (MicrOp, Function)
+from soc.consts import TT
class CompTrapOpSubset(CompOpSubsetBase):
('msr', 64), # TODO: "state" in separate Record
('cia', 64), # likewise
('is_32bit', 1),
- ('traptype', 5), # see trap main_stage.py and PowerDecoder2
+ ('traptype', TT.size), # see trap main_stage.py, PowerDecoder2
('trapaddr', 13),
)