""" XXX currently not used
"""
rnum = self._get_regnum(attr)
+ # XXX TODO, this needs sorting! (1) reverse gear for mapreduce
+ # and (2) when doing element-width overrides. used by
+ # GPR(x) or GPR[x] in pseudocode
offs = self.svstate.srcstep
- log("GPR getitem", attr, rnum, "srcoffs", offs)
+ log("GPR getitem TODO mapreduce reverse-gear", attr, rnum,
+ "srcoffs", offs)
return self.regfile[rnum]
def dump(self, printout=True):
comb += crin_svdec_o.idx.eq(op.sv_cr_out) # SVP64 CR out
# get SVSTATE srcstep (TODO: elwidth etc.) needed below
+ vl = Signal.like(self.state.svstate.vl)
srcstep = Signal.like(self.state.svstate.srcstep)
dststep = Signal.like(self.state.svstate.dststep)
+ comb += vl.eq(self.state.svstate.vl)
comb += srcstep.eq(self.state.svstate.srcstep)
comb += dststep.eq(self.state.svstate.dststep)
# to_reg is 7-bits, outs get dststep added, ins get srcstep
with m.If(svdec.isvec):
step = dststep if out else srcstep
- comb += to_reg.data.eq(step+svdec.reg_out)
+ # reverse gear goes the opposite way
+ with m.If(self.rm_dec.reverse_gear):
+ comb += to_reg.data.eq(step+svdec.reg_out)
+ with m.Else():
+ comb += to_reg.data.eq(svdec.reg_out+(vl-1-step))
with m.Else():
comb += to_reg.data.eq(svdec.reg_out)