Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
c0c893b1
Commit
c0c893b1
authored
2 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Add func_eth_tester_eth_packet_length().
parent
cc4ba46b
No related branches found
No related tags found
1 merge request
!288
Resolve L2SDP-836
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/io/eth/tb/vhdl/tb_eth_tester_pkg.vhd
+13
-0
13 additions, 0 deletions
libraries/io/eth/tb/vhdl/tb_eth_tester_pkg.vhd
with
13 additions
and
0 deletions
libraries/io/eth/tb/vhdl/tb_eth_tester_pkg.vhd
+
13
−
0
View file @
c0c893b1
...
...
@@ -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
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment