Skip to content
Snippets Groups Projects
Commit 1e3c2fe4 authored by Daniel van der Schuur's avatar Daniel van der Schuur
Browse files

-Added channel forwarding.

parent d25aea00
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
......@@ -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;
......@@ -142,6 +152,9 @@ BEGIN
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_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 (
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment