Skip to content
Snippets Groups Projects
Commit ac0f83dc authored by Job van Wee's avatar Job van Wee
Browse files

test commit

parent 2c60dd71
No related branches found
No related tags found
1 merge request!215Resolve L2SDP-660
Pipeline #25617 passed
LIBRARY IEEE; LIBRARY IEEE, dp_lib;
USE IEEE.std_logic_1164.ALL; USE IEEE.std_logic_1164.ALL;
USE dp_lib.dp_stream_pkg.ALL;
ENTITY repack IS ENTITY repack IS
GENERIC ( GENERIC (
...@@ -11,8 +11,7 @@ ENTITY repack IS ...@@ -11,8 +11,7 @@ ENTITY repack IS
clk : IN STD_LOGIC; clk : IN STD_LOGIC;
out_o_f : OUT NATURAL; out_o_f : OUT NATURAL;
in_data : IN STD_LOGIC_VECTOR(g_in_data_w-1 DOWNTO 0); in_data : IN STD_LOGIC_VECTOR(g_in_data_w-1 DOWNTO 0);
out_data : OUT STD_LOGIC_VECTOR(g_out_data_w-1 DOWNTO 0); out_sosi : OUT t_dp_sosi
data_enable : OUT STD_LOGIC
); );
END repack; END repack;
...@@ -36,28 +35,28 @@ BEGIN ...@@ -36,28 +35,28 @@ BEGIN
IF (g_in_data_w*(c_v_count+1) >= g_out_data_w*(out_data_count+1)) THEN -- if the input data exceeds the output data vector width IF (g_in_data_w*(c_v_count+1) >= g_out_data_w*(out_data_count+1)) THEN -- if the input data exceeds the output data vector width
IF (out_data_count = 1) THEN -- if the input data exceeds c_v vector widt IF (out_data_count = 1) THEN -- if the input data exceeds c_v vector widt
out_o_f <= a_o_f; -- set the output overflow to the overflow that maches the out_data vector out_o_f <= a_o_f; -- set the output overflow to the overflow that maches the out_sosi.data vector
a_o_f <= a_o_f + g_in_data_w * c_v_count - g_out_data_w * (out_data_count + 1); -- check how much overflow there is and safe it in a_o_f a_o_f <= a_o_f + g_in_data_w * c_v_count - g_out_data_w * (out_data_count + 1); -- check how much overflow there is and safe it in a_o_f
c_v(k_c_v_w - 1 DOWNTO k_c_v_w - (g_in_data_w - a_o_f)) <= in_data(g_in_data_w - a_o_f - 1 DOWNTO 0); -- fill the rest of c_v untill the end c_v(k_c_v_w - 1 DOWNTO k_c_v_w - (g_in_data_w - a_o_f)) <= in_data(g_in_data_w - a_o_f - 1 DOWNTO 0); -- fill the rest of c_v untill the end
c_v(a_o_f - 1 DOWNTO 0) <= in_data(g_in_data_w - 1 DOWNTO g_in_data_w - a_o_f); -- fill the start of c_v untill the a_o_f c_v(a_o_f - 1 DOWNTO 0) <= in_data(g_in_data_w - 1 DOWNTO g_in_data_w - a_o_f); -- fill the start of c_v untill the a_o_f
out_data(g_out_data_w - 1 DOWNTO 0) <= c_v(k_c_v_w - 1 DOWNTO g_out_data_w); -- fill out_data with 2nd part of c_v out_sosi.data(g_out_data_w - 1 DOWNTO 0) <= c_v(k_c_v_w - 1 DOWNTO g_out_data_w); -- fill out_sosi.data with 2nd part of c_v
data_enable <= '1'; -- data_enable 1 out_sosi.valid <= '1'; -- out_sosi.valid 1
c_v_count <= 0; -- reset counter c_v_count <= 0; -- reset counter
out_data_count <= 0; -- reset counter out_data_count <= 0; -- reset counter
Else -- if the input data exceeds output data vector width but not the c_v vector widt Else -- if the input data exceeds output data vector width but not the c_v vector widt
c_v(g_in_data_w * (c_v_count + 1) + a_o_f - 1 DOWNTO g_in_data_w * c_v_count + a_o_f) <= in_data(g_in_data_w - 1 DOWNTO 0); -- fill c_v c_v(g_in_data_w * (c_v_count + 1) + a_o_f - 1 DOWNTO g_in_data_w * c_v_count + a_o_f) <= in_data(g_in_data_w - 1 DOWNTO 0); -- fill c_v
c_v_count <= c_v_count + 1; -- increase the counter of c_v with 1 c_v_count <= c_v_count + 1; -- increase the counter of c_v with 1
out_data(g_out_data_w - 1 DOWNTO 0) <= c_v(g_out_data_w - 1 DOWNTO 0); -- fill out_data with 1st part of c_v out_sosi.data(g_out_data_w - 1 DOWNTO 0) <= c_v(g_out_data_w - 1 DOWNTO 0); -- fill out_sosi.data with 1st part of c_v
out_data_count <= out_data_count + 1; -- increase the counter of out_data with 1 out_data_count <= out_data_count + 1; -- increase the counter of out_sosi.data with 1
data_enable <= '1'; -- data_enable 1 out_sosi.valid <= '1'; -- out_sosi.valid 1
END IF; END IF;
ELSE -- if the input data doesn't exceeds the output data vector width ELSE -- if the input data doesn't exceeds the output data vector width
c_v(g_in_data_w * (c_v_count + 1) + a_o_f - 1 DOWNTO g_in_data_w * c_v_count + a_o_f) <= in_data(g_in_data_w - 1 DOWNTO 0); -- fill c_v c_v(g_in_data_w * (c_v_count + 1) + a_o_f - 1 DOWNTO g_in_data_w * c_v_count + a_o_f) <= in_data(g_in_data_w - 1 DOWNTO 0); -- fill c_v
c_v_count <= c_v_count + 1; -- increase the counter of c_v with 1 c_v_count <= c_v_count + 1; -- increase the counter of c_v with 1
data_enable <= '0'; -- data_enable 0 out_sosi.valid <= '0'; -- out_sosi.valid 0
END IF; END IF;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment