Skip to content
Snippets Groups Projects
Commit c8eacf10 authored by Reinier van der Walle's avatar Reinier van der Walle
Browse files

Initial commit of the lofar2_sdp library and node_sdp_filterbank

parent dfa03a95
No related branches found
No related tags found
1 merge request!38Resolve L2SDP-130
hdl_lib_name = lofar2_sdp
hdl_library_clause_name = lofar2_sdp_lib
hdl_lib_uses_synth = common dp wpfb rTwoSDF filter si st
hdl_lib_uses_sim =
hdl_lib_technology =
synth_files =
src/vhdl/node_sdp_filterbank.vhd
test_bench_files =
regression_test_vhdl =
[modelsim_project_file]
[quartus_project_file]
-------------------------------------------------------------------------------
--
-- Copyright 2020
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
--
-- Author: R. van der Walle
-- Purpose: .
-- Description:
-- .
-- Remark:
-- .
-------------------------------------------------------------------------------
LIBRARY IEEE, common_lib, dp_lib, rTwoSDF_lib, wpfb_lib, filter_lib, si_lib, st_lib;
USE IEEE.STD_LOGIC_1164.ALL;
USE common_lib.common_pkg.ALL;
USE common_lib.common_mem_pkg.ALL;
USE dp_lib.dp_stream_pkg.ALL;
USE rTwoSDF_lib.rTwoSDFPkg.ALL;
USE filter_lib.fil_pkg.ALL;
USE wpfb_lib.wpfb_pkg.ALL;
ENTITY node_sdp_filterbank IS
GENERIC (
g_nof_streams : NATURAL := 12 -- CONSTANT
);
PORT (
dp_clk : IN STD_LOGIC;
dp_rst : IN STD_LOGIC;
in_sosi_arr : IN t_dp_sosi_arr(g_nof_streams-1 DOWNTO 0);
pfb_sosi_arr : OUT t_dp_sosi_arr(g_nof_streams/2-1 DOWNTO 0);
mm_rst : IN STD_LOGIC;
mm_clk : IN STD_LOGIC;
reg_si_mosi : IN t_mem_mosi := c_mem_mosi_rst;
reg_si_miso : OUT t_mem_miso;
ram_st_sst_mosi : IN t_mem_mosi; -- Subband statistics registers
ram_st_sst_miso : OUT t_mem_miso := c_mem_miso_rst;
ram_fil_coefs_mosi : IN t_mem_mosi;
ram_fil_coefs_miso : OUT t_mem_miso := c_mem_miso_rst
);
END node_sdp_filterbank;
ARCHITECTURE str OF node_sdp_filterbank IS
CONSTANT c_wpfb_lofar_subbands : t_wpfb :=
(1, 1024, 0, 6,
16, 1, 14, 16, 16,
true, false, true, 16, 18, 1, 18, 2, true, 54, 2, 195313,
c_fft_pipeline, c_fft_pipeline, c_fil_ppf_pipeline);
CONSTANT c_in_dat_w : NATURAL := c_wpfb_lofar_subbands.fil_in_dat_w;
CONSTANT c_nof_channels : NATURAL := 2**c_wpfb_lofar_subbands.nof_chan;
CONSTANT c_nof_data_per_block : NATURAL := c_nof_channels * c_wpfb_lofar_subbands.nof_points;
CONSTANT c_nof_valid_per_block : NATURAL := c_nof_data_per_block / c_wpfb_lofar_subbands.wb_factor;
CONSTANT c_nof_stats : NATURAL := c_nof_valid_per_block;
CONSTANT c_coefs_file_prefix : STRING := "UNUSED"; --"data/coefs_wide";
SIGNAL ram_st_sst_mosi_arr : t_mem_mosi_arr(c_wpfb_lofar_subbands.nof_wb_streams*c_wpfb_lofar_subbands.wb_factor-1 DOWNTO 0);
SIGNAL ram_st_sst_miso_arr : t_mem_miso_arr(c_wpfb_lofar_subbands.nof_wb_streams*c_wpfb_lofar_subbands.wb_factor-1 DOWNTO 0) := (OTHERS => c_mem_miso_rst);
SIGNAL wpfb_unit_out_sosi_arr : t_dp_sosi_arr(c_wpfb_lofar_subbands.nof_wb_streams*c_wpfb_lofar_subbands.wb_factor-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst);
SIGNAL wpfb_unit_fil_sosi_arr : t_dp_sosi_arr(c_wpfb_lofar_subbands.nof_wb_streams*c_wpfb_lofar_subbands.wb_factor-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst);
SIGNAL wpfb_unit_in_sosi_arr : t_dp_sosi_arr(c_wpfb_lofar_subbands.nof_wb_streams*c_wpfb_lofar_subbands.wb_factor-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst);
SIGNAL si_sosi_arr : t_dp_sosi_arr(g_nof_streams-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst);
BEGIN
---------------------------------------------------------------
-- SPECTRAL INVERSION
---------------------------------------------------------------
u_si_arr : ENTITY si_lib.si_arr
GENERIC MAP (
g_nof_streams => g_nof_streams,
g_pipeline => 1,
g_dat_w => c_in_dat_w
)
PORT MAP(
in_sosi_arr => in_sosi_arr,
out_sosi_arr => si_sosi_arr,
reg_si_mosi => reg_si_mosi,
reg_si_miso => reg_si_miso,
mm_rst => mm_rst,
mm_clk => mm_clk,
dp_clk => dp_clk,
dp_rst => dp_rst
);
---------------------------------------------------------------
-- POLY-PHASE FILTERBANK
---------------------------------------------------------------
-- Connect the 12 ADC streams to the re and im fields of the PFB input.
p_pfb_streams : PROCESS(si_sosi_arr)
BEGIN
FOR I IN 0 TO c_wpfb_lofar_subbands.nof_wb_streams*c_wpfb_lofar_subbands.wb_factor-1 LOOP
wpfb_unit_in_sosi_arr(I) <= si_sosi_arr(2*I);
wpfb_unit_in_sosi_arr(I).re(c_in_dat_w-1 DOWNTO 0) <= si_sosi_arr(2*I).data(c_in_dat_w-1 DOWNTO 0);
wpfb_unit_in_sosi_arr(I).im(c_in_dat_w-1 DOWNTO 0) <= si_sosi_arr(2*I+1).data(c_in_dat_w-1 DOWNTO 0);
END LOOP;
END PROCESS;
-- PFB
u_wpfb_unit_dev : ENTITY wpfb_lib.wpfb_unit_dev
GENERIC MAP (
g_big_endian_wb_in => TRUE,
g_wpfb => c_wpfb_lofar_subbands,
g_dont_flip_channels => FALSE,
g_use_prefilter => TRUE,
g_stats_ena => FALSE,
g_use_bg => FALSE,
g_coefs_file_prefix => c_coefs_file_prefix
)
PORT MAP (
dp_rst => dp_rst,
dp_clk => dp_clk,
mm_rst => mm_rst,
mm_clk => mm_clk,
ram_fil_coefs_mosi => ram_fil_coefs_mosi,
ram_fil_coefs_miso => ram_fil_coefs_miso,
ram_st_sst_mosi => c_mem_mosi_rst,
ram_st_sst_miso => OPEN,
reg_bg_ctrl_mosi => c_mem_mosi_rst,
reg_bg_ctrl_miso => OPEN,
ram_bg_data_mosi => c_mem_mosi_rst,
ram_bg_data_miso => OPEN,
in_sosi_arr => wpfb_unit_in_sosi_arr,
fil_sosi_arr => wpfb_unit_fil_sosi_arr,
out_sosi_arr => wpfb_unit_out_sosi_arr
);
-- Output PFB streams
pfb_sosi_arr <= wpfb_unit_out_sosi_arr;
---------------------------------------------------------------
-- SUBBAND STATISTICS
---------------------------------------------------------------
gen_stats_streams: FOR S IN 0 TO c_wpfb_lofar_subbands.nof_wb_streams-1 GENERATE
gen_stats_wideband: FOR P IN 0 TO c_wpfb_lofar_subbands.wb_factor-1 GENERATE
u_subband_stats : ENTITY st_lib.st_sst
GENERIC MAP(
g_nof_stat => c_nof_stats,
g_in_data_w => c_wpfb_lofar_subbands.fft_out_dat_w,
g_stat_data_w => c_wpfb_lofar_subbands.stat_data_w,
g_stat_data_sz => c_wpfb_lofar_subbands.stat_data_sz
)
PORT MAP (
mm_rst => mm_rst,
mm_clk => mm_clk,
dp_rst => dp_rst,
dp_clk => dp_clk,
in_complex => wpfb_unit_out_sosi_arr(S*c_wpfb_lofar_subbands.wb_factor+P),
ram_st_sst_mosi => ram_st_sst_mosi_arr(S*c_wpfb_lofar_subbands.wb_factor+P),
ram_st_sst_miso => ram_st_sst_miso_arr(S*c_wpfb_lofar_subbands.wb_factor+P)
);
END GENERATE;
END GENERATE;
---------------------------------------------------------------
-- COMBINE MEMORY MAPPED INTERFACES
---------------------------------------------------------------
-- Combine the internal array of mm interfaces for the subband
-- statistics to one array.
u_mem_mux_sst : ENTITY common_lib.common_mem_mux
GENERIC MAP (
g_nof_mosi => c_wpfb_lofar_subbands.nof_wb_streams*c_wpfb_lofar_subbands.wb_factor,
g_mult_addr_w => ceil_log2(c_wpfb_lofar_subbands.stat_data_sz*c_nof_stats)
)
PORT MAP (
mosi => ram_st_sst_mosi,
miso => ram_st_sst_miso,
mosi_arr => ram_st_sst_mosi_arr,
miso_arr => ram_st_sst_miso_arr
);
END str;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment