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

Add func_eth_tester_eth_packet_length().

parent cc4ba46b
No related branches found
No related tags found
1 merge request!288Resolve L2SDP-836
......@@ -31,6 +31,7 @@ USE common_lib.common_pkg.ALL;
USE common_lib.common_mem_pkg.ALL;
USE common_lib.common_field_pkg.ALL;
USE common_lib.common_network_layers_pkg.ALL;
USE work.eth_tester_pkg.ALL;
PACKAGE tb_eth_tester_pkg is
......@@ -42,6 +43,9 @@ PACKAGE tb_eth_tester_pkg is
FUNCTION func_eth_tester_gn_index_to_mac_15_0(gn_index : NATURAL) RETURN STD_LOGIC_VECTOR;
FUNCTION func_eth_tester_gn_index_to_ip_15_0(gn_index : NATURAL) RETURN STD_LOGIC_VECTOR;
-- Ethernet packet length in octets inclduing eth header and CRC
FUNCTION func_eth_tester_eth_packet_length(block_len : NATURAL) RETURN NATURAL;
END tb_eth_tester_pkg;
......@@ -63,5 +67,14 @@ PACKAGE BODY tb_eth_tester_pkg IS
RETURN c_ip_15_0;
END func_eth_tester_gn_index_to_ip_15_0;
FUNCTION func_eth_tester_eth_packet_length(block_len : NATURAL) RETURN NATURAL IS
CONSTANT c_app_len : NATURAL := c_eth_tester_app_hdr_len + block_len;
CONSTANT c_udp_len : NATURAL := c_network_udp_header_len + c_app_len;
CONSTANT c_ip_len : NATURAL := c_network_ip_header_len + c_udp_len;
CONSTANT c_eth_len : NATURAL := c_network_eth_header_len + c_ip_len + c_network_eth_crc_len;
BEGIN
RETURN c_eth_len;
END func_eth_tester_eth_packet_length;
END tb_eth_tester_pkg;
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