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
200b898d
Commit
200b898d
authored
2 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Use sim default dst and src MAC, IP, UDP port from sdp_pkg.vhd and based on gn_index.
parent
d514e092
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!283
Resolve L2SDP-696
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_pkg.vhd
+45
-35
45 additions, 35 deletions
applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_pkg.vhd
applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_statistics_offload.vhd
+8
-12
8 additions, 12 deletions
...ofar2/libraries/sdp/tb/vhdl/tb_sdp_statistics_offload.vhd
with
53 additions
and
47 deletions
applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_pkg.vhd
+
45
−
35
View file @
200b898d
...
...
@@ -32,14 +32,17 @@ USE common_lib.common_network_layers_pkg.ALL;
USE
work
.
sdp_pkg
.
ALL
;
PACKAGE
tb_sdp_pkg
is
-----------------------------------------------------------------------------
-- Derive low part of MAC, IP from global node (GN) index
-----------------------------------------------------------------------------
FUNCTION
func_sdp_gn_index_to_mac_15_0
(
gn_index
:
NATURAL
)
RETURN
STD_LOGIC_VECTOR
;
FUNCTION
func_sdp_gn_index_to_ip_15_0
(
gn_index
:
NATURAL
)
RETURN
STD_LOGIC_VECTOR
;
-----------------------------------------------------------------------------
-- Statistics offload
-----------------------------------------------------------------------------
FUNCTION
func_sdp_compose_stat_header
(
eth_dst_mac
:
STD_LOGIC_VECTOR
(
47
DOWNTO
0
);
-- eth header
eth_src_mac
:
STD_LOGIC_VECTOR
(
47
DOWNTO
0
);
ip_src_addr
:
STD_LOGIC_VECTOR
(
31
DOWNTO
0
);
-- ip header
ip_dst_addr
:
STD_LOGIC_VECTOR
(
31
DOWNTO
0
);
sdp_info
:
t_sdp_info
;
-- app header
FUNCTION
func_sdp_compose_stat_header
(
sdp_info
:
t_sdp_info
;
-- app header
g_statistics_type
:
STRING
;
weighted_subbands_flag
:
STD_LOGIC
;
gn_index
:
NATURAL
;
...
...
@@ -56,11 +59,7 @@ PACKAGE tb_sdp_pkg is
-----------------------------------------------------------------------------
-- Beamlet output via 10GbE to CEP (= central processor)
-----------------------------------------------------------------------------
FUNCTION
func_sdp_compose_cep_header
(
eth_dst_mac
:
STD_LOGIC_VECTOR
(
47
DOWNTO
0
);
-- eth header
eth_src_mac
:
STD_LOGIC_VECTOR
(
47
DOWNTO
0
);
ip_src_addr
:
STD_LOGIC_VECTOR
(
31
DOWNTO
0
);
-- ip header
ip_dst_addr
:
STD_LOGIC_VECTOR
(
31
DOWNTO
0
);
ip_header_checksum
:
NATURAL
;
FUNCTION
func_sdp_compose_cep_header
(
ip_header_checksum
:
NATURAL
;
sdp_info
:
t_sdp_info
;
-- app header
gn_index
:
NATURAL
;
beamlet_scale
:
NATURAL
;
...
...
@@ -74,11 +73,23 @@ END PACKAGE tb_sdp_pkg;
PACKAGE
BODY
tb_sdp_pkg
IS
FUNCTION
func_sdp_compose_stat_header
(
eth_dst_mac
:
STD_LOGIC_VECTOR
(
47
DOWNTO
0
);
-- eth header
eth_src_mac
:
STD_LOGIC_VECTOR
(
47
DOWNTO
0
);
ip_src_addr
:
STD_LOGIC_VECTOR
(
31
DOWNTO
0
);
-- ip header
ip_dst_addr
:
STD_LOGIC_VECTOR
(
31
DOWNTO
0
);
sdp_info
:
t_sdp_info
;
-- app header
FUNCTION
func_sdp_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_sdp_gn_index_to_mac_15_0
;
FUNCTION
func_sdp_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_sdp_gn_index_to_ip_15_0
;
FUNCTION
func_sdp_compose_stat_header
(
sdp_info
:
t_sdp_info
;
-- app header
g_statistics_type
:
STRING
;
weighted_subbands_flag
:
STD_LOGIC
;
gn_index
:
NATURAL
;
...
...
@@ -89,6 +100,10 @@ PACKAGE BODY tb_sdp_pkg IS
xst_signal_input_A
:
NATURAL
;
xst_signal_input_B
:
NATURAL
;
dp_bsn
:
NATURAL
)
RETURN
t_sdp_stat_header
IS
-- Use sim default dst and src MAC, IP, UDP port from sdp_pkg.vhd and based on gn_index
CONSTANT
c_mac_15_0
:
STD_LOGIC_VECTOR
(
15
DOWNTO
0
)
:
=
func_sdp_gn_index_to_mac_15_0
(
gn_index
);
CONSTANT
c_ip_15_0
:
STD_LOGIC_VECTOR
(
15
DOWNTO
0
)
:
=
func_sdp_gn_index_to_ip_15_0
(
gn_index
);
CONSTANT
c_nof_statistics_per_packet
:
NATURAL
:
=
func_sdp_get_stat_nof_statistics_per_packet
(
g_statistics_type
);
CONSTANT
c_udp_total_length
:
NATURAL
:
=
func_sdp_get_stat_udp_total_length
(
g_statistics_type
);
CONSTANT
c_ip_total_length
:
NATURAL
:
=
func_sdp_get_stat_ip_total_length
(
g_statistics_type
);
...
...
@@ -98,8 +113,8 @@ PACKAGE BODY tb_sdp_pkg IS
VARIABLE
v_hdr
:
t_sdp_stat_header
;
BEGIN
-- eth header
v_hdr
.
eth
.
dst_mac
:
=
eth_dst_mac
;
v_hdr
.
eth
.
src_mac
:
=
eth_src_mac
;
v_hdr
.
eth
.
dst_mac
:
=
c_sdp_stat_
eth_dst_mac
;
v_hdr
.
eth
.
src_mac
:
=
c_sdp_stat_eth_src_mac_47_16
&
c_mac_15_0
;
v_hdr
.
eth
.
eth_type
:
=
x"0800"
;
-- ip header
...
...
@@ -112,18 +127,13 @@ PACKAGE BODY tb_sdp_pkg IS
v_hdr
.
ip
.
fragment_offset
:
=
TO_UVEC
(
0
,
c_network_ip_fragment_offset_w
);
v_hdr
.
ip
.
time_to_live
:
=
TO_UVEC
(
127
,
c_network_ip_time_to_live_w
);
v_hdr
.
ip
.
protocol
:
=
TO_UVEC
(
17
,
c_network_ip_protocol_w
);
-- the IP header check sum is calculated in IO eth, so still 0 here
v_hdr
.
ip
.
header_checksum
:
=
TO_UVEC
(
0
,
c_network_ip_header_checksum_w
);
v_hdr
.
ip
.
src_ip_addr
:
=
ip_src_addr
;
-- c_network_ip_addr_w
v_hdr
.
ip
.
dst_ip_addr
:
=
ip_dst_addr
;
-- c_network_ip_addr_w
v_hdr
.
ip
.
src_ip_addr
:
=
c_sdp_stat_ip_src_addr_31_16
&
c_ip_15_0
;
-- c_network_ip_addr_w
v_hdr
.
ip
.
dst_ip_addr
:
=
c_sdp_stat_
ip_dst_addr
;
-- c_network_ip_addr_w
-- udp header
IF
g_statistics_type
=
"SST"
OR
g_statistics_type
=
"SST_OS"
THEN
v_hdr
.
udp
.
src_port
:
=
c_sdp_sst_udp_src_port_15_8
&
TO_UVEC
(
gn_index
,
8
);
ELSIF
g_statistics_type
=
"BST"
THEN
v_hdr
.
udp
.
src_port
:
=
c_sdp_bst_udp_src_port_15_8
&
TO_UVEC
(
gn_index
,
8
);
ELSIF
g_statistics_type
=
"XST"
THEN
v_hdr
.
udp
.
src_port
:
=
c_sdp_xst_udp_src_port_15_8
&
TO_UVEC
(
gn_index
,
8
);
END
IF
;
v_hdr
.
udp
.
src_port
:
=
func_sdp_get_stat_udp_src_port
(
g_statistics_type
,
gn_index
);
v_hdr
.
udp
.
dst_port
:
=
c_sdp_stat_udp_dst_port
;
v_hdr
.
udp
.
total_length
:
=
TO_UVEC
(
c_udp_total_length
,
c_network_udp_port_w
);
v_hdr
.
udp
.
checksum
:
=
TO_UVEC
(
0
,
c_network_udp_checksum_w
);
...
...
@@ -237,21 +247,21 @@ PACKAGE BODY tb_sdp_pkg IS
END
func_sdp_verify_stat_header
;
FUNCTION
func_sdp_compose_cep_header
(
eth_dst_mac
:
STD_LOGIC_VECTOR
(
47
DOWNTO
0
);
-- eth header
eth_src_mac
:
STD_LOGIC_VECTOR
(
47
DOWNTO
0
);
ip_src_addr
:
STD_LOGIC_VECTOR
(
31
DOWNTO
0
);
-- ip header
ip_dst_addr
:
STD_LOGIC_VECTOR
(
31
DOWNTO
0
);
ip_header_checksum
:
NATURAL
;
FUNCTION
func_sdp_compose_cep_header
(
ip_header_checksum
:
NATURAL
;
sdp_info
:
t_sdp_info
;
-- app header
gn_index
:
NATURAL
;
beamlet_scale
:
NATURAL
;
beamlet_index
:
NATURAL
;
dp_bsn
:
NATURAL
)
RETURN
t_sdp_cep_header
IS
-- Use sim default dst and src MAC, IP, UDP port from sdp_pkg.vhd and based on gn_index
CONSTANT
c_mac_15_0
:
STD_LOGIC_VECTOR
(
15
DOWNTO
0
)
:
=
func_sdp_gn_index_to_mac_15_0
(
gn_index
);
CONSTANT
c_ip_15_0
:
STD_LOGIC_VECTOR
(
15
DOWNTO
0
)
:
=
func_sdp_gn_index_to_ip_15_0
(
gn_index
);
VARIABLE
v_hdr
:
t_sdp_cep_header
;
BEGIN
-- eth header
v_hdr
.
eth
.
dst_mac
:
=
eth_dst_mac
;
v_hdr
.
eth
.
src_mac
:
=
eth_src_mac
;
v_hdr
.
eth
.
dst_mac
:
=
c_sdp_cep_
eth_dst_mac
;
v_hdr
.
eth
.
src_mac
:
=
c_sdp_cep_
eth_src_mac
_47_16
&
c_mac_15_0
;
v_hdr
.
eth
.
eth_type
:
=
x"0800"
;
-- ip header
...
...
@@ -265,8 +275,8 @@ PACKAGE BODY tb_sdp_pkg IS
v_hdr
.
ip
.
time_to_live
:
=
TO_UVEC
(
127
,
c_network_ip_time_to_live_w
);
v_hdr
.
ip
.
protocol
:
=
TO_UVEC
(
17
,
c_network_ip_protocol_w
);
v_hdr
.
ip
.
header_checksum
:
=
TO_UVEC
(
ip_header_checksum
,
c_network_ip_header_checksum_w
);
v_hdr
.
ip
.
src_ip_addr
:
=
ip_src_addr
;
-- c_network_ip_addr_w
v_hdr
.
ip
.
dst_ip_addr
:
=
ip_dst_addr
;
-- c_network_ip_addr_w
v_hdr
.
ip
.
src_ip_addr
:
=
c_sdp_cep_ip_src_addr_31_16
&
c_ip_15_0
;
-- c_network_ip_addr_w
v_hdr
.
ip
.
dst_ip_addr
:
=
c_sdp_cep_
ip_dst_addr
;
-- c_network_ip_addr_w
-- udp header
v_hdr
.
udp
.
src_port
:
=
c_sdp_cep_udp_src_port_15_8
&
TO_UVEC
(
gn_index
,
8
);
...
...
This diff is collapsed.
Click to expand it.
applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_statistics_offload.vhd
+
8
−
12
View file @
200b898d
...
...
@@ -82,10 +82,10 @@ ARCHITECTURE tb OF tb_sdp_statistics_offload IS
CONSTANT
c_offload_time
:
NATURAL
:
=
g_offload_time
*
g_gn_index
;
--
In this tb simply use fixed network src addresses
CONSTANT
c_eth_src_mac
:
STD_LOGIC_VECTOR
(
c_network_eth_mac_addr_w
-1
DOWNTO
0
)
:
=
x"123456789ABC"
;
CONSTANT
c_ip_src_addr
:
STD_LOGIC_VECTOR
(
c_network_ip_addr_w
-1
DOWNTO
0
)
:
=
x"0A090807"
;
CONSTANT
c_udp_src_port
:
STD_LOGIC_VECTOR
(
c_network_udp_port_w
-
1
DOWNTO
0
)
:
=
func_sdp_get_stat_udp_src_port
(
g_statistics_type
,
g_gn_index
);
--
Use sim default dst and src MAC, IP, UDP port from sdp_pkg.vhd and based on g_gn_index
CONSTANT
c_
node_
eth_src_mac
:
STD_LOGIC_VECTOR
(
47
DOWNTO
0
)
:
=
c_sdp_stat_eth_src_mac_47_16
&
func_sdp_gn_index_to_mac_15_0
(
g_gn_index
)
;
CONSTANT
c_
node_
ip_src_addr
:
STD_LOGIC_VECTOR
(
31
DOWNTO
0
)
:
=
c_sdp_stat_ip_src_addr_31_16
&
func_sdp_gn_index_to_ip_15_0
(
g_gn_index
)
;
CONSTANT
c_
node_
udp_src_port
:
STD_LOGIC_VECTOR
(
1
5
DOWNTO
0
)
:
=
func_sdp_get_stat_udp_src_port
(
g_statistics_type
,
g_gn_index
);
-- Used mm_adresses on mm bus "enable_mosi/miso".
CONSTANT
c_reg_enable_mm_addr_enable
:
NATURAL
:
=
0
;
...
...
@@ -385,11 +385,7 @@ BEGIN
-- . prepare expected XST signal_input_B index, assume crosslet transport in positive direction
exp_xst_signal_input_B
<=
(
source_gn
MOD
c_sdp_N_pn_max
)
*
c_sdp_S_pn
;
exp_sdp_stat_header
<=
func_sdp_compose_stat_header
(
c_sdp_stat_eth_dst_mac
,
c_eth_src_mac
,
c_ip_src_addr
,
c_sdp_stat_ip_dst_addr
,
exp_sdp_info
,
exp_sdp_stat_header
<=
func_sdp_compose_stat_header
(
exp_sdp_info
,
g_statistics_type
,
weighted_subbands_flag
,
gn_index
,
...
...
@@ -671,9 +667,9 @@ BEGIN
out_siso
=>
sdp_offload_siso
,
-- Inputs from other blocks
eth_src_mac
=>
c_eth_src_mac
,
udp_src_port
=>
c_udp_src_port
,
ip_src_addr
=>
c_ip_src_addr
,
eth_src_mac
=>
c_
node_
eth_src_mac
,
udp_src_port
=>
c_
node_
udp_src_port
,
ip_src_addr
=>
c_
node_
ip_src_addr
,
gn_index
=>
gn_index
,
ring_info
=>
c_exp_ring_info
,
...
...
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