use ydimsz as sub-mode in DCT/FFT butterfly
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 26 Jul 2021 15:22:48 +0000 (16:22 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 26 Jul 2021 15:22:48 +0000 (16:22 +0100)
openpower/isa/simplev.mdwn
src/openpower/decoder/isa/remap_dct_yield.py
src/openpower/decoder/isa/svshape.py
src/openpower/decoder/isa/test_caller_svp64_dct.py

index 1ddc0ffec94bebf531f8da49ac61dfc209ef7bc7..22c70865d1a3370f62d859c2ab553781bc286f77 100644 (file)
@@ -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]
index 3368eb9b9b2f23b57174baf8e43114ee3ccdeded..690c9760ecfe58c17c2c365e93da92de0a3999aa 100644 (file)
@@ -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
index c2e1968df2ad7c014bdfc8059c0d941766f5d85d..02d312420422562f66ae0ca0d3c3fb8ddadda9f0 100644 (file)
@@ -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))
index 08feab0c86a063ac32c72c24d85ebfb61bc1cf0b..7b8da3d67c0b23691185210b3802b6eb37044098 100644 (file)
@@ -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