# set up template in SVSHAPE0, then copy to 1-3
# set up FRB and FRS
SVSHAPE0[0:5] <- (0b0 || SVxd) # xdim
- SVSHAPE0[30:31] <- 0b01 # Butterfly mode
+ SVSHAPE0[30:31] <- 0b01 # DCT/FFT mode
+ SVSHAPE0[6:11] <- 0b000001 # DCT Inner Butterfly mode
SVSHAPE0[18:20] <- 0b001 # DCT Inner Butterfly sub-mode
SVSHAPE0[21:23] <- 0b001 # "inverse" on outer loop
# copy
# set up template in SVSHAPE0, then copy to 1-3
# set up FRB and FRS
SVSHAPE0[0:5] <- (0b0 || SVxd) # xdim
- SVSHAPE0[30:31] <- 0b01 # Butterfly mode
+ SVSHAPE0[30:31] <- 0b01 # DCT/FFT mode
+ SVSHAPE0[6:11] <- 0b000010 # DCT Butterfly mode
SVSHAPE0[18:20] <- 0b100 # DCT Outer Butterfly sub-mode
# copy
SVSHAPE1[0:31] <- SVSHAPE0[0:31]
def iterate_dct_inner_butterfly_indices(SVSHAPE):
# get indices to iterate over, in the required order
n = SVSHAPE.lims[0]
- # createing lists of indices to iterate over in each dimension
+ mode = SVSHAPE.lims[1]
+ #print ("inner butterfly", mode)
+ # creating lists of indices to iterate over in each dimension
# has to be done dynamically, because it depends on the size
# first, the size-based loop (which can be done statically)
x_r = []
def iterate_dct_outer_butterfly_indices(SVSHAPE):
# get indices to iterate over, in the required order
n = SVSHAPE.lims[0]
+ mode = SVSHAPE.lims[1]
# createing lists of indices to iterate over in each dimension
# has to be done dynamically, because it depends on the size
# first, the size-based loop (which can be done statically)
pass
# j schedule
SVSHAPE0 = SVSHAPE()
- SVSHAPE0.lims = [xdim, ydim, zdim]
+ SVSHAPE0.lims = [xdim, 0b000001, zdim]
SVSHAPE0.mode = 0b01
SVSHAPE0.submode2 = 0b01
SVSHAPE0.skip = 0b00
SVSHAPE0.invxyz = [1,0,0] # inversion if desired
# j+halfstep schedule
SVSHAPE1 = SVSHAPE()
- SVSHAPE1.lims = [xdim, ydim, zdim]
+ SVSHAPE1.lims = [xdim, 0b000001, zdim]
SVSHAPE1.mode = 0b01
SVSHAPE1.submode2 = 0b01
SVSHAPE1.skip = 0b01
SVSHAPE1.invxyz = [1,0,0] # inversion if desired
# ci schedule
SVSHAPE2 = SVSHAPE()
- SVSHAPE2.lims = [xdim, ydim, zdim]
+ SVSHAPE2.lims = [xdim, 0b000001, zdim]
SVSHAPE2.mode = 0b01
SVSHAPE2.submode2 = 0b01
SVSHAPE2.skip = 0b10
SVSHAPE2.invxyz = [1,0,0] # inversion if desired
# size schedule
SVSHAPE3 = SVSHAPE()
- SVSHAPE3.lims = [xdim, ydim, zdim]
+ SVSHAPE3.lims = [xdim, 0b000001, zdim]
SVSHAPE3.mode = 0b01
SVSHAPE3.submode2 = 0b01
SVSHAPE3.skip = 0b11
# j schedule
SVSHAPE0 = SVSHAPE()
- SVSHAPE0.lims = [xdim, ydim, zdim]
+ SVSHAPE0.lims = [xdim, 0b0000010, zdim]
SVSHAPE0.submode2 = 0b100
SVSHAPE0.mode = 0b01
SVSHAPE0.skip = 0b00
SVSHAPE0.invxyz = [0,0,0] # inversion if desired
# j+halfstep schedule
SVSHAPE1 = SVSHAPE()
- SVSHAPE1.lims = [xdim, ydim, zdim]
+ SVSHAPE1.lims = [xdim, 0b0000010, zdim]
SVSHAPE1.mode = 0b01
SVSHAPE1.submode2 = 0b100
SVSHAPE1.skip = 0b01
pass
# j schedule
SVSHAPE0 = SVSHAPE()
- SVSHAPE0.lims = [xdim, ydim, zdim]
+ SVSHAPE0.lims = [xdim, 0b000001, zdim]
SVSHAPE0.submode2 = 0b010
SVSHAPE0.mode = 0b01
SVSHAPE0.skip = 0b00
SVSHAPE0.invxyz = [0,0,0] # inversion if desired
# j+halfstep schedule
SVSHAPE1 = SVSHAPE()
- SVSHAPE1.lims = [xdim, ydim, zdim]
+ SVSHAPE1.lims = [xdim, 0b000001, zdim]
SVSHAPE1.submode2 = 0b010
SVSHAPE1.mode = 0b01
SVSHAPE1.skip = 0b01
# j schedule
SVSHAPE0 = SVSHAPE()
- SVSHAPE0.lims = [xdim, ydim, zdim]
- SVSHAPE0.mode = 0b10
+ SVSHAPE0.lims = [xdim, 0b000010, zdim]
+ SVSHAPE0.mode = 0b01
SVSHAPE0.submode2 = 0b100
SVSHAPE0.skip = 0b10
SVSHAPE0.offset = 0 # experiment with different offset, here
SVSHAPE0.invxyz = [1,0,0] # inversion if desired
# j+halfstep schedule
SVSHAPE1 = SVSHAPE()
- SVSHAPE1.lims = [xdim, ydim, zdim]
- SVSHAPE1.mode = 0b10
+ SVSHAPE1.lims = [xdim, 0b000010, zdim]
+ SVSHAPE1.mode = 0b01
SVSHAPE1.submode2 = 0b100
SVSHAPE1.skip = 0b11
SVSHAPE1.offset = 0 # experiment with different offset, here
fs = tuple(range(offs, end))
v = FieldSelectableInt(self, fs)
self.fsi[field] = v
- #log("SVSHAPE setup field", field, offs, end)
+ log("SVSHAPE setup field", field, offs, end)
offs = end
@property
self.fsi['offset'].eq(value)
def get_iterator(self):
+ log ("SVSHAPE get_iterator", self.mode, self.ydimsz)
if self.mode == 0b00:
iterate_fn = iterate_indices
elif self.mode == 0b01:
# further sub-selection
- if self.submode2 == 0b000:
+ if self.ydimsz == 1:
iterate_fn = iterate_butterfly_indices
- elif self.submode2 in [0b001, 0b010]:
+ elif self.ydimsz == 2:
iterate_fn = iterate_dct_inner_butterfly_indices
- elif self.submode2 in [0b011, 0b100]:
+ elif self.ydimsz == 3:
iterate_fn = iterate_dct_outer_butterfly_indices
# create a **NEW** iterator each time this is called
return iterate_fn(deepcopy(self))
pass
# j schedule
SVSHAPE0 = SVSHAPE()
- SVSHAPE0.lims = [xdim, ydim, zdim]
- SVSHAPE0.order = [0,1,2] # experiment with different permutations, here
+ SVSHAPE0.lims = [xdim, 2, zdim]
SVSHAPE0.mode = 0b01
SVSHAPE0.submode2 = 0b01
SVSHAPE0.skip = 0b00
SVSHAPE0.invxyz = [1,0,0] # inversion if desired
# j+halfstep schedule
SVSHAPE1 = SVSHAPE()
- SVSHAPE1.lims = [xdim, ydim, zdim]
- SVSHAPE1.order = [0,1,2] # experiment with different permutations, here
+ SVSHAPE1.lims = [xdim, 2, zdim]
SVSHAPE1.mode = 0b01
SVSHAPE1.submode2 = 0b01
SVSHAPE1.skip = 0b01
class SVSHAPE:
pass
SVSHAPE0 = SVSHAPE()
- SVSHAPE0.lims = [xdim, ydim, zdim]
+ SVSHAPE0.lims = [xdim, 3, zdim]
SVSHAPE0.submode2 = 0b100
SVSHAPE0.mode = 0b01
SVSHAPE0.skip = 0b00
SVSHAPE0.invxyz = [0,0,0] # inversion if desired
# j+halfstep schedule
SVSHAPE1 = SVSHAPE()
- SVSHAPE1.lims = [xdim, ydim, zdim]
+ SVSHAPE1.lims = [xdim, 3, zdim]
SVSHAPE1.mode = 0b01
SVSHAPE1.submode2 = 0b100
SVSHAPE1.skip = 0b01