| Line 16... | Line 16... | 
      
        | -- See the License for the specific language governing permissions and
 | -- See the License for the specific language governing permissions and
 | 
      
        | -- limitations under the License.
 | -- limitations under the License.
 | 
      
        | --
 | --
 | 
      
        | -------------------------------------------------------------------------------
 | -------------------------------------------------------------------------------
 | 
      
        |  
 |  
 | 
      
        | LIBRARY IEEE, common_pkg_lib, common_ram_lib, common_counter_lib, mm_lib, technology_lib, dp_pkg_lib;
 | LIBRARY IEEE, common_pkg_lib, astron_ram_lib, astron_counter_lib, astron_mm_lib, dp_pkg_lib;
 | 
      
        | USE IEEE.std_logic_1164.ALL;
 | USE IEEE.std_logic_1164.ALL;
 | 
      
        | USE common_pkg_lib.common_pkg.ALL;
 | USE common_pkg_lib.common_pkg.ALL;
 | 
      
        | USE common_ram_lib.common_ram_pkg.ALL;
 | USE astron_ram_lib.common_ram_pkg.ALL;
 | 
      
        | USE mm_lib.common_field_pkg.ALL;
 | USE astron_mm_lib.common_field_pkg.ALL;
 | 
      
        | USE dp_pkg_lib.dp_stream_pkg.ALL;
 | USE dp_pkg_lib.dp_stream_pkg.ALL;
 | 
      
        | USE technology_lib.technology_select_pkg.ALL;
 | --USE technology_lib.technology_select_pkg.ALL;
 | 
      
        |  
 |  
 | 
      
        | -- Purpose:
 | -- Purpose:
 | 
      
        | --   Store the (auto)power statistics of a complex input stream with
 | --   Store the (auto)power statistics of a complex input stream with
 | 
      
        | --   blocks of nof_stat multiplexed subbands into a MM register.
 | --   blocks of nof_stat multiplexed subbands into a MM register.
 | 
      
        | -- Description:                                                          
 | -- Description:                                                          
 | 
      
        | Line 52... | Line 52... | 
      
        | -- . The minimum g_nof_stat = 8. Lower values lead to simulation errors. This is
 | -- . The minimum g_nof_stat = 8. Lower values lead to simulation errors. This is
 | 
      
        | --   due to the read latency of 2 of the accumulation memory in the st_calc entity. 
 | --   due to the read latency of 2 of the accumulation memory in the st_calc entity. 
 | 
      
        |  
 |  
 | 
      
        | ENTITY st_sst IS
 | ENTITY st_sst IS
 | 
      
        |   GENERIC (
 |   GENERIC (
 | 
      
        |     g_technology    : NATURAL := c_tech_select_default;
 |     g_technology    : NATURAL := 0;
 | 
      
        |     g_nof_stat      : NATURAL := 512;   -- nof accumulators
 |     g_nof_stat      : NATURAL := 512;   -- nof accumulators
 | 
      
        |     g_xst_enable    : BOOLEAN := FALSE; -- when set to true, an extra memory is instantiated to hold the imaginary part of the cross-correlation results
 |     g_xst_enable    : BOOLEAN := FALSE; -- when set to true, an extra memory is instantiated to hold the imaginary part of the cross-correlation results
 | 
      
        |     g_in_data_w     : NATURAL := 18;    -- width o dth edata to be accumulated
 |     g_in_data_w     : NATURAL := 18;    -- width o dth edata to be accumulated
 | 
      
        |     g_stat_data_w   : NATURAL := 54;    -- statistics accumulator width
 |     g_stat_data_w   : NATURAL := 54;    -- statistics accumulator width
 | 
      
        |     g_stat_data_sz  : NATURAL := 2      -- statistics word width >= statistics accumulator width and fit in a power of 2 multiple 32b MM words
 |     g_stat_data_sz  : NATURAL := 2      -- statistics word width >= statistics accumulator width and fit in a power of 2 multiple 32b MM words
 | 
      
        | Line 127... | Line 127... | 
      
        | BEGIN
 | BEGIN
 | 
      
        |  
 |  
 | 
      
        |   ------------------------------------------------------------------------------
 |   ------------------------------------------------------------------------------
 | 
      
        |   -- Register map for the treshold register
 |   -- Register map for the treshold register
 | 
      
        |   ------------------------------------------------------------------------------
 |   ------------------------------------------------------------------------------
 | 
      
        |   register_map : ENTITY mm_lib.mm_fields
 |   register_map : ENTITY astron_mm_lib.mm_fields
 | 
      
        |   GENERIC MAP(
 |   GENERIC MAP(
 | 
      
        |     g_cross_clock_domain => TRUE,
 |     g_cross_clock_domain => TRUE,
 | 
      
        |     g_field_arr          => c_field_arr
 |     g_field_arr          => c_field_arr
 | 
      
        |   )
 |   )
 | 
      
        |   PORT MAP (
 |   PORT MAP (
 | 
      
        | Line 181... | Line 181... | 
      
        |  
 |  
 | 
      
        |   ------------------------------------------------------------------------------
 |   ------------------------------------------------------------------------------
 | 
      
        |   -- Counter used to detect when treshold is reached in order to load new 
 |   -- Counter used to detect when treshold is reached in order to load new 
 | 
      
        |   -- input vlaues for the multiplier. 
 |   -- input vlaues for the multiplier. 
 | 
      
        |   ------------------------------------------------------------------------------
 |   ------------------------------------------------------------------------------
 | 
      
        |   treshold_cnt : ENTITY common_counter_lib.common_counter
 |   treshold_cnt : ENTITY astron_counter_lib.common_counter
 | 
      
        |   GENERIC MAP(
 |   GENERIC MAP(
 | 
      
        |     g_latency   => 1,
 |     g_latency   => 1,
 | 
      
        |     g_init      => 0,
 |     g_init      => 0,
 | 
      
        |     g_width     => c_nof_stat_w,
 |     g_width     => c_nof_stat_w,
 | 
      
        |     g_max       => 0,
 |     g_max       => 0,
 | 
      
        | Line 229... | Line 229... | 
      
        |   );
 |   );
 | 
      
        |  
 |  
 | 
      
        |   wrdata_re <= RESIZE_MEM_UDATA(stat_data_re);
 |   wrdata_re <= RESIZE_MEM_UDATA(stat_data_re);
 | 
      
        |   wrdata_im <= RESIZE_MEM_UDATA(stat_data_im);
 |   wrdata_im <= RESIZE_MEM_UDATA(stat_data_im);
 | 
      
        |  
 |  
 | 
      
        |   stat_reg_re : ENTITY common_ram_lib.common_ram_crw_crw_ratio
 |   stat_reg_re : ENTITY astron_ram_lib.common_ram_crw_crw_ratio
 | 
      
        |   GENERIC MAP (
 |   GENERIC MAP (
 | 
      
        |     g_technology => g_technology,
 |     g_technology => g_technology,
 | 
      
        |     g_ram_a      => c_mm_ram,
 |     g_ram_a      => c_mm_ram,
 | 
      
        |     g_ram_b      => c_stat_ram,
 |     g_ram_b      => c_stat_ram,
 | 
      
        |     g_init_file  => "UNUSED"
 |     g_init_file  => "UNUSED"
 | 
      
        | Line 269... | Line 269... | 
      
        |     ---------------------------------------------------------------
 |     ---------------------------------------------------------------
 | 
      
        |     -- COMBINE MEMORY MAPPED INTERFACES
 |     -- COMBINE MEMORY MAPPED INTERFACES
 | 
      
        |     ---------------------------------------------------------------
 |     ---------------------------------------------------------------
 | 
      
        |     -- Combine the internal array of mm interfaces for both real
 |     -- Combine the internal array of mm interfaces for both real
 | 
      
        |     -- and imaginary part. 
 |     -- and imaginary part. 
 | 
      
        |     u_mem_mux_select : entity mm_lib.common_mem_mux
 |     u_mem_mux_select : entity astron_mm_lib.common_mem_mux
 | 
      
        |     generic map (
 |     generic map (
 | 
      
        |       g_nof_mosi    => c_nof_complex,
 |       g_nof_mosi    => c_nof_complex,
 | 
      
        |       g_mult_addr_w => c_nof_word_w
 |       g_mult_addr_w => c_nof_word_w
 | 
      
        |     )
 |     )
 | 
      
        |     port map (
 |     port map (
 | 
      
        | Line 281... | Line 281... | 
      
        |       miso     => ram_st_sst_miso,
 |       miso     => ram_st_sst_miso,
 | 
      
        |       mosi_arr => ram_st_sst_mosi_arr,
 |       mosi_arr => ram_st_sst_mosi_arr,
 | 
      
        |       miso_arr => ram_st_sst_miso_arr
 |       miso_arr => ram_st_sst_miso_arr
 | 
      
        |     );
 |     );
 | 
      
        |  
 |  
 | 
      
        |     stat_reg_im : ENTITY common_ram_lib.common_ram_crw_crw_ratio
 |     stat_reg_im : ENTITY astron_ram_lib.common_ram_crw_crw_ratio
 | 
      
        |     GENERIC MAP (
 |     GENERIC MAP (
 | 
      
        |       g_technology => g_technology,
 |       g_technology => g_technology,
 | 
      
        |       g_ram_a      => c_mm_ram,
 |       g_ram_a      => c_mm_ram,
 | 
      
        |       g_ram_b      => c_stat_ram,
 |       g_ram_b      => c_stat_ram,
 | 
      
        |       g_init_file  => "UNUSED"
 |       g_init_file  => "UNUSED"
 |