if SVSHAPE.invxyz[1]: y_r.reverse()
if SVSHAPE.invxyz[2]: z_r.reverse()
# start an infinite (wrapping) loop
+ step = 0 # track src/dst step
while True:
for z in z_r: # loop over 1st order dimension
z_end = z == z_r[-1]
((y_end and x_end and z_end)<<2))
if hasattr(SVSHAPE, "postprocess"): # for Indexed mode
- result = SVSHAPE.postprocess(result)
+ result = SVSHAPE.postprocess(result, step)
yield result + SVSHAPE.offset, loopends
-
+ step += 1
def demo():
# set the dimension sizes here
xdim = 3
def offset(self, value):
self.fsi['offset'].eq(value)
- def postprocess(self, idx):
+ def postprocess(self, idx, step):
if self.mode != 0b00 or not self.is_indexed():
return idx
if self.gpr is None:
return idx
+ if self.xdimsz == 1 and self.ydimsz == 1:
+ idx = step # no Index remapping
remap = self.gpr(self.svgpr+idx).value # TODO: elwidths
log ("indexed_iterator", self.svgpr, idx, remap)
return remap