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

Corrected use of cnt. Added g_pipeline.

parent accd3112
Branches
No related tags found
No related merge requests found
...@@ -53,6 +53,7 @@ USE work.dp_stream_pkg.ALL; ...@@ -53,6 +53,7 @@ USE work.dp_stream_pkg.ALL;
ENTITY dp_block_select IS ENTITY dp_block_select IS
GENERIC ( GENERIC (
g_pipeline : NATURAL := 1;
g_nof_blocks_per_sync : NATURAL; g_nof_blocks_per_sync : NATURAL;
g_index_lo : NATURAL := 0; g_index_lo : NATURAL := 0;
g_index_hi : NATURAL g_index_hi : NATURAL
...@@ -81,8 +82,8 @@ ARCHITECTURE rtl OF dp_block_select IS ...@@ -81,8 +82,8 @@ ARCHITECTURE rtl OF dp_block_select IS
SIGNAL cnt_reg : NATURAL RANGE 0 TO true_log_pow2(g_nof_blocks_per_sync); SIGNAL cnt_reg : NATURAL RANGE 0 TO true_log_pow2(g_nof_blocks_per_sync);
SIGNAL cnt : NATURAL; SIGNAL cnt : NATURAL;
SIGNAL sync_sosi_reg : t_dp_sosi; SIGNAL sync_sosi_reg : t_dp_sosi; -- hold snk_in.bsn
SIGNAL sync_sosi : t_dp_sosi; SIGNAL sync_sosi : t_dp_sosi; -- hold snk_in.bsn
SIGNAL block_sosi : t_dp_sosi; SIGNAL block_sosi : t_dp_sosi;
BEGIN BEGIN
...@@ -101,19 +102,19 @@ BEGIN ...@@ -101,19 +102,19 @@ BEGIN
-- Preserve snk_in @ sync -- Preserve snk_in @ sync
sync_sosi <= snk_in WHEN snk_in.sync='1' ELSE sync_sosi_reg; sync_sosi <= snk_in WHEN snk_in.sync='1' ELSE sync_sosi_reg;
-- Count eop per sync interval -- Count blocks at sop per sync interval and restart count at sync
p_cnt : PROCESS(snk_in, cnt_reg) p_cnt : PROCESS(snk_in, cnt_reg)
BEGIN BEGIN
cnt <= cnt_reg; cnt <= cnt_reg;
IF snk_in.sync='1' THEN IF snk_in.sync='1' THEN
cnt <= 0; cnt <= 0;
ELSIF snk_in.eop='1' THEN ELSIF snk_in.sop='1' THEN
cnt <= cnt_reg + 1; cnt <= cnt_reg + 1;
END IF; END IF;
END PROCESS; END PROCESS;
-- Resize snk_in combinatorially into block_sosi, so no impact on ready latency (RL) -- Resize snk_in combinatorially into block_sosi, so no impact on ready latency (RL)
p_block_sosi : PROCESS(snk_in, cnt_reg, index_lo, index_hi, sync_sosi) p_block_sosi : PROCESS(snk_in, cnt, index_lo, index_hi, sync_sosi)
BEGIN BEGIN
-- Default keep snk_in info and data fields -- Default keep snk_in info and data fields
block_sosi <= snk_in; block_sosi <= snk_in;
...@@ -126,14 +127,14 @@ BEGIN ...@@ -126,14 +127,14 @@ BEGIN
ELSE ELSE
IF snk_in.valid='1' THEN IF snk_in.valid='1' THEN
-- Drop blocks outside selected range -- Drop blocks outside selected range
IF cnt_reg < index_lo OR cnt_reg > index_hi THEN IF cnt < index_lo OR cnt > index_hi THEN
block_sosi.sync <= '0'; block_sosi.sync <= '0';
block_sosi.sop <= '0'; block_sosi.sop <= '0';
block_sosi.eop <= '0'; block_sosi.eop <= '0';
block_sosi.valid <= '0'; block_sosi.valid <= '0';
END IF; END IF;
-- Move input sync and bsn to first output block -- Move input sync and bsn to first output block
IF cnt_reg=index_lo THEN IF cnt=index_lo THEN
block_sosi.sync <= snk_in.sop; block_sosi.sync <= snk_in.sop;
block_sosi.bsn <= sync_sosi.bsn; -- bsn is valid at sop block_sosi.bsn <= sync_sosi.bsn; -- bsn is valid at sop
END IF; END IF;
...@@ -144,7 +145,7 @@ BEGIN ...@@ -144,7 +145,7 @@ BEGIN
-- Register block_sosi to easy timing closure -- Register block_sosi to easy timing closure
u_pipeline : ENTITY work.dp_pipeline u_pipeline : ENTITY work.dp_pipeline
GENERIC MAP ( GENERIC MAP (
g_pipeline => 1 -- 0 for wires, > 0 for registers, g_pipeline => g_pipeline -- 0 for wires, > 0 for registers,
) )
PORT MAP ( PORT MAP (
rst => rst, rst => rst,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment