From: Luke Kenneth Casson Leighton Date: Mon, 26 Jul 2021 15:22:48 +0000 (+0100) Subject: use ydimsz as sub-mode in DCT/FFT butterfly X-Git-Tag: xlen-bcd~208 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4d1829a7562ac6fc60afd03ee8eedc64ab7fe77f;p=openpower-isa.git use ydimsz as sub-mode in DCT/FFT butterfly --- diff --git a/openpower/isa/simplev.mdwn b/openpower/isa/simplev.mdwn index 1ddc0ffe..22c70865 100644 --- a/openpower/isa/simplev.mdwn +++ b/openpower/isa/simplev.mdwn @@ -158,7 +158,8 @@ Pseudo-code: # 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 @@ -189,7 +190,8 @@ Pseudo-code: # 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] diff --git a/src/openpower/decoder/isa/remap_dct_yield.py b/src/openpower/decoder/isa/remap_dct_yield.py index 3368eb9b..690c9760 100644 --- a/src/openpower/decoder/isa/remap_dct_yield.py +++ b/src/openpower/decoder/isa/remap_dct_yield.py @@ -46,7 +46,9 @@ def halfrev2(vec, pre_rev=True): 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 = [] @@ -139,6 +141,7 @@ def iterate_dct_inner_butterfly_indices(SVSHAPE): 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) @@ -309,7 +312,7 @@ def transform2(vec): pass # j schedule SVSHAPE0 = SVSHAPE() - SVSHAPE0.lims = [xdim, ydim, zdim] + SVSHAPE0.lims = [xdim, 0b000001, zdim] SVSHAPE0.mode = 0b01 SVSHAPE0.submode2 = 0b01 SVSHAPE0.skip = 0b00 @@ -317,7 +320,7 @@ def transform2(vec): 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 @@ -325,7 +328,7 @@ def transform2(vec): 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 @@ -333,7 +336,7 @@ def transform2(vec): 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 @@ -367,7 +370,7 @@ def transform2(vec): # j schedule SVSHAPE0 = SVSHAPE() - SVSHAPE0.lims = [xdim, ydim, zdim] + SVSHAPE0.lims = [xdim, 0b0000010, zdim] SVSHAPE0.submode2 = 0b100 SVSHAPE0.mode = 0b01 SVSHAPE0.skip = 0b00 @@ -375,7 +378,7 @@ def transform2(vec): 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 @@ -415,7 +418,7 @@ def demo(): pass # j schedule SVSHAPE0 = SVSHAPE() - SVSHAPE0.lims = [xdim, ydim, zdim] + SVSHAPE0.lims = [xdim, 0b000001, zdim] SVSHAPE0.submode2 = 0b010 SVSHAPE0.mode = 0b01 SVSHAPE0.skip = 0b00 @@ -423,7 +426,7 @@ def demo(): 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 @@ -450,16 +453,16 @@ def demo(): # 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 diff --git a/src/openpower/decoder/isa/svshape.py b/src/openpower/decoder/isa/svshape.py index c2e1968d..02d31242 100644 --- a/src/openpower/decoder/isa/svshape.py +++ b/src/openpower/decoder/isa/svshape.py @@ -24,7 +24,7 @@ class SVSHAPE(SelectableInt): 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 @@ -113,15 +113,16 @@ class SVSHAPE(SelectableInt): 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)) diff --git a/src/openpower/decoder/isa/test_caller_svp64_dct.py b/src/openpower/decoder/isa/test_caller_svp64_dct.py index 08feab0c..7b8da3d6 100644 --- a/src/openpower/decoder/isa/test_caller_svp64_dct.py +++ b/src/openpower/decoder/isa/test_caller_svp64_dct.py @@ -47,8 +47,7 @@ def transform_inner_radix2(vec, ctable): 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 @@ -56,8 +55,7 @@ def transform_inner_radix2(vec, ctable): 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 @@ -99,7 +97,7 @@ def transform_outer_radix2(vec): class SVSHAPE: pass SVSHAPE0 = SVSHAPE() - SVSHAPE0.lims = [xdim, ydim, zdim] + SVSHAPE0.lims = [xdim, 3, zdim] SVSHAPE0.submode2 = 0b100 SVSHAPE0.mode = 0b01 SVSHAPE0.skip = 0b00 @@ -107,7 +105,7 @@ def transform_outer_radix2(vec): 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