Skip to content
Snippets Groups Projects
Commit e614af7b authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Merge branch 'L2SDP-170' into 'master'

Resolve L2SDP-170

Closes L2SDP-170

See merge request desp/hdl!57
parents e31e1154 ef1536bc
Branches
No related tags found
2 merge requests!100Removed text for XSub that is now written in Confluence Subband correlator...,!57Resolve L2SDP-170
hdl_lib_name = lofar2_sdp hdl_lib_name = lofar2_sdp
hdl_library_clause_name = lofar2_sdp_lib hdl_library_clause_name = lofar2_sdp_lib
hdl_lib_uses_synth = common dp wpfb rTwoSDF filter si st technology mm dp diag aduh tech_jesd204b tr_10GbE hdl_lib_uses_synth = common dp wpfb rTwoSDF filter si st reorder technology mm dp diag aduh tech_jesd204b tr_10GbE
hdl_lib_uses_sim = hdl_lib_uses_sim =
hdl_lib_technology = hdl_lib_technology =
...@@ -13,6 +13,7 @@ synth_files = ...@@ -13,6 +13,7 @@ synth_files =
src/vhdl/sdp_beamformer_output.vhd src/vhdl/sdp_beamformer_output.vhd
src/vhdl/node_sdp_adc_input_and_timing.vhd src/vhdl/node_sdp_adc_input_and_timing.vhd
src/vhdl/node_sdp_filterbank.vhd src/vhdl/node_sdp_filterbank.vhd
src/vhdl/node_sdp_beamformer.vhd
test_bench_files = test_bench_files =
regression_test_vhdl = regression_test_vhdl =
......
-------------------------------------------------------------------------------
--
-- 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:
-- . Implements the functionality of the Beamformer (BF) in the
-- LOFAR2 SDPFW design.
-- Description:
-- Remark:
-- .
-------------------------------------------------------------------------------
LIBRARY IEEE, common_lib, dp_lib, reorder_lib, st_lib;
USE IEEE.STD_LOGIC_1164.ALL;
USE common_lib.common_pkg.ALL;
USE common_lib.common_mem_pkg.ALL;
USE common_lib.common_network_layers_pkg.ALL;
USE dp_lib.dp_stream_pkg.ALL;
USE work.sdp_pkg.ALL;
ENTITY node_sdp_beamformer IS
GENERIC (
g_sim : BOOLEAN := FALSE;
g_beamset_id : NATURAL := 0;
g_scope_selected_beamlet : NATURAL := 0
);
PORT (
dp_clk : IN STD_LOGIC;
dp_rst : IN STD_LOGIC;
in_sosi_arr : IN t_dp_sosi_arr(c_sdp_P_pfb-1 DOWNTO 0);
bf_udp_sosi : OUT t_dp_sosi;
bf_udp_siso : IN t_dp_siso;
bst_udp_sosi : OUT t_dp_sosi;
mm_rst : IN STD_LOGIC;
mm_clk : IN STD_LOGIC;
ram_ss_ss_wide_mosi : IN t_mem_mosi := c_mem_mosi_rst;
ram_ss_ss_wide_miso : OUT t_mem_miso;
ram_bf_weights_mosi : IN t_mem_mosi := c_mem_mosi_rst;
ram_bf_weights_miso : OUT t_mem_miso;
reg_bf_scale_mosi : IN t_mem_mosi := c_mem_mosi_rst;
reg_bf_scale_miso : OUT t_mem_miso;
reg_hdr_dat_mosi : IN t_mem_mosi := c_mem_mosi_rst;
reg_hdr_dat_miso : OUT t_mem_miso;
reg_dp_xonoff_mosi : IN t_mem_mosi := c_mem_mosi_rst;
reg_dp_xonoff_miso : OUT t_mem_miso;
ram_st_sst_mosi : IN t_mem_mosi := c_mem_mosi_rst;
ram_st_sst_miso : OUT t_mem_miso;
sdp_info : IN t_sdp_info;
gn_id : IN STD_LOGIC_VECTOR(c_sdp_W_gn_id-1 DOWNTO 0);
eth_src_mac : IN STD_LOGIC_VECTOR(c_network_eth_mac_addr_w-1 DOWNTO 0);
ip_src_addr : IN STD_LOGIC_VECTOR(c_network_ip_addr_w-1 DOWNTO 0);
udp_src_port : IN STD_LOGIC_VECTOR(c_network_udp_port_w-1 DOWNTO 0);
hdr_fields_out : OUT STD_LOGIC_VECTOR(1023 DOWNTO 0)
);
END node_sdp_beamformer;
ARCHITECTURE str OF node_sdp_beamformer IS
CONSTANT c_bf_select_file_prefix : STRING := "UNUSED";
CONSTANT c_bf_weights_file_name : STRING := "UNUSED";
SIGNAL bsel_sosi_arr : t_dp_sosi_arr(c_sdp_P_pfb-1 DOWNTO 0) := (OTHERS => c_dp_sosi_rst);
SIGNAL local_bf_sosi : t_dp_sosi := c_dp_sosi_rst;
SIGNAL bf_sum_sosi : t_dp_sosi := c_dp_sosi_rst;
SIGNAL bf_out_sosi : t_dp_sosi := c_dp_sosi_rst;
SIGNAL scope_local_bf_sosi_arr : t_dp_sosi_integer_arr(c_sdp_N_pol-1 DOWNTO 0);
SIGNAL scope_bf_sum_sosi_arr : t_dp_sosi_integer_arr(c_sdp_N_pol-1 DOWNTO 0);
SIGNAL scope_bf_out_sosi_arr : t_dp_sosi_integer_arr(c_sdp_N_pol-1 DOWNTO 0);
BEGIN
---------------------------------------------------------------
-- Beamlet Subband Select
---------------------------------------------------------------
u_reorder_col_wide : ENTITY reorder_lib.reorder_col_wide
GENERIC MAP (
g_wb_factor => c_sdp_P_pfb, -- g_wb_factor is only used for number of parallel streams
g_dsp_data_w => c_sdp_W_subband,
g_nof_ch_in => c_sdp_N_sub * c_sdp_Q_fft,
g_nof_ch_sel => c_sdp_S_sub_bf * c_sdp_Q_fft,
g_select_file_prefix => c_bf_select_file_prefix,
g_use_complex => TRUE
)
PORT MAP(
input_sosi_arr => in_sosi_arr,
output_sosi_arr => bsel_sosi_arr,
ram_ss_ss_wide_mosi => ram_ss_ss_wide_mosi,
ram_ss_ss_wide_miso => ram_ss_ss_wide_miso,
mm_rst => mm_rst,
mm_clk => mm_clk,
dp_clk => dp_clk,
dp_rst => dp_rst
);
---------------------------------------------------------------
-- Local BF
---------------------------------------------------------------
u_sdp_beamformer_local : ENTITY work.sdp_beamformer_local
GENERIC MAP (
g_bf_weights_file_name => c_bf_weights_file_name
)
PORT MAP (
dp_rst => dp_rst,
dp_clk => dp_clk,
mm_rst => mm_rst,
mm_clk => mm_clk,
ram_bf_weights_mosi => ram_bf_weights_mosi,
ram_bf_weights_miso => ram_bf_weights_miso,
in_sosi_arr => bsel_sosi_arr,
out_sosi => local_bf_sosi
);
---------------------------------------------------------------
-- Remote BF
---------------------------------------------------------------
-- Not yet implemented
bf_sum_sosi <= local_bf_sosi;
---------------------------------------------------------------
-- Scale Beamlets
---------------------------------------------------------------
u_mms_dp_scale : ENTITY dp_lib.mms_dp_scale
GENERIC MAP (
g_complex_data => TRUE,
g_complex_gain => FALSE,
g_gain_init_re => 2**(c_sdp_W_beamlet_scale-1),
g_gain_w => c_sdp_W_beamlet_scale,
g_in_dat_w => c_sdp_W_beamlet_sum,
g_out_dat_w => c_sdp_W_beamlet,
g_lsb_w => c_sdp_W_beamlet_scale-1,
g_lsb_round => TRUE,
g_lsb_round_clip => FALSE,
g_msb_clip => TRUE,
g_msb_clip_symmetric => TRUE
)
PORT MAP(
dp_clk => dp_clk,
dp_rst => dp_rst,
in_sosi => bf_sum_sosi,
out_sosi => bf_out_sosi,
mm_rst => mm_rst,
mm_clk => mm_clk,
reg_gain_re_mosi => reg_bf_scale_mosi,
reg_gain_re_miso => reg_bf_scale_miso
);
---------------------------------------------------------------
-- Beamlet Data Output (BDO)
---------------------------------------------------------------
u_sdp_beamformer_output : ENTITY work.sdp_beamformer_output
GENERIC MAP(
g_beamset_id => g_beamset_id
)
PORT MAP (
mm_rst => mm_rst,
mm_clk => mm_clk,
dp_rst => dp_rst,
dp_clk => dp_clk,
in_sosi => bf_out_sosi,
out_sosi => bf_udp_sosi,
src_in => bf_udp_siso,
sdp_info => sdp_info,
gn_id => gn_id,
eth_src_mac => eth_src_mac,
ip_src_addr => ip_src_addr,
udp_src_port => udp_src_port,
hdr_fields_out => hdr_fields_out,
reg_hdr_dat_mosi => reg_hdr_dat_mosi,
reg_hdr_dat_miso => reg_hdr_dat_miso,
reg_dp_xonoff_mosi => reg_dp_xonoff_mosi,
reg_dp_xonoff_miso => reg_dp_xonoff_miso
);
---------------------------------------------------------------
-- Beamlet Statistics (BST)
---------------------------------------------------------------
u_beamlet_stats : ENTITY st_lib.st_sst
GENERIC MAP(
g_nof_stat => c_sdp_S_sub_bf*c_sdp_N_pol,
g_in_data_w => c_sdp_W_beamlet_sum,
g_stat_data_w => c_longword_w,
g_stat_data_sz => c_longword_sz/c_word_sz
)
PORT MAP (
mm_rst => mm_rst,
mm_clk => mm_clk,
dp_rst => dp_rst,
dp_clk => dp_clk,
in_complex => bf_sum_sosi,
ram_st_sst_mosi => ram_st_sst_mosi,
ram_st_sst_miso => ram_st_sst_miso
);
---------------------------------------------------------------
-- MM master multiplexer
---------------------------------------------------------------
-- Not yet implemented
---------------------------------------------------------------
-- BST UDP offload
---------------------------------------------------------------
-- Not yet implemented
---------------------------------------------------------------
-- SIGNAL SCOPES
---------------------------------------------------------------
u_sdp_scope_local_bf : ENTITY work.sdp_scope
GENERIC MAP (
g_sim => g_sim,
g_selection => g_scope_selected_beamlet,
g_nof_input => 1,
g_n_deinterleave => c_sdp_N_pol,
g_dat_w => c_sdp_W_beamlet_sum
)
PORT MAP (
clk => dp_clk,
rst => dp_rst,
sp_sosi_arr(0) => local_bf_sosi,
scope_sosi_arr => scope_local_bf_sosi_arr
);
u_sdp_scope_bf_sum : ENTITY work.sdp_scope
GENERIC MAP (
g_sim => g_sim,
g_selection => g_scope_selected_beamlet,
g_nof_input => 1,
g_n_deinterleave => c_sdp_N_pol,
g_dat_w => c_sdp_W_beamlet_sum
)
PORT MAP (
clk => dp_clk,
rst => dp_rst,
sp_sosi_arr(0) => bf_sum_sosi,
scope_sosi_arr => scope_bf_sum_sosi_arr
);
u_sdp_scope_bf_out : ENTITY work.sdp_scope
GENERIC MAP (
g_sim => g_sim,
g_selection => g_scope_selected_beamlet,
g_nof_input => 1,
g_n_deinterleave => c_sdp_N_pol,
g_dat_w => c_sdp_W_beamlet
)
PORT MAP (
clk => dp_clk,
rst => dp_rst,
sp_sosi_arr(0) => bf_out_sosi,
scope_sosi_arr => scope_bf_out_sosi_arr
);
END str;
...@@ -246,7 +246,10 @@ BEGIN ...@@ -246,7 +246,10 @@ BEGIN
u_sdp_scope : ENTITY work.sdp_scope u_sdp_scope : ENTITY work.sdp_scope
GENERIC MAP ( GENERIC MAP (
g_sim => g_sim, g_sim => g_sim,
g_selected_subband => g_scope_selected_subband g_selection => g_scope_selected_subband,
g_nof_input => c_sdp_P_pfb,
g_n_deinterleave => c_sdp_Q_fft,
g_dat_w => c_sdp_W_subband
) )
PORT MAP ( PORT MAP (
clk => dp_clk, clk => dp_clk,
......
...@@ -34,6 +34,7 @@ USE IEEE.NUMERIC_STD.ALL; ...@@ -34,6 +34,7 @@ USE IEEE.NUMERIC_STD.ALL;
USE common_lib.common_pkg.ALL; USE common_lib.common_pkg.ALL;
USE common_lib.common_field_pkg.ALL; USE common_lib.common_field_pkg.ALL;
USE common_lib.common_mem_pkg.ALL; USE common_lib.common_mem_pkg.ALL;
USE common_lib.common_network_layers_pkg.ALL;
USE dp_lib.dp_stream_pkg.ALL; USE dp_lib.dp_stream_pkg.ALL;
USE work.sdp_pkg.ALL; USE work.sdp_pkg.ALL;
...@@ -60,11 +61,11 @@ ENTITY sdp_beamformer_output IS ...@@ -60,11 +61,11 @@ ENTITY sdp_beamformer_output IS
src_in : IN t_dp_siso; src_in : IN t_dp_siso;
sdp_info : IN t_sdp_info; sdp_info : IN t_sdp_info;
gn_id : IN STD_LOGIC_VECTOR(4 DOWNTO 0); gn_id : IN STD_LOGIC_VECTOR(c_sdp_W_gn_id-1 DOWNTO 0);
eth_src_mac : IN STD_LOGIC_VECTOR(47 DOWNTO 0); eth_src_mac : IN STD_LOGIC_VECTOR(c_network_eth_mac_addr_w-1 DOWNTO 0);
ip_src_addr : IN STD_LOGIC_VECTOR(31 DOWNTO 0); ip_src_addr : IN STD_LOGIC_VECTOR(c_network_ip_addr_w-1 DOWNTO 0);
udp_src_port : IN STD_LOGIC_VECTOR(15 DOWNTO 0); udp_src_port : IN STD_LOGIC_VECTOR(c_network_udp_port_w-1 DOWNTO 0);
hdr_fields_out : OUT STD_LOGIC_VECTOR(1023 DOWNTO 0) hdr_fields_out : OUT STD_LOGIC_VECTOR(1023 DOWNTO 0)
); );
......
...@@ -84,6 +84,8 @@ PACKAGE sdp_pkg is ...@@ -84,6 +84,8 @@ PACKAGE sdp_pkg is
CONSTANT c_sdp_W_bf_product : NATURAL := c_sdp_W_subband + c_sdp_W_bf_weight -1; CONSTANT c_sdp_W_bf_product : NATURAL := c_sdp_W_subband + c_sdp_W_bf_weight -1;
CONSTANT c_sdp_W_beamlet_sum : NATURAL := 18; CONSTANT c_sdp_W_beamlet_sum : NATURAL := 18;
CONSTANT c_sdp_W_beamlet : NATURAL := 8; CONSTANT c_sdp_W_beamlet : NATURAL := 8;
CONSTANT c_sdp_W_beamlet_scale : NATURAL := 16;
CONSTANT c_sdp_W_gn_id : NATURAL := 5;
-- AIT constants -- AIT constants
CONSTANT c_sdp_ait_buf_nof_data_jesd : NATURAL := 1024; -- 1024 14 bit samples fit in one M20k BRAM CONSTANT c_sdp_ait_buf_nof_data_jesd : NATURAL := 1024; -- 1024 14 bit samples fit in one M20k BRAM
......
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
-- Author: R. van der Walle -- Author: R. van der Walle
-- Purpose: -- Purpose:
-- . Scope component to show the desired subband from the PFB output in the wave -- . Scope component to show the desired time index (beamlet/subband) from
-- window. -- the sp_sosi_arr input in the wave window based on g_selection.
-- Description: -- Description:
-- First deinterleaves the input then feed that to dp_wideband_sp_arr_scope.
-- Remark: -- Remark:
-- . Only for simulation. -- . Only for simulation.
-- . g_selected_subband can be 0 - 511.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
LIBRARY IEEE, common_lib, dp_lib; LIBRARY IEEE, common_lib, dp_lib;
...@@ -40,45 +40,54 @@ USE work.sdp_pkg.ALL; ...@@ -40,45 +40,54 @@ USE work.sdp_pkg.ALL;
ENTITY sdp_scope IS ENTITY sdp_scope IS
GENERIC ( GENERIC (
g_sim : BOOLEAN := FALSE; g_sim : BOOLEAN := FALSE;
g_selected_subband : NATURAL := 0 g_selection : NATURAL := 0; -- Time index selection (subband/beamlet)
g_nof_input : NATURAL := 2; -- nof input streams
g_n_deinterleave : NATURAL := 2; -- deinterleave factor for each input stream
g_dat_w : NATURAL := 18 -- Data width
); );
PORT ( PORT (
clk : IN STD_LOGIC; clk : IN STD_LOGIC;
rst : IN STD_LOGIC; rst : IN STD_LOGIC;
-- Streaming input for P_pfb complex streams -- Streaming input for complex streams
sp_sosi_arr : IN t_dp_sosi_arr(c_sdp_P_pfb-1 DOWNTO 0); sp_sosi_arr : IN t_dp_sosi_arr(g_nof_input-1 DOWNTO 0);
-- Scope output for S_pn streams -- Scope output for deinterleaved streams
scope_sosi_arr : OUT t_dp_sosi_integer_arr(c_sdp_S_pn-1 DOWNTO 0) scope_sosi_arr : OUT t_dp_sosi_integer_arr(g_nof_input*g_n_deinterleave-1 DOWNTO 0)
); );
END sdp_scope; END sdp_scope;
ARCHITECTURE str OF sdp_scope IS ARCHITECTURE str OF sdp_scope IS
TYPE t_dp_sosi_2arr_n IS ARRAY (INTEGER RANGE <>) OF t_dp_sosi_arr(g_n_deinterleave-1 DOWNTO 0);
SIGNAL cnt : NATURAL; SIGNAL cnt : NATURAL;
SIGNAL deinterleaved_sosi_arr : t_dp_sosi_arr(c_sdp_S_pn-1 DOWNTO 0); SIGNAL deinterleaved_sosi_2arr_n : t_dp_sosi_2arr_n(g_nof_input-1 DOWNTO 0);
SIGNAL subband_sosi_arr : t_dp_sosi_arr(c_sdp_S_pn-1 DOWNTO 0) := (OTHERS=>c_dp_sosi_rst); SIGNAL deinterleaved_sosi_arr : t_dp_sosi_arr(g_nof_input*g_n_deinterleave-1 DOWNTO 0);
SIGNAL selected_sosi_arr : t_dp_sosi_arr(g_nof_input*g_n_deinterleave-1 DOWNTO 0) := (OTHERS=>c_dp_sosi_rst);
BEGIN BEGIN
sim_only : IF g_sim=TRUE GENERATE sim_only : IF g_sim=TRUE GENERATE
gen_deinterleave : FOR I IN 0 TO c_sdp_P_pfb-1 GENERATE gen_deinterleave : FOR I IN 0 TO g_nof_input-1 GENERATE
u_dp_deinterleave : ENTITY dp_lib.dp_deinterleave_one_to_n u_dp_deinterleave : ENTITY dp_lib.dp_deinterleave_one_to_n
GENERIC MAP( GENERIC MAP(
g_pipeline => 0, g_pipeline => 0,
g_nof_outputs => c_sdp_Q_fft g_nof_outputs => g_n_deinterleave
) )
PORT MAP( PORT MAP(
rst => rst, rst => rst,
clk => clk, clk => clk,
snk_in => sp_sosi_arr(I), snk_in => sp_sosi_arr(I),
src_out_arr(0) => deinterleaved_sosi_arr(2*I), src_out_arr => deinterleaved_sosi_2arr_n(I)
src_out_arr(1) => deinterleaved_sosi_arr(2*I+1)
); );
gen_flat : FOR J IN 0 TO g_n_deinterleave-1 GENERATE
deinterleaved_sosi_arr(g_n_deinterleave*I+J) <= deinterleaved_sosi_2arr_n(I)(J);
END GENERATE;
END GENERATE; END GENERATE;
p_cnt : PROCESS(rst, clk) p_cnt : PROCESS(rst, clk)
...@@ -96,8 +105,8 @@ BEGIN ...@@ -96,8 +105,8 @@ BEGIN
END IF; END IF;
END PROCESS; END PROCESS;
-- Select subband -- Select desired index.
subband_sosi_arr <= deinterleaved_sosi_arr WHEN cnt = g_selected_subband; selected_sosi_arr <= deinterleaved_sosi_arr WHEN cnt = g_selection;
--------------------------------------------------------------- ---------------------------------------------------------------
-- SIGNAL SCOPE -- SIGNAL SCOPE
...@@ -107,13 +116,13 @@ BEGIN ...@@ -107,13 +116,13 @@ BEGIN
g_sim => g_sim, g_sim => g_sim,
g_use_sclk => FALSE, g_use_sclk => FALSE,
g_complex => TRUE, g_complex => TRUE,
g_nof_streams => c_sdp_S_pn, g_nof_streams => g_nof_input*g_n_deinterleave,
g_wideband_factor => 1, g_wideband_factor => 1,
g_dat_w => c_sdp_W_subband g_dat_w => g_dat_w
) )
PORT MAP ( PORT MAP (
DCLK => clk, DCLK => clk,
sp_sosi_arr => subband_sosi_arr, sp_sosi_arr => selected_sosi_arr,
scope_sosi_arr => scope_sosi_arr scope_sosi_arr => scope_sosi_arr
); );
END GENERATE; END GENERATE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment