"""
def __init__(self, dec, opkls=None, fn_name=None, col_subset=None,
- final=False):
+ final=False, state=None):
self.final = final
if dec is None:
self.fn_name = None
self.e = Decode2ToExecute1Type(name=self.fn_name, opkls=self.opkls)
- # state information needed by the Decoder (TODO: this as a Record)
- self.state = CoreState("dec2")
+ # state information needed by the Decoder
+ if state is not None:
+ self.state = state
+ else:
+ self.state = CoreState("dec2")
def rowsubsetfn(self, opcode, row):
return row['unit'] == self.fn_name
if self.final:
e = self.e
else:
- self.e_tmp = e = Decode2ToExecute1Type(name=self.fn_name,
- opkls=self.opkls)
+ if self.fn_name is None:
+ name = "tmp"
+ else:
+ name = self.fn_name + "tmp"
+ self.e_tmp = e = Decode2ToExecute1Type(name=name, opkls=self.opkls)
do = e.do
# set up submodule decoders
self.trapunit = funame
continue
self.decoders[funame] = PowerDecodeSubset(None, opkls, f_name,
- final=True)
+ final=True,
+ state=self.state)
self.ees[funame] = self.decoders[funame].e
def elaborate(self, platform):
setattr(m.submodules, "dec_%s" % v.fn_name, v)
comb += v.dec.raw_opcode_in.eq(self.raw_insn_i)
comb += v.dec.bigendian.eq(self.bigendian_i)
- comb += v.state.eq(self.state)
# ssh, cheat: trap uses the main decoder because of the rewriting
self.ees[self.trapunit] = self.e