Skip to content
Snippets Groups Projects
Commit 64c69e63 authored by Reinier van der Walle's avatar Reinier van der Walle
Browse files

Merge branch 'L2SDP-210' into 'master'

Resolve L2SDP-210

Closes L2SDP-210

See merge request desp/hdl!190
parents 87cdfe9f 73d815ce
No related branches found
No related tags found
1 merge request!190Resolve L2SDP-210
Pipeline #23669 passed
...@@ -57,6 +57,7 @@ PACKAGE common_str_pkg IS ...@@ -57,6 +57,7 @@ PACKAGE common_str_pkg IS
FUNCTION real_to_str(re: REAL; width : INTEGER; digits : INTEGER) RETURN STRING; FUNCTION real_to_str(re: REAL; width : INTEGER; digits : INTEGER) RETURN STRING;
PROCEDURE print_str(str : STRING); PROCEDURE print_str(str : STRING);
PROCEDURE print_str(str: STRING; enable: BOOLEAN);
FUNCTION str_to_ascii_integer_arr(s: STRING) RETURN t_integer_arr; FUNCTION str_to_ascii_integer_arr(s: STRING) RETURN t_integer_arr;
FUNCTION str_to_ascii_slv_8_arr( s: STRING) RETURN t_slv_8_arr; FUNCTION str_to_ascii_slv_8_arr( s: STRING) RETURN t_slv_8_arr;
...@@ -269,6 +270,14 @@ PACKAGE BODY common_str_pkg IS ...@@ -269,6 +270,14 @@ PACKAGE BODY common_str_pkg IS
deallocate(v_line); deallocate(v_line);
END; END;
PROCEDURE print_str(str: STRING; enable: BOOLEAN) IS
VARIABLE v_line: LINE;
BEGIN
IF enable THEN
print_str(str);
END IF;
END;
FUNCTION str_to_ascii_integer_arr(s: STRING) RETURN t_integer_arr IS FUNCTION str_to_ascii_integer_arr(s: STRING) RETURN t_integer_arr IS
VARIABLE r: t_integer_arr(0 TO s'RIGHT-1); VARIABLE r: t_integer_arr(0 TO s'RIGHT-1);
BEGIN BEGIN
......
...@@ -347,6 +347,7 @@ test_bench_files = ...@@ -347,6 +347,7 @@ test_bench_files =
tb/vhdl/tb_tb_tb_dp_backpressure.vhd tb/vhdl/tb_tb_tb_dp_backpressure.vhd
tb/vhdl/tb_dp_offload_tx_v3.vhd tb/vhdl/tb_dp_offload_tx_v3.vhd
tb/vhdl/tb_tb_dp_offload_tx_v3.vhd
tb/vhdl/tb_dp_offload_rx_filter.vhd tb/vhdl/tb_dp_offload_rx_filter.vhd
tb/vhdl/tb_dp_selector_arr.vhd tb/vhdl/tb_dp_selector_arr.vhd
tb/vhdl/tb_mms_dp_scale.vhd tb/vhdl/tb_mms_dp_scale.vhd
...@@ -416,6 +417,7 @@ regression_test_vhdl = ...@@ -416,6 +417,7 @@ regression_test_vhdl =
tb/vhdl/tb_tb_dp_xonoff.vhd tb/vhdl/tb_tb_dp_xonoff.vhd
tb/vhdl/tb_dp_selector_arr.vhd tb/vhdl/tb_dp_selector_arr.vhd
tb/vhdl/tb_mms_dp_scale.vhd tb/vhdl/tb_mms_dp_scale.vhd
tb/vhdl/tb_tb_dp_offload_tx_v3.vhd
[modelsim_project_file] [modelsim_project_file]
......
...@@ -19,6 +19,27 @@ ...@@ -19,6 +19,27 @@
-- --
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- Author: D. van der Schuur, E. Kooistra
-- Purpose:
-- . Split a user-defined header from a data block e.g. to from an Eth frame
-- Description:
-- . The dp_offload_tx_v3 --> dp_offload_rx form a pair.
-- . The header and data block can be split at symbol level, to support a header
-- that does not have an integer number of g_data_w. The header length is
-- defined by c_nof_header_symbols.
-- . The header contents can be monitored and is defined by g_hdr_field_arr.
-- . The data block is output via src_out_arr. If the data block contains an
-- integer number of g_data_w words, then src_out_arr.empty = 0.
-- . Default the g_symbol_w = 0 which implies g_symbol_w = g_data_w.
-- - If the header length is not an integer number of g_data_w, then
-- g_symbol_w has to be set such that c_nof_symbols_per_data and
-- c_nof_header_symbols are both integers. The g_symbol_w is then used
-- to control the split.
-- - If the data block length is not an integer number of g_data_w, then
-- g_symbol_w defines the symbol width of the data and is used to
-- control the snk_out_arr empty field.
LIBRARY IEEE, common_lib, dp_lib; LIBRARY IEEE, common_lib, dp_lib;
USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL; USE IEEE.NUMERIC_STD.ALL;
...@@ -31,6 +52,7 @@ ENTITY dp_offload_rx IS ...@@ -31,6 +52,7 @@ ENTITY dp_offload_rx IS
GENERIC ( GENERIC (
g_nof_streams : NATURAL; g_nof_streams : NATURAL;
g_data_w : NATURAL; g_data_w : NATURAL;
g_symbol_w : NATURAL := 0; -- default 0 yields g_symbol_w = g_data_w
g_hdr_field_arr : t_common_field_arr; g_hdr_field_arr : t_common_field_arr;
g_remove_crc : BOOLEAN := FALSE; g_remove_crc : BOOLEAN := FALSE;
g_crc_nof_words : NATURAL := 0 g_crc_nof_words : NATURAL := 0
...@@ -59,7 +81,9 @@ END dp_offload_rx; ...@@ -59,7 +81,9 @@ END dp_offload_rx;
ARCHITECTURE str OF dp_offload_rx IS ARCHITECTURE str OF dp_offload_rx IS
CONSTANT c_nof_header_words : NATURAL := field_slv_len(g_hdr_field_arr) / g_data_w; CONSTANT c_symbol_w : NATURAL := sel_a_b(g_symbol_w = 0, g_data_w, g_symbol_w);
CONSTANT c_nof_symbols_per_data : NATURAL := g_data_w / g_symbol_w;
CONSTANT c_nof_header_symbols : NATURAL := field_slv_len(g_hdr_field_arr) / c_symbol_w;
CONSTANT c_field_sel : STD_LOGIC_VECTOR(g_hdr_field_arr'RANGE) := (OTHERS=>'0');-- Not used in sink mode but requires set range CONSTANT c_field_sel : STD_LOGIC_VECTOR(g_hdr_field_arr'RANGE) := (OTHERS=>'0');-- Not used in sink mode but requires set range
...@@ -92,8 +116,8 @@ BEGIN ...@@ -92,8 +116,8 @@ BEGIN
u_dp_split : ENTITY work.dp_split u_dp_split : ENTITY work.dp_split
GENERIC MAP ( GENERIC MAP (
g_data_w => g_data_w, g_data_w => g_data_w,
g_symbol_w => g_data_w, g_symbol_w => c_symbol_w,
g_nof_symbols => c_nof_header_words g_nof_symbols => c_nof_header_symbols
) )
PORT MAP ( PORT MAP (
rst => dp_rst, rst => dp_rst,
...@@ -120,7 +144,9 @@ BEGIN ...@@ -120,7 +144,9 @@ BEGIN
g_field_arr => field_arr_set_mode(g_hdr_field_arr , "RO"), g_field_arr => field_arr_set_mode(g_hdr_field_arr , "RO"),
g_field_sel => c_field_sel, g_field_sel => c_field_sel,
g_snk_data_w => c_dp_field_blk_snk_data_w, --g_data_w, g_snk_data_w => c_dp_field_blk_snk_data_w, --g_data_w,
g_src_data_w => c_dp_field_blk_src_data_w --field_slv_in_len(field_arr_set_mode(g_hdr_field_arr , "RO")) g_src_data_w => c_dp_field_blk_src_data_w, --field_slv_in_len(field_arr_set_mode(g_hdr_field_arr , "RO"))
g_in_symbol_w => c_symbol_w,
g_out_symbol_w => c_symbol_w
) )
PORT MAP ( PORT MAP (
dp_rst => dp_rst, dp_rst => dp_rst,
...@@ -152,7 +178,7 @@ BEGIN ...@@ -152,7 +178,7 @@ BEGIN
u_dp_tail_remove : ENTITY work.dp_tail_remove u_dp_tail_remove : ENTITY work.dp_tail_remove
GENERIC MAP ( GENERIC MAP (
g_data_w => g_data_w, g_data_w => g_data_w,
g_symbol_w => g_data_w, g_symbol_w => c_symbol_w,
g_nof_symbols => sel_a_b(g_remove_crc, g_crc_nof_words, 0) g_nof_symbols => sel_a_b(g_remove_crc, g_crc_nof_words, 0)
) )
PORT MAP ( PORT MAP (
......
...@@ -19,21 +19,25 @@ ...@@ -19,21 +19,25 @@
-- --
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- Author: D. van der Schuur, E. Kooistra
-- Purpose: -- Purpose:
-- . Concatenate a user-defined header to a DP frame e.g. to create an Ethernet frame -- . Concatenate a user-defined header to a data block e.g. to create an Eth
-- frame
-- Description: -- Description:
-- . The header contents can be controlled dynamically by data path or MM control (selected by g_hdr_field_sel) -- . The dp_offload_tx_v3 --> dp_offload_rx form a pair.
-- . The header and data can be concatened at symbol level. The g_symbol_w defines the -- . The header contents can be controlled dynamically by data path or MM
-- resolution of the empty field. The g_data_w must be an integer multiple of the -- control (selected by g_hdr_field_sel)
-- g_symbol_w. If the empty field is not used or if the empty field is always 0 then -- . The header and data can be concatened at symbol level. The g_symbol_w
-- set g_symbol_w = g_data_w. -- defines the resolution of the empty field. The g_data_w must be an
-- . For example to concat header and data for an Ethernet frame use: -- integer multiple of the g_symbol_w. If the empty field is not used or
-- if the empty field is always 0 then set g_symbol_w = g_data_w.
-- . For example to concat header and data block for an Ethernet frame use:
-- - g_data_w = 32 (1GbE) or 64 (10GbE) -- - g_data_w = 32 (1GbE) or 64 (10GbE)
-- - g_symbol_w = c_byte_w = 8 if either the header or the data can have an -- - g_symbol_w = c_byte_w = 8 if either the header or the data block can
-- non-zero empty field, so when they are not a multiple of 4 bytes -- have an non-zero empty field, so when they are not a multiple of
-- (= 32b) or 8 bytes (= 64b). -- 4 bytes (= 32b) or 8 bytes (= 64b).
-- g_symbol_w = g_data_w if the empty field is always 0, so the number of bits in -- g_symbol_w = g_data_w if the empty field is always 0, so the number of
-- the header and data are an integer number of g_data_w. -- bits in the header and data are an integer number of g_data_w.
LIBRARY IEEE, common_lib, technology_lib, mm_lib; LIBRARY IEEE, common_lib, technology_lib, mm_lib;
......
This diff is collapsed.
-- --------------------------------------------------------------------------
-- Copyright 2021
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- --------------------------------------------------------------------------
--
-- Author: E. Kooistra, Jan 2022
-- Purpose: Regression multi tb for dp_offload_tx_v3 and dp_offload_rx
-- Description:
-- Usage:
-- > as 5
-- > run -all
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
USE work.tb_dp_pkg.ALL; -- for t_dp_flow_control_enum
ENTITY tb_tb_dp_offload_tx_v3 IS
END tb_tb_dp_offload_tx_v3;
ARCHITECTURE tb OF tb_tb_dp_offload_tx_v3 IS
SIGNAL tb_end : STD_LOGIC := '0'; -- declare tb_end to avoid 'No objects found' error on 'when -label tb_end'
BEGIN
-- -- general
-- g_flow_control_stimuli : t_dp_flow_control_enum := e_pulse; -- always e_active, e_random or e_pulse flow control
-- g_flow_control_verify : t_dp_flow_control_enum := e_active; -- always e_active, e_random or e_pulse flow control
-- g_print_en : BOOLEAN := TRUE;
-- -- specific
-- g_data_w : NATURAL := 64;
-- g_symbol_w : NATURAL := 16;
-- g_pkt_len : NATURAL := 240;
-- g_pkt_gap : NATURAL := 16
u_pls_act_data_w_64 : ENTITY work.tb_dp_offload_tx_v3 GENERIC MAP (e_pulse, e_active, FALSE, 64, 64, 240, 16);
u_pls_act_data_w_64_no_gap : ENTITY work.tb_dp_offload_tx_v3 GENERIC MAP (e_pulse, e_active, FALSE, 64, 64, 240, 0);
u_rnd_act_data_w_64 : ENTITY work.tb_dp_offload_tx_v3 GENERIC MAP (e_random, e_active, FALSE, 64, 64, 240, 16);
u_rnd_act_data_w_32 : ENTITY work.tb_dp_offload_tx_v3 GENERIC MAP (e_random, e_active, FALSE, 32, 32, 240, 16);
--u_act_rnd_data_w : ENTITY work.tb_dp_offload_tx_v3 GENERIC MAP (e_active, e_random, FALSE, 64, 64, 240, 16);
u_rnd_act_data_64_symbol_16 : ENTITY work.tb_dp_offload_tx_v3 GENERIC MAP (e_random, e_active, FALSE, 64, 16, 240, 16);
u_rnd_act_data_64_symbol_32 : ENTITY work.tb_dp_offload_tx_v3 GENERIC MAP (e_random, e_active, FALSE, 64, 32, 240, 16);
u_rnd_act_data_32_symbol_8 : ENTITY work.tb_dp_offload_tx_v3 GENERIC MAP (e_random, e_active, FALSE, 32, 8, 240, 16);
u_rnd_act_data_32_symbol_16 : ENTITY work.tb_dp_offload_tx_v3 GENERIC MAP (e_random, e_active, FALSE, 32, 16, 240, 16);
END tb;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment