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

Add functions to map arr to one.

parent 146546d0
No related branches found
No related tags found
1 merge request!293Rename eth_stream into eth_stream_udp. Create new eth_stream.vhd that contains...
......@@ -272,6 +272,12 @@ PACKAGE dp_stream_pkg Is
FUNCTION TO_DP_SOSI_UNSIGNED(sync, valid, sop, eop : STD_LOGIC; bsn, data, re, im, empty, channel, err : UNSIGNED) RETURN t_dp_sosi_unsigned;
-- Map between array and single element
FUNCTION TO_DP_ARR(sosi : t_dp_sosi) RETURN t_dp_sosi_arr;
FUNCTION TO_DP_ARR(siso : t_dp_siso) RETURN t_dp_siso_arr;
FUNCTION TO_DP_ONE(sosi_arr : t_dp_sosi_arr) RETURN t_dp_sosi;
FUNCTION TO_DP_ONE(siso_arr : t_dp_siso_arr) RETURN t_dp_siso;
-- Keep part of head data and combine part of tail data, use the other sosi from head_sosi
FUNCTION func_dp_data_shift_first(head_sosi, tail_sosi : t_dp_sosi; symbol_w, nof_symbols_per_data, nof_symbols_from_tail : NATURAL) RETURN t_dp_sosi;
-- Shift and combine part of previous data and this data, use the other sosi from prev_sosi
......@@ -638,6 +644,32 @@ PACKAGE BODY dp_stream_pkg IS
RETURN v_sosi_unsigned;
END TO_DP_SOSI_UNSIGNED;
-- Map between array and single element
FUNCTION TO_DP_ARR(sosi : t_dp_sosi) RETURN t_dp_sosi_arr IS
VARIABLE v_sosi_arr : t_dp_sosi_arr(0 DOWNTO 0) := (OTHERS => sosi);
BEGIN
RETURN v_sosi_arr;
END TO_DP_ARR;
FUNCTION TO_DP_ARR(siso : t_dp_siso) RETURN t_dp_siso_arr IS
VARIABLE v_siso_arr : t_dp_siso_arr(0 DOWNTO 0) := (OTHERS => siso);
BEGIN
RETURN v_siso_arr;
END TO_DP_ARR;
FUNCTION TO_DP_ONE(sosi_arr : t_dp_sosi_arr) RETURN t_dp_sosi IS
VARIABLE v_sosi : t_dp_sosi := sosi_arr(0);
BEGIN
RETURN v_sosi;
END TO_DP_ONE;
FUNCTION TO_DP_ONE(siso_arr : t_dp_siso_arr) RETURN t_dp_siso IS
VARIABLE v_siso : t_dp_siso := siso_arr(0);
BEGIN
RETURN v_siso;
END TO_DP_ONE;
-- Keep part of head data and combine part of tail data
FUNCTION func_dp_data_shift_first(head_sosi, tail_sosi : t_dp_sosi; symbol_w, nof_symbols_per_data, nof_symbols_from_tail : NATURAL) RETURN t_dp_sosi IS
VARIABLE vN : NATURAL := nof_symbols_per_data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment