"""
from nmigen import Signal, Record
from nmutil.iocontrol import RecordObject
-from soc.decoder.power_enums import InternalOp, CryIn, Function, SPR
+from soc.decoder.power_enums import InternalOp, CryIn, Function, SPR, LDSTMode
class Data(Record):
self.data_len = Signal(4, reset_less=True) # bytes
self.byte_reverse = Signal(reset_less=True)
self.sign_extend = Signal(reset_less=True)# do we need this?
- self.update = Signal(reset_less=True) # LD/ST is "update" variant
+ self.ldst_mode = Signal(LDSTMode, reset_less=True) # LD/ST mode
self.traptype = Signal(5, reset_less=True) # see trap main_stage.py
self.trapaddr = Signal(13, reset_less=True)
self.read_cr_whole = Signal(reset_less=True)
comb += do.byte_reverse.eq(op.br)
comb += do.sign_extend.eq(op.sgn_ext)
- comb += do.update.eq(op.upd) # LD/ST "update" mode.
+ comb += do.ldst_mode.eq(op.upd) # LD/ST mode (update, cache-inhibit)
# These should be removed eventually
comb += do.input_cr.eq(op.cr_in) # condition reg comes in
is8B = 8
+@unique
+class LDSTMode(Enum):
+ NONE = 0
+ update = 1
+ cix = 2
+
+
@unique
class RC(Enum):
NONE = 0
from soc.experiment.l0_cache import PortInterface
from soc.fu.regspec import RegSpecAPI
-from soc.decoder.power_enums import InternalOp, Function
+from soc.decoder.power_enums import InternalOp, Function, LDSTMode
from soc.fu.ldst.ldst_input_record import CompLDSTOpSubset
from soc.decoder.power_decoder2 import Data
# decode bits of operand (latched)
comb += op_is_st.eq(oper_r.insn_type == InternalOp.OP_STORE) # ST
comb += op_is_ld.eq(oper_r.insn_type == InternalOp.OP_LOAD) # LD
- op_is_update = oper_r.update # UPDATE
+ op_is_update = oper_r.ldst_mode == LDSTMode.update # UPDATE
+ op_is_cix = oper_r.ldst_mode == LDSTMode.cix # cache-inhibit
comb += self.load_mem_o.eq(op_is_ld & self.go_ad_i)
comb += self.stwd_mem_o.eq(op_is_st & self.go_st_i)
comb += self.ld_o.eq(op_is_ld)
from nmigen.hdl.rec import Record, Layout
-from soc.decoder.power_enums import InternalOp, Function
+from soc.decoder.power_enums import InternalOp, Function, LDSTMode
class CompLDSTOpSubset(Record):
('data_len', 4),
('byte_reverse', 1),
('sign_extend', 1),
- ('update', 1))
+ ('ldst_mode', LDSTMode))
Record.__init__(self, Layout(layout), name=name)
self.data_len.reset_less = True
self.byte_reverse.reset_less = True
self.sign_extend.reset_less = True
- self.update.reset_less = True
+ self.ldst_mode.reset_less = True
def eq_from_execute1(self, other):
""" use this to copy in from Decode2Execute1Type
self.data_len,
self.byte_reverse,
self.sign_extend,
- self.update,
+ self.ldst_mode,
]