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

Corrected sync_index=0, when c_nof_counters=2, because range(0,1,1) is not...

Corrected sync_index=0, when c_nof_counters=2, because range(0,1,1) is not supported by dp_counter.vhd causing a synthesis error.
parent f76dbcd4
Branches
No related tags found
No related merge requests found
...@@ -45,11 +45,18 @@ ...@@ -45,11 +45,18 @@
-- is that a next dp_block_reshape_sync instance that reshapes back to the -- is that a next dp_block_reshape_sync instance that reshapes back to the
-- original snk_in block size recovers them. -- original snk_in block size recovers them.
-- --
-- The src_index_arr[2:0] with sync index, sop index and valid index are also -- Sync index:
-- output. The sync index uses g_input_nof_data_per_sync and g_nof_counters -- The src_index_arr[2:0] with sync index, sop index and valid index are
-- = 3, instead of only 2. If the src_index_arr is left OPEN (unused), then -- also output. The sync index defaults to 0 and only counts if
-- this extra dp_counter level will get optimized away by synthesis and then -- c_nof_output_sync_per_input_sync > 1, which depends on
-- the value of g_input_nof_data_per_sync is don't care. -- g_input_nof_data_per_sync.
-- If g_input_nof_data_per_sync <= c_reshape_nof_data_per_sync, then the
-- sync index defaults to 0 and then the value of g_input_nof_data_per_sync
-- is don't care. Therefore use g_input_nof_data_per_sync = 0 or 1 to
-- effectively disable the use of sync_index.
-- The sync index counts using dp_counter level 2, so with c_nof_counters
-- = 3. If the sync index does not need to count, then c_nof_counters = 2,
-- because dp_counter cannot support range(0,1,1) = [0].
-- --
-- Remarks: -- Remarks:
-- . The dp_block_reshape_sync supports pipelining and flow control, because it -- . The dp_block_reshape_sync supports pipelining and flow control, because it
...@@ -65,7 +72,7 @@ USE work.dp_stream_pkg.ALL; ...@@ -65,7 +72,7 @@ USE work.dp_stream_pkg.ALL;
ENTITY dp_block_reshape_sync IS ENTITY dp_block_reshape_sync IS
GENERIC ( GENERIC (
g_input_nof_data_per_sync : NATURAL := 96; -- nof data per input sync interval, used only for sync_index g_input_nof_data_per_sync : NATURAL := 0; -- nof data per input sync interval, used only for sync_index
g_reshape_nof_data_per_blk : NATURAL := 8; -- nof data per output block g_reshape_nof_data_per_blk : NATURAL := 8; -- nof data per output block
g_reshape_nof_blk_per_sync : NATURAL := 12; -- nof blocks per output sync interval g_reshape_nof_blk_per_sync : NATURAL := 12; -- nof blocks per output sync interval
g_reshape_bsn : BOOLEAN := FALSE; -- when TRUE reshape BSN else when FALSE pass on BSN g_reshape_bsn : BOOLEAN := FALSE; -- when TRUE reshape BSN else when FALSE pass on BSN
...@@ -89,16 +96,20 @@ END dp_block_reshape_sync; ...@@ -89,16 +96,20 @@ END dp_block_reshape_sync;
ARCHITECTURE str OF dp_block_reshape_sync IS ARCHITECTURE str OF dp_block_reshape_sync IS
CONSTANT c_reshape_nof_data_per_sync : NATURAL := g_reshape_nof_data_per_blk * g_reshape_nof_blk_per_sync; CONSTANT c_reshape_nof_data_per_sync : NATURAL := g_reshape_nof_data_per_blk * g_reshape_nof_blk_per_sync;
-- If g_input_nof_data_per_sync <= c_reshape_nof_data_per_sync then c_nof_output_sync_per_input_sync = 1, else the
-- assumption is that g_input_nof_data_per_sync is an integer multiple of c_reshape_nof_data_per_sync.
CONSTANT c_nof_output_sync_per_input_sync : NATURAL := sel_a_b(g_input_nof_data_per_sync > c_reshape_nof_data_per_sync, CONSTANT c_nof_output_sync_per_input_sync : NATURAL := sel_a_b(g_input_nof_data_per_sync > c_reshape_nof_data_per_sync,
g_input_nof_data_per_sync / c_reshape_nof_data_per_sync, 1); g_input_nof_data_per_sync / c_reshape_nof_data_per_sync, 1);
CONSTANT c_nof_counters : NATURAL := 3; -- counter [0] is use for block reshape, -- counter [0] is use for block reshape,
-- counter [1] is used for sync reshape, -- counter [1] is used for sync reshape,
-- counter [2] is only used for sync_index -- counter [2] is only used for sync_index if c_nof_output_sync_per_input_sync > 1
CONSTANT c_nof_counters : NATURAL := sel_a_b(c_nof_output_sync_per_input_sync > 1, 3, 2);
CONSTANT c_range_start : t_nat_natural_arr(c_nof_counters-1 DOWNTO 0) := (OTHERS=>0); CONSTANT c_range_start : t_nat_natural_arr(c_nof_counters-1 DOWNTO 0) := (OTHERS=>0);
CONSTANT c_range_stop : t_nat_natural_arr(c_nof_counters-1 DOWNTO 0) := (c_nof_output_sync_per_input_sync, CONSTANT c_range_stop : t_nat_natural_arr(c_nof_counters-1 DOWNTO 0) := sel_a_b(c_nof_output_sync_per_input_sync > 1,
g_reshape_nof_blk_per_sync, (c_nof_output_sync_per_input_sync, g_reshape_nof_blk_per_sync, g_reshape_nof_data_per_blk),
g_reshape_nof_data_per_blk); (g_reshape_nof_blk_per_sync, g_reshape_nof_data_per_blk));
CONSTANT c_range_step : t_nat_natural_arr(c_nof_counters-1 DOWNTO 0) := (OTHERS=>1); CONSTANT c_range_step : t_nat_natural_arr(c_nof_counters-1 DOWNTO 0) := (OTHERS=>1);
SIGNAL cnt_sosi_arr : t_dp_sosi_arr(c_nof_counters-1 DOWNTO 0); SIGNAL cnt_sosi_arr : t_dp_sosi_arr(c_nof_counters-1 DOWNTO 0);
...@@ -150,6 +161,11 @@ BEGIN ...@@ -150,6 +161,11 @@ BEGIN
END GENERATE; END GENERATE;
sop_index <= TO_UINT(cnt_sosi_arr(1).data); sop_index <= TO_UINT(cnt_sosi_arr(1).data);
valid_index <= TO_UINT(cnt_sosi_arr(0).data); valid_index <= TO_UINT(cnt_sosi_arr(0).data);
src_index_arr(2) <= sync_index; -- default 0, counting if c_nof_output_sync_per_input_sync > 1
src_index_arr(1) <= sop_index;
src_index_arr(0) <= valid_index;
output_sync <= cnt_sosi_arr(1).sop; output_sync <= cnt_sosi_arr(1).sop;
output_sop <= cnt_sosi_arr(0).sop; output_sop <= cnt_sosi_arr(0).sop;
output_eop <= cnt_sosi_arr(0).eop; output_eop <= cnt_sosi_arr(0).eop;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment