diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_scope.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_scope.vhd index ace7425094185772a6addeb3769c373a061eff09..02350a12009e2476d488becfd6c5c0f8d29173dd 100644 --- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_scope.vhd +++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_scope.vhd @@ -23,12 +23,12 @@ -- Author: R. van der Walle -- Purpose: --- . Scope component to show the desired subband from the PFB output in the wave --- window. +-- . Scope component to show the desired time index (beamlet/subband) from +-- the sp_sosi_arr input in the wave window based on g_selection. -- Description: +-- First deinterleaves the input then feed that to dp_wideband_sp_arr_scope. -- Remark: -- . Only for simulation. --- . g_selected_subband can be 0 - 511. ------------------------------------------------------------------------------- LIBRARY IEEE, common_lib, dp_lib; @@ -40,45 +40,54 @@ USE work.sdp_pkg.ALL; ENTITY sdp_scope IS GENERIC ( g_sim : BOOLEAN := FALSE; - g_selected_subband : NATURAL := 0 + g_selection : NATURAL := 0; + g_nof_input : NATURAL := 2; + g_n_deinterleave : NATURAL := 2; + g_dat_w : NATURAL := 18 ); PORT ( clk : IN STD_LOGIC; rst : IN STD_LOGIC; - -- Streaming input for P_pfb complex streams - sp_sosi_arr : IN t_dp_sosi_arr(c_sdp_P_pfb-1 DOWNTO 0); + -- Streaming input for complex streams + sp_sosi_arr : IN t_dp_sosi_arr(g_nof_input-1 DOWNTO 0); - -- Scope output for S_pn streams - scope_sosi_arr : OUT t_dp_sosi_integer_arr(c_sdp_S_pn-1 DOWNTO 0) + -- Scope output for deinterleaved streams + scope_sosi_arr : OUT t_dp_sosi_integer_arr(g_nof_input*g_n_deinterleave-1 DOWNTO 0) ); END sdp_scope; ARCHITECTURE str OF sdp_scope IS - SIGNAL cnt : NATURAL; - SIGNAL deinterleaved_sosi_arr : t_dp_sosi_arr(c_sdp_S_pn-1 DOWNTO 0); - SIGNAL subband_sosi_arr : t_dp_sosi_arr(c_sdp_S_pn-1 DOWNTO 0) := (OTHERS=>c_dp_sosi_rst); + 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 deinterleaved_sosi_2arr_n : t_dp_sosi_2arr_n(g_nof_input-1 DOWNTO 0); + 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 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 GENERIC MAP( g_pipeline => 0, - g_nof_outputs => c_sdp_Q_fft + g_nof_outputs => g_n_deinterleave ) PORT MAP( rst => rst, clk => clk, snk_in => sp_sosi_arr(I), - src_out_arr(0) => deinterleaved_sosi_arr(2*I), - src_out_arr(1) => deinterleaved_sosi_arr(2*I+1) + src_out_arr => deinterleaved_sosi_2arr_n(I) ); + + 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; p_cnt : PROCESS(rst, clk) @@ -96,25 +105,25 @@ BEGIN END IF; END PROCESS; - -- Select subband - subband_sosi_arr <= deinterleaved_sosi_arr WHEN cnt = g_selected_subband; + -- Select desired index. + selected_sosi_arr <= deinterleaved_sosi_arr WHEN cnt = g_selection; --------------------------------------------------------------- -- SIGNAL SCOPE --------------------------------------------------------------- u_dp_wideband_sp_arr_scope : ENTITY dp_lib.dp_wideband_sp_arr_scope - GENERIC MAP ( - g_sim => g_sim, - g_use_sclk => FALSE, - g_complex => TRUE, - g_nof_streams => c_sdp_S_pn, - g_wideband_factor => 1, - g_dat_w => c_sdp_W_subband - ) - PORT MAP ( - DCLK => clk, - sp_sosi_arr => subband_sosi_arr, - scope_sosi_arr => scope_sosi_arr - ); + GENERIC MAP ( + g_sim => g_sim, + g_use_sclk => FALSE, + g_complex => TRUE, + g_nof_streams => g_nof_input*g_n_deinterleave, + g_wideband_factor => 1, + g_dat_w => g_dat_w + ) + PORT MAP ( + DCLK => clk, + sp_sosi_arr => selected_sosi_arr, + scope_sosi_arr => scope_sosi_arr + ); END GENERATE; END str;