From 75936095802035e3f50bc8486acd87c2a51575fc Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 6 Jul 2021 15:53:12 +0100 Subject: [PATCH] rename fft remap shape to match spec https://libre-soc.org/openpower/sv/remap/ --- openpower/sv/remap_fft_yield.py | 16 ++++++++-------- openpower/sv/remapfft.py | 7 ++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/openpower/sv/remap_fft_yield.py b/openpower/sv/remap_fft_yield.py index 0106c8f76..3e95d0a02 100644 --- a/openpower/sv/remap_fft_yield.py +++ b/openpower/sv/remap_fft_yield.py @@ -24,7 +24,7 @@ # the indices are generated by using natural-looking nested loops def iterate_indices(SVSHAPE): # get indices to iterate over, in the required order - n = SVSHAPE.lims[SVSHAPE.order[0]] + n = SVSHAPE.lims[0] # 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) @@ -34,7 +34,7 @@ def iterate_indices(SVSHAPE): x_r.append(size) size *= 2 # invert order if requested - if SVSHAPE.invxyz[SVSHAPE.order[0]]: x_r.reverse() + if SVSHAPE.invxyz[0]: x_r.reverse() if len(x_r) == 0: return @@ -50,7 +50,7 @@ def iterate_indices(SVSHAPE): for i in range(0, n, size): y_r.append(i) # invert if requested - if SVSHAPE.invxyz[SVSHAPE.order[1]]: y_r.reverse() + if SVSHAPE.invxyz[1]: y_r.reverse() for i in y_r: # loop over 2nd order dimension k_r = [] j_r = [] @@ -60,19 +60,19 @@ def iterate_indices(SVSHAPE): j_r.append(j) k += tablestep # invert if requested - if SVSHAPE.invxyz[SVSHAPE.order[2]]: k_r.reverse() - if SVSHAPE.invxyz[SVSHAPE.order[2]]: j_r.reverse() + if SVSHAPE.invxyz[2]: k_r.reverse() + if SVSHAPE.invxyz[2]: j_r.reverse() for j, k in zip(j_r, k_r): # loop over 1st order dimension # skip the first entries up to offset if skip < SVSHAPE.offset: skip += 1 continue # now depending on MODE return the index - if SVSHAPE.mode == 0b00: + if SVSHAPE.skip == 0b00: result = j # for vec[j] - elif SVSHAPE.mode == 0b01: + elif SVSHAPE.skip == 0b01: result = j + halfsize # for vec[j+halfsize] - elif SVSHAPE.mode == 0b10: + elif SVSHAPE.skip == 0b10: result = k # for exptable[k] yield result diff --git a/openpower/sv/remapfft.py b/openpower/sv/remapfft.py index b79132ca1..43590f227 100644 --- a/openpower/sv/remapfft.py +++ b/openpower/sv/remapfft.py @@ -97,15 +97,16 @@ def transform_radix2(vec, inverse, generators_mode): SVSHAPE0 = SVSHAPE() SVSHAPE0.lims = [n, 0, 0] SVSHAPE0.order = [0,1,2] - SVSHAPE0.mode = 0b00 + SVSHAPE0.mode = 0b01 # FFT mode + SVSHAPE0.skip = 0b00 SVSHAPE0.offset = 0 SVSHAPE0.invxyz = [0,0,0] # inversion if desired # j+halfstep schedule SVSHAPE1 = deepcopy(SVSHAPE0) - SVSHAPE1.mode = 0b01 + SVSHAPE1.skip = 0b01 # k schedule SVSHAPE2 = deepcopy(SVSHAPE0) - SVSHAPE2.mode = 0b10 + SVSHAPE2.skip = 0b10 # enumerate over the iterator function, getting 3 *different* indices for idx, (jl, jh, k) in enumerate(zip(iterate_indices(SVSHAPE0), -- 2.30.2