Skip to content
GitLab
Explore
Sign in
Register
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
3dc963c1
Commit
3dc963c1
authored
2 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Add functions to derive MAC, IP address from GN index.
parent
5289dd4f
Branches
Branches containing commit
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
+21
-0
21 additions, 0 deletions
libraries/io/eth/tb/vhdl/tb_eth_tester_pkg.vhd
with
21 additions
and
0 deletions
libraries/io/eth/tb/vhdl/tb_eth_tester_pkg.vhd
+
21
−
0
View file @
3dc963c1
...
@@ -38,9 +38,30 @@ PACKAGE tb_eth_tester_pkg is
...
@@ -38,9 +38,30 @@ PACKAGE tb_eth_tester_pkg is
CONSTANT
c_eth_tester_ip_dst_addr
:
STD_LOGIC_VECTOR
(
31
DOWNTO
0
)
:
=
x"0A6300FE"
;
-- 0A6300FE = '10.99.0.254' = DOP36-enp2s0
CONSTANT
c_eth_tester_ip_dst_addr
:
STD_LOGIC_VECTOR
(
31
DOWNTO
0
)
:
=
x"0A6300FE"
;
-- 0A6300FE = '10.99.0.254' = DOP36-enp2s0
CONSTANT
c_eth_tester_udp_dst_port
:
STD_LOGIC_VECTOR
(
15
DOWNTO
0
)
:
=
TO_UVEC
(
6001
,
16
);
-- 0x1771 = 6001
CONSTANT
c_eth_tester_udp_dst_port
:
STD_LOGIC_VECTOR
(
15
DOWNTO
0
)
:
=
TO_UVEC
(
6001
,
16
);
-- 0x1771 = 6001
-- Map global node index on UniBoard2 to node MAC address and node IP address
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
;
END
tb_eth_tester_pkg
;
END
tb_eth_tester_pkg
;
PACKAGE
BODY
tb_eth_tester_pkg
IS
PACKAGE
BODY
tb_eth_tester_pkg
IS
FUNCTION
func_eth_tester_gn_index_to_mac_15_0
(
gn_index
:
NATURAL
)
RETURN
STD_LOGIC_VECTOR
IS
CONSTANT
c_unb_nr
:
NATURAL
:
=
gn_index
/
4
;
-- 4 PN per Uniboard2
CONSTANT
c_node_nr
:
NATURAL
:
=
gn_index
MOD
4
;
CONSTANT
c_mac_15_0
:
STD_LOGIC_VECTOR
(
15
DOWNTO
0
)
:
=
TO_UVEC
(
c_unb_nr
,
8
)
&
TO_UVEC
(
c_node_nr
,
8
);
BEGIN
RETURN
c_mac_15_0
;
END
func_eth_tester_gn_index_to_mac_15_0
;
FUNCTION
func_eth_tester_gn_index_to_ip_15_0
(
gn_index
:
NATURAL
)
RETURN
STD_LOGIC_VECTOR
IS
CONSTANT
c_unb_nr
:
NATURAL
:
=
gn_index
/
4
;
-- 4 PN per Uniboard2
CONSTANT
c_node_nr
:
NATURAL
:
=
gn_index
MOD
4
;
CONSTANT
c_ip_15_0
:
STD_LOGIC_VECTOR
(
15
DOWNTO
0
)
:
=
TO_UVEC
(
c_unb_nr
,
8
)
&
TO_UVEC
(
c_node_nr
+
1
,
8
);
-- +1 to avoid IP = *.*.*.0
BEGIN
RETURN
c_ip_15_0
;
END
func_eth_tester_gn_index_to_ip_15_0
;
END
tb_eth_tester_pkg
;
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