From 195f6b436301ac6d03412bfbbd1243e7907ace1e Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Mon, 17 Oct 2016 11:02:33 +0000
Subject: [PATCH] Updated fft_r2_parameter_asserts() because use_fft_shift is
 now part of t_fft record.

---
 libraries/dsp/fft/src/vhdl/fft_pkg.vhd           | 9 +++++----
 libraries/dsp/fft/tb/vhdl/tb_fft_r2_par.vhd      | 2 +-
 libraries/dsp/fft/tb/vhdl/tb_fft_r2_pipe.vhd     | 2 +-
 libraries/dsp/fft/tb/vhdl/tb_fft_r2_wide.vhd     | 2 +-
 libraries/dsp/wpfb/tb/vhdl/tb_wpfb_unit_wide.vhd | 2 +-
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/libraries/dsp/fft/src/vhdl/fft_pkg.vhd b/libraries/dsp/fft/src/vhdl/fft_pkg.vhd
index de89801056..68276873b8 100644
--- a/libraries/dsp/fft/src/vhdl/fft_pkg.vhd
+++ b/libraries/dsp/fft/src/vhdl/fft_pkg.vhd
@@ -47,7 +47,7 @@ package fft_pkg is
   constant c_fft   : t_fft := (true, false, true, 0, 4, 0, 1024, 8, 14, 0, c_dsp_mult_w, 2, true, 56, 2);
   
   -- Check consistancy of the FFT parameters
-  function fft_r2_parameter_asserts(g_fft : t_fft; use_fft_shift : boolean) return boolean;  -- the return value is void
+  function fft_r2_parameter_asserts(g_fft : t_fft) return boolean;  -- the return value is void
   
   -- Definitions for fft slv array (an array can not have unconstraint elements, so choose sufficiently wide 32 bit slv elements)
   subtype  t_fft_slv_arr is t_slv_32_arr;    -- use subtype to ease interfacing to existing types and to have central definition for rtwo components
@@ -64,17 +64,18 @@ end package fft_pkg;
 
 package body fft_pkg is
 
-  function fft_r2_parameter_asserts(g_fft : t_fft; use_fft_shift : boolean) return boolean is
+  function fft_r2_parameter_asserts(g_fft : t_fft) return boolean is
   begin
     -- nof_points
     assert g_fft.nof_points=2**ceil_log2(g_fft.nof_points) report "fft_r2: nof_points must be a power of 2" severity failure;
     -- use_reorder
     if g_fft.use_reorder=false then
       assert g_fft.use_separate=false  report "fft_r2 : without use_reorder there cannot be use_separate for two real inputs" severity failure;
-      assert       use_fft_shift=false report "fft_r2 : without use_reorder there cannot be use_fft_shift for complex input"  severity failure;
+      assert g_fft.use_fft_shift=false report "fft_r2 : without use_reorder there cannot be use_fft_shift for complex input"  severity failure;
     end if;
+    -- use_separate
     if g_fft.use_separate=true then
-      assert       use_fft_shift=false report "fft_r2 : with use_separate there cannot be use_fft_shift for real input"  severity failure;
+      assert g_fft.use_fft_shift=false report "fft_r2 : with use_separate there cannot be use_fft_shift for real input"  severity failure;
     end if;
     return true;
   end;    
diff --git a/libraries/dsp/fft/tb/vhdl/tb_fft_r2_par.vhd b/libraries/dsp/fft/tb/vhdl/tb_fft_r2_par.vhd
index e80b462815..56d77577c4 100644
--- a/libraries/dsp/fft/tb/vhdl/tb_fft_r2_par.vhd
+++ b/libraries/dsp/fft/tb/vhdl/tb_fft_r2_par.vhd
@@ -139,7 +139,7 @@ architecture tb of tb_fft_r2_par is
 
   constant c_in_complex            : boolean := not g_fft.use_separate;
   constant c_use_fft_shift         : boolean := false;
-  constant c_fft_r2_check          : boolean := fft_r2_parameter_asserts(g_fft, c_use_fft_shift);
+  constant c_fft_r2_check          : boolean := fft_r2_parameter_asserts(g_fft);
 
   constant c_nof_channels          : natural := 1;  -- fixed g_fft.nof_chan=0, because the concept of channels is void for the parallel FFT
 
diff --git a/libraries/dsp/fft/tb/vhdl/tb_fft_r2_pipe.vhd b/libraries/dsp/fft/tb/vhdl/tb_fft_r2_pipe.vhd
index 80b50e43e6..bb6adcf706 100644
--- a/libraries/dsp/fft/tb/vhdl/tb_fft_r2_pipe.vhd
+++ b/libraries/dsp/fft/tb/vhdl/tb_fft_r2_pipe.vhd
@@ -173,7 +173,7 @@ architecture tb of tb_fft_r2_pipe is
 
   constant c_in_complex            : boolean := not g_fft.use_separate;
   constant c_use_fft_shift         : boolean := false;
-  constant c_fft_r2_check          : boolean := fft_r2_parameter_asserts(g_fft, c_use_fft_shift);
+  constant c_fft_r2_check          : boolean := fft_r2_parameter_asserts(g_fft);
 
   constant c_nof_channels          : natural := 2**g_fft.nof_chan;
   constant c_nof_data_per_block    : natural := g_fft.nof_points * c_nof_channels;
diff --git a/libraries/dsp/fft/tb/vhdl/tb_fft_r2_wide.vhd b/libraries/dsp/fft/tb/vhdl/tb_fft_r2_wide.vhd
index 6db156b810..93e5a91b2e 100644
--- a/libraries/dsp/fft/tb/vhdl/tb_fft_r2_wide.vhd
+++ b/libraries/dsp/fft/tb/vhdl/tb_fft_r2_wide.vhd
@@ -145,7 +145,7 @@ architecture tb of tb_fft_r2_wide is
   
   constant c_in_complex            : boolean := not g_fft.use_separate;
   constant c_use_fft_shift         : boolean := false;
-  constant c_fft_r2_check          : boolean := fft_r2_parameter_asserts(g_fft, c_use_fft_shift);
+  constant c_fft_r2_check          : boolean := fft_r2_parameter_asserts(g_fft);
   
   constant c_nof_channels          : natural := 1;  -- fixed g_fft.nof_chan=0, because the concept of channels is void when wb_factor > 1
   constant c_nof_data_per_block    : natural := g_fft.nof_points * c_nof_channels;
diff --git a/libraries/dsp/wpfb/tb/vhdl/tb_wpfb_unit_wide.vhd b/libraries/dsp/wpfb/tb/vhdl/tb_wpfb_unit_wide.vhd
index d66158fa31..4845d63523 100644
--- a/libraries/dsp/wpfb/tb/vhdl/tb_wpfb_unit_wide.vhd
+++ b/libraries/dsp/wpfb/tb/vhdl/tb_wpfb_unit_wide.vhd
@@ -174,7 +174,7 @@ architecture tb of tb_wpfb_unit_wide is
                                                g_wpfb.stat_data_w,
                                                g_wpfb.stat_data_sz);
   constant c_use_fft_shift         : boolean := false;
-  constant c_fft_r2_check          : boolean := fft_r2_parameter_asserts(c_wfft, c_use_fft_shift);
+  constant c_fft_r2_check          : boolean := fft_r2_parameter_asserts(c_wfft);
   
   constant c_nof_channels          : natural := 1;
   constant c_nof_coefs             : natural := g_wpfb.nof_taps * g_wpfb.nof_points;       -- nof PFIR coef
-- 
GitLab