diff --git a/libraries/base/dp/src/vhdl/dp_folder.vhd b/libraries/base/dp/src/vhdl/dp_folder.vhd index 98e6895f1bb42fba81f3537ee318502686c47278..f270241389c143676e45b137c9c42035b5cf28c7 100644 --- a/libraries/base/dp/src/vhdl/dp_folder.vhd +++ b/libraries/base/dp/src/vhdl/dp_folder.vhd @@ -47,7 +47,8 @@ ENTITY dp_folder IS g_nof_inputs : NATURAL; -- Number of inputs to fold >0 g_nof_folds : INTEGER := -1; -- >0: Number of folds; 0: Wire out to in; <0: Fold until one output remains g_output_block_size : NATURAL := 0; -- >0: Create SOP/EOP tagged output blocks of this size. 0: Forward incoming SOP,EOP. - g_fwd_sync_bsn : BOOLEAN := FALSE -- TRUE: forwards (stored) input Sync+BSN (from snk_in_arr(0)) to all output streams + g_fwd_sync_bsn : BOOLEAN := FALSE;-- TRUE: forwards (stored) input Sync+BSN (from snk_in_arr(0)) to all output streams + g_use_channel : BOOLEAN := FALSE -- TRUE: Also fold the channel field ); PORT ( clk : IN STD_LOGIC; @@ -65,7 +66,8 @@ ARCHITECTURE str OF dp_folder IS g_nof_inputs : NATURAL; g_nof_folds : INTEGER := -1; g_output_block_size : NATURAL := 0; - g_fwd_sync_bsn : BOOLEAN := FALSE + g_fwd_sync_bsn : BOOLEAN := FALSE; + g_use_channel : BOOLEAN := FALSE ); PORT ( rst : IN STD_LOGIC; @@ -122,11 +124,17 @@ BEGIN nxt_mux_src_out_arr(i).re <= mux_snk_in_2arr_2(i)(0).re; nxt_mux_src_out_arr(i).im <= mux_snk_in_2arr_2(i)(0).im; nxt_mux_src_out_arr(i).valid <= '1'; + IF g_use_channel=TRUE THEN + nxt_mux_src_out_arr(i).channel <= mux_snk_in_2arr_2(i)(0).channel; + END IF; ELSIF mux_snk_in_2arr_2(i)(1).valid='1' THEN nxt_mux_src_out_arr(i).data <= mux_snk_in_2arr_2(i)(1).data; nxt_mux_src_out_arr(i).re <= mux_snk_in_2arr_2(i)(1).re; nxt_mux_src_out_arr(i).im <= mux_snk_in_2arr_2(i)(1).im; nxt_mux_src_out_arr(i).valid <= '1'; + IF g_use_channel=TRUE THEN + nxt_mux_src_out_arr(i).channel <= mux_snk_in_2arr_2(i)(1).channel; + END IF; END IF; END LOOP; END PROCESS; @@ -152,7 +160,8 @@ BEGIN g_nof_inputs => c_nof_muxes, g_nof_folds => g_nof_folds-1, g_output_block_size => g_output_block_size, - g_fwd_sync_bsn => g_fwd_sync_bsn + g_fwd_sync_bsn => g_fwd_sync_bsn, + g_use_channel => g_use_channel ) PORT MAP ( rst => rst, @@ -182,7 +191,8 @@ BEGIN g_use_src_in => FALSE, g_nof_data => g_output_block_size, g_preserve_sync => TRUE, - g_preserve_bsn => TRUE + g_preserve_bsn => TRUE, + g_preserve_channel => g_use_channel ) PORT MAP( rst => rst, diff --git a/libraries/base/dp/src/vhdl/dp_unfolder.vhd b/libraries/base/dp/src/vhdl/dp_unfolder.vhd index e2d5343d0b0c1dbff8fed361acee9ea8814cbee8..b03cb5bba577f6453fb42bf452d5f44877c9984d 100644 --- a/libraries/base/dp/src/vhdl/dp_unfolder.vhd +++ b/libraries/base/dp/src/vhdl/dp_unfolder.vhd @@ -38,6 +38,7 @@ ENTITY dp_unfolder IS g_nof_unfolds : NATURAL := 0; -- Number of times to unfold g_output_block_size : NATURAL := 0; -- >0: Create SOP/EOP tagged output blocks of this size. g_fwd_sync_bsn : BOOLEAN := FALSE; -- TRUE: forwards (stored) input Sync+BSN (from snk_in_arr(0)) to all output streams + g_use_channel : BOOLEAN := FALSE;-- TRUE: Also fold the channel field g_output_align : BOOLEAN := TRUE -- TRUE: Use pipeline stages to align the outputs ); PORT ( @@ -56,6 +57,9 @@ ARCHITECTURE str OF dp_unfolder IS GENERIC ( g_nof_inputs : NATURAL; g_nof_unfolds : NATURAL := 0; + g_output_block_size : NATURAL := 0; + g_fwd_sync_bsn : BOOLEAN := FALSE; + g_use_channel : BOOLEAN := FALSE; g_output_align : BOOLEAN := TRUE ); PORT ( @@ -104,11 +108,17 @@ BEGIN nxt_demux_src_out_2arr_2(i)(0).re <= snk_in_arr(i).re; nxt_demux_src_out_2arr_2(i)(0).im <= snk_in_arr(i).im; nxt_demux_src_out_2arr_2(i)(0).valid <= '1'; + IF g_use_channel=TRUE THEN + nxt_demux_src_out_2arr_2(i)(0).channel <= snk_in_arr(i).channel; + END IF; ELSE nxt_demux_src_out_2arr_2(i)(1).data <= snk_in_arr(i).data; nxt_demux_src_out_2arr_2(i)(1).re <= snk_in_arr(i).re; nxt_demux_src_out_2arr_2(i)(1).im <= snk_in_arr(i).im; nxt_demux_src_out_2arr_2(i)(1).valid <= '1'; + IF g_use_channel=TRUE THEN + nxt_demux_src_out_2arr_2(i)(1).channel <= snk_in_arr(i).channel; + END IF; END IF; END IF; END LOOP; @@ -140,9 +150,12 @@ BEGIN gen_dp_unfolder: IF g_nof_unfolds>1 GENERATE u_dp_unfolder : dp_unfolder GENERIC MAP ( - g_nof_inputs => c_nof_demuxes*2, -- Next stage has all our demux outputs as inputs - g_nof_unfolds => g_nof_unfolds-1, - g_output_align => g_output_align + g_nof_inputs => c_nof_demuxes*2, -- Next stage has all our demux outputs as inputs + g_nof_unfolds => g_nof_unfolds-1, + g_output_block_size => g_output_block_size, + g_fwd_sync_bsn => g_fwd_sync_bsn, + g_use_channel => g_use_channel, + g_output_align => g_output_align ) PORT MAP ( rst => rst, @@ -193,7 +206,8 @@ BEGIN g_use_src_in => FALSE, g_nof_data => g_output_block_size, g_preserve_sync => TRUE, - g_preserve_bsn => TRUE + g_preserve_bsn => TRUE, + g_preserve_channel => g_use_channel ) PORT MAP( rst => rst,