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

Added func_dp_stream_arr_combine_data_info_ctrl(). Clarified data, info and...

Added func_dp_stream_arr_combine_data_info_ctrl(). Clarified data, info and ctrl fields in t_dp_sosi.
parent 2be2aef1
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,10 @@ PACKAGE dp_stream_pkg Is ...@@ -45,6 +45,10 @@ PACKAGE dp_stream_pkg Is
-- streaming components can remain as they are. -- streaming components can remain as they are.
-- * Added sync and bsn to SOSI to have timestamp information with the data -- * Added sync and bsn to SOSI to have timestamp information with the data
-- * Added re and im to SOSI to support complex data for DSP -- * Added re and im to SOSI to support complex data for DSP
-- * The sosi fields can be labeled in diffent groups: ctrl, info and data as shown in comment at the t_dp_sosi definition.
-- This grouping is useful for functions that operate on a t_dp_sosi signal.
-- * The info fields are valid at the sop or at the eop, but typically they hold their last active value to avoid unnessary
-- toggling and to ease viewing in the wave window.
CONSTANT c_dp_stream_bsn_w : NATURAL := 64; -- 64 is sufficient to count blocks of data for years CONSTANT c_dp_stream_bsn_w : NATURAL := 64; -- 64 is sufficient to count blocks of data for years
CONSTANT c_dp_stream_data_w : NATURAL := 768; -- 72 is sufficient for max word 8 * 9-bit. 576 supports half rate DDR4 bus data width. The current 768 is enough for wide single clock SLVs (e.g. headers) CONSTANT c_dp_stream_data_w : NATURAL := 768; -- 72 is sufficient for max word 8 * 9-bit. 576 supports half rate DDR4 bus data width. The current 768 is enough for wide single clock SLVs (e.g. headers)
CONSTANT c_dp_stream_dsp_data_w : NATURAL := 64; -- 64 is sufficient for DSP data, including complex power accumulates CONSTANT c_dp_stream_dsp_data_w : NATURAL := 64; -- 64 is sufficient for DSP data, including complex power accumulates
...@@ -63,17 +67,17 @@ PACKAGE dp_stream_pkg Is ...@@ -63,17 +67,17 @@ PACKAGE dp_stream_pkg Is
END RECORD; END RECORD;
TYPE t_dp_sosi IS RECORD -- Source Out or Sink In TYPE t_dp_sosi IS RECORD -- Source Out or Sink In
sync : STD_LOGIC; sync : STD_LOGIC; -- ctrl
bsn : STD_LOGIC_VECTOR(c_dp_stream_bsn_w-1 DOWNTO 0); -- data block sequence number bsn : STD_LOGIC_VECTOR(c_dp_stream_bsn_w-1 DOWNTO 0); -- info at sop (block sequence number)
data : STD_LOGIC_VECTOR(c_dp_stream_data_w-1 DOWNTO 0); data : STD_LOGIC_VECTOR(c_dp_stream_data_w-1 DOWNTO 0); -- data
re : STD_LOGIC_VECTOR(c_dp_stream_dsp_data_w-1 DOWNTO 0); re : STD_LOGIC_VECTOR(c_dp_stream_dsp_data_w-1 DOWNTO 0); -- data
im : STD_LOGIC_VECTOR(c_dp_stream_dsp_data_w-1 DOWNTO 0); im : STD_LOGIC_VECTOR(c_dp_stream_dsp_data_w-1 DOWNTO 0); -- data
valid : STD_LOGIC; valid : STD_LOGIC; -- ctrl
sop : STD_LOGIC; sop : STD_LOGIC; -- ctrl
eop : STD_LOGIC; eop : STD_LOGIC; -- ctrl
empty : STD_LOGIC_VECTOR(c_dp_stream_empty_w-1 DOWNTO 0); empty : STD_LOGIC_VECTOR(c_dp_stream_empty_w-1 DOWNTO 0); -- info at eop
channel : STD_LOGIC_VECTOR(c_dp_stream_channel_w-1 DOWNTO 0); channel : STD_LOGIC_VECTOR(c_dp_stream_channel_w-1 DOWNTO 0); -- info at sop
err : STD_LOGIC_VECTOR(c_dp_stream_error_w-1 DOWNTO 0); -- name field 'err' to avoid the 'error' keyword err : STD_LOGIC_VECTOR(c_dp_stream_error_w-1 DOWNTO 0); -- info at eop (name field 'err' to avoid the 'error' keyword)
END RECORD; END RECORD;
-- Initialise signal declarations with c_dp_stream_rst/rdy to ease the interpretation of slv fields with unused bits -- Initialise signal declarations with c_dp_stream_rst/rdy to ease the interpretation of slv fields with unused bits
...@@ -297,8 +301,10 @@ PACKAGE dp_stream_pkg Is ...@@ -297,8 +301,10 @@ PACKAGE dp_stream_pkg Is
FUNCTION func_dp_stream_arr_reverse_range(in_arr : t_dp_siso_arr) RETURN t_dp_siso_arr; FUNCTION func_dp_stream_arr_reverse_range(in_arr : t_dp_siso_arr) RETURN t_dp_siso_arr;
-- Functions to combinatorially hold the data fields and to set or reset the control fields in an sosi array -- Functions to combinatorially hold the data fields and to set or reset the control fields in an sosi array
FUNCTION func_dp_stream_arr_set_control( dp : t_dp_sosi_arr; ctrl : t_dp_sosi) RETURN t_dp_sosi_arr; FUNCTION func_dp_stream_arr_combine_data_info_ctrl(dp : t_dp_sosi_arr; info, ctrl : t_dp_sosi) RETURN t_dp_sosi_arr;
FUNCTION func_dp_stream_arr_reset_control(dp : t_dp_sosi_arr ) RETURN t_dp_sosi_arr; FUNCTION func_dp_stream_arr_set_info( dp : t_dp_sosi_arr; info : t_dp_sosi) RETURN t_dp_sosi_arr;
FUNCTION func_dp_stream_arr_set_control( dp : t_dp_sosi_arr; ctrl : t_dp_sosi) RETURN t_dp_sosi_arr;
FUNCTION func_dp_stream_arr_reset_control( dp : t_dp_sosi_arr ) RETURN t_dp_sosi_arr;
-- Functions to combinatorially determine the maximum and minimum sosi bsn[w-1:0] value in the sosi array (for all elements or only for the mask[]='1' elements) -- Functions to combinatorially determine the maximum and minimum sosi bsn[w-1:0] value in the sosi array (for all elements or only for the mask[]='1' elements)
FUNCTION func_dp_stream_arr_bsn_max(dp : t_dp_sosi_arr; mask : STD_LOGIC_VECTOR; w : NATURAL) RETURN STD_LOGIC_VECTOR; FUNCTION func_dp_stream_arr_bsn_max(dp : t_dp_sosi_arr; mask : STD_LOGIC_VECTOR; w : NATURAL) RETURN STD_LOGIC_VECTOR;
...@@ -971,7 +977,27 @@ PACKAGE BODY dp_stream_pkg IS ...@@ -971,7 +977,27 @@ PACKAGE BODY dp_stream_pkg IS
END IF; END IF;
END func_dp_stream_arr_reverse_range; END func_dp_stream_arr_reverse_range;
-- Functions to combinatorially hold the data fields and to set or reset the control fields in an sosi array -- Functions to combinatorially hold the data fields and to set or reset the info and control fields in an sosi array
FUNCTION func_dp_stream_arr_combine_data_info_ctrl(dp : t_dp_sosi_arr; info, ctrl : t_dp_sosi) RETURN t_dp_sosi_arr IS
VARIABLE v_dp : t_dp_sosi_arr(dp'RANGE) := dp; -- hold sosi data
BEGIN
v_dp := func_dp_stream_arr_set_info( v_dp, info); -- set sosi info
v_dp := func_dp_stream_arr_set_control(v_dp, ctrl); -- set sosi ctrl
RETURN v_dp;
END func_dp_stream_arr_combine_data_info_ctrl;
FUNCTION func_dp_stream_arr_set_info(dp : t_dp_sosi_arr; info : t_dp_sosi) RETURN t_dp_sosi_arr IS
VARIABLE v_dp : t_dp_sosi_arr(dp'RANGE) := dp; -- hold sosi data
BEGIN
FOR I IN dp'RANGE LOOP -- set sosi info
v_dp(I).bsn := info.bsn; -- sop
v_dp(I).channel := info.channel; -- sop
v_dp(I).empty := info.empty; -- eop
v_dp(I).err := info.err; -- eop
END LOOP;
RETURN v_dp;
END func_dp_stream_arr_set_info;
FUNCTION func_dp_stream_arr_set_control(dp : t_dp_sosi_arr; ctrl : t_dp_sosi) RETURN t_dp_sosi_arr IS FUNCTION func_dp_stream_arr_set_control(dp : t_dp_sosi_arr; ctrl : t_dp_sosi) RETURN t_dp_sosi_arr IS
VARIABLE v_dp : t_dp_sosi_arr(dp'RANGE) := dp; -- hold sosi data VARIABLE v_dp : t_dp_sosi_arr(dp'RANGE) := dp; -- hold sosi data
BEGIN BEGIN
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment