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
4c1aeea5
Commit
4c1aeea5
authored
2 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Verify BST offload header.
parent
4845ed69
No related branches found
No related tags found
1 merge request
!283
Resolve L2SDP-696
Pipeline
#36834
passed
2 years ago
Stage: simulation
Stage: synthesis
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/lofar2/designs/lofar2_unb2c_sdp_station/revisions/lofar2_unb2c_sdp_station_bf/tb_lofar2_unb2c_sdp_station_bf_bst_offload.vhd
+72
-10
72 additions, 10 deletions
...station_bf/tb_lofar2_unb2c_sdp_station_bf_bst_offload.vhd
with
72 additions
and
10 deletions
applications/lofar2/designs/lofar2_unb2c_sdp_station/revisions/lofar2_unb2c_sdp_station_bf/tb_lofar2_unb2c_sdp_station_bf_bst_offload.vhd
+
72
−
10
View file @
4c1aeea5
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
-- > as 7 # default
-- > as 7 # default
-- > as 12 # for detailed debugging
-- > as 12 # for detailed debugging
-- > run -a
-- > run -a
-- Takes about
1
0 m
-- Takes about
2
0 m
--
--
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
LIBRARY
IEEE
,
common_lib
,
unb2c_board_lib
,
i2c_lib
,
mm_lib
,
dp_lib
,
diag_lib
,
lofar2_sdp_lib
,
wpfb_lib
,
lofar2_unb2c_sdp_station_lib
,
eth_lib
;
LIBRARY
IEEE
,
common_lib
,
unb2c_board_lib
,
i2c_lib
,
mm_lib
,
dp_lib
,
diag_lib
,
lofar2_sdp_lib
,
wpfb_lib
,
lofar2_unb2c_sdp_station_lib
,
eth_lib
;
...
@@ -52,6 +52,7 @@ USE mm_lib.mm_file_unb_pkg.ALL;
...
@@ -52,6 +52,7 @@ USE mm_lib.mm_file_unb_pkg.ALL;
USE
diag_lib
.
diag_pkg
.
ALL
;
USE
diag_lib
.
diag_pkg
.
ALL
;
USE
wpfb_lib
.
wpfb_pkg
.
ALL
;
USE
wpfb_lib
.
wpfb_pkg
.
ALL
;
USE
lofar2_sdp_lib
.
sdp_pkg
.
ALL
;
USE
lofar2_sdp_lib
.
sdp_pkg
.
ALL
;
USE
lofar2_sdp_lib
.
tb_sdp_pkg
.
ALL
;
ENTITY
tb_lofar2_unb2c_sdp_station_bf_bst_offload
IS
ENTITY
tb_lofar2_unb2c_sdp_station_bf_bst_offload
IS
END
tb_lofar2_unb2c_sdp_station_bf_bst_offload
;
END
tb_lofar2_unb2c_sdp_station_bf_bst_offload
;
...
@@ -60,13 +61,15 @@ ARCHITECTURE tb OF tb_lofar2_unb2c_sdp_station_bf_bst_offload IS
...
@@ -60,13 +61,15 @@ ARCHITECTURE tb OF tb_lofar2_unb2c_sdp_station_bf_bst_offload IS
CONSTANT
c_sim
:
BOOLEAN
:
=
TRUE
;
CONSTANT
c_sim
:
BOOLEAN
:
=
TRUE
;
CONSTANT
c_unb_nr
:
NATURAL
:
=
0
;
-- UniBoard 0
CONSTANT
c_unb_nr
:
NATURAL
:
=
0
;
-- UniBoard 0
CONSTANT
c_node_nr
:
NATURAL
:
=
0
;
CONSTANT
c_node_nr
:
NATURAL
:
=
0
;
CONSTANT
c_id
:
STD_LOGIC_VECTOR
(
7
DOWNTO
0
)
:
=
"00000000"
;
CONSTANT
c_gn_nr
:
NATURAL
:
=
c_unb_nr
*
4
+
c_node_nr
;
CONSTANT
c_id
:
STD_LOGIC_VECTOR
(
7
DOWNTO
0
)
:
=
TO_UVEC
(
c_gn_nr
,
8
);
CONSTANT
c_version
:
STD_LOGIC_VECTOR
(
1
DOWNTO
0
)
:
=
"00"
;
CONSTANT
c_version
:
STD_LOGIC_VECTOR
(
1
DOWNTO
0
)
:
=
"00"
;
CONSTANT
c_fw_version
:
t_unb2c_board_fw_version
:
=
(
1
,
0
);
CONSTANT
c_fw_version
:
t_unb2c_board_fw_version
:
=
(
1
,
0
);
CONSTANT
c_eth_clk_period
:
TIME
:
=
8
ns
;
-- 125 MHz XO on UniBoard
CONSTANT
c_eth_clk_period
:
TIME
:
=
8
ns
;
-- 125 MHz XO on UniBoard
CONSTANT
c_ext_clk_period
:
TIME
:
=
5
ns
;
CONSTANT
c_ext_clk_period
:
TIME
:
=
5
ns
;
CONSTANT
c_mm_clk_period
:
TIME
:
=
10
ns
;
-- 100 MHz internal mm_clk
CONSTANT
c_bck_ref_clk_period
:
TIME
:
=
5
ns
;
CONSTANT
c_bck_ref_clk_period
:
TIME
:
=
5
ns
;
CONSTANT
c_tb_clk_period
:
TIME
:
=
100
ps
;
-- use fast tb_clk to speed up M&C
CONSTANT
c_tb_clk_period
:
TIME
:
=
100
ps
;
-- use fast tb_clk to speed up M&C
...
@@ -77,9 +80,25 @@ ARCHITECTURE tb OF tb_lofar2_unb2c_sdp_station_bf_bst_offload IS
...
@@ -77,9 +80,25 @@ ARCHITECTURE tb OF tb_lofar2_unb2c_sdp_station_bf_bst_offload IS
CONSTANT
c_wpfb_sim
:
t_wpfb
:
=
func_wpfb_set_nof_block_per_sync
(
c_sdp_wpfb_subbands
,
c_nof_block_per_sync
);
CONSTANT
c_wpfb_sim
:
t_wpfb
:
=
func_wpfb_set_nof_block_per_sync
(
c_sdp_wpfb_subbands
,
c_nof_block_per_sync
);
CONSTANT
c_nof_sync
:
NATURAL
:
=
1
;
CONSTANT
c_nof_sync
:
NATURAL
:
=
1
;
-- MM
-- header fields
CONSTANT
c_mm_file_reg_bsn_source_v2
:
STRING
:
=
mmf_unb_file_prefix
(
c_unb_nr
,
c_node_nr
)
&
"REG_BSN_SOURCE_V2"
;
CONSTANT
c_exp_beamlet_index
:
NATURAL
:
=
0
;
-- depends on beamset bset * c_sdp_S_sub_bf
CONSTANT
c_mm_file_reg_stat_enable_bst
:
STRING
:
=
mmf_unb_file_prefix
(
c_unb_nr
,
c_node_nr
)
&
"REG_STAT_ENABLE_BST"
;
CONSTANT
c_exp_sdp_info
:
t_sdp_info
:
=
(
TO_UVEC
(
601
,
16
),
-- station_id
'0'
,
-- antenna_band_index
x"7FFFFFFF"
,
-- observation_id, use > 0 to avoid Warning: (vsim-151) NUMERIC_STD.TO_INTEGER: Value -2 is not in bounds of subtype NATURAL.
b"01"
,
-- nyquist_zone_index, 0 = first, 1 = second, 2 = third
'1'
,
-- f_adc, 0 = 160 MHz, 1 = 200 MHz
'0'
,
-- fsub_type, 0 = critically sampled, 1 = oversampled
'0'
,
-- beam_repositioning_flag
x"1400"
-- block_period = 5120
);
-- MM
CONSTANT
c_mm_file_reg_sdp_info
:
STRING
:
=
mmf_unb_file_prefix
(
c_unb_nr
,
c_node_nr
)
&
"REG_SDP_INFO"
;
CONSTANT
c_mm_file_reg_bsn_source_v2
:
STRING
:
=
mmf_unb_file_prefix
(
c_unb_nr
,
c_node_nr
)
&
"REG_BSN_SOURCE_V2"
;
CONSTANT
c_mm_file_reg_stat_enable_bst
:
STRING
:
=
mmf_unb_file_prefix
(
c_unb_nr
,
c_node_nr
)
&
"REG_STAT_ENABLE_BST"
;
CONSTANT
c_mm_file_reg_stat_hdr_dat_bst
:
STRING
:
=
mmf_unb_file_prefix
(
c_unb_nr
,
c_node_nr
)
&
"REG_STAT_HDR_DAT_BST"
;
-- Tb
-- Tb
SIGNAL
tb_end
:
STD_LOGIC
:
=
'0'
;
SIGNAL
tb_end
:
STD_LOGIC
:
=
'0'
;
...
@@ -94,13 +113,15 @@ ARCHITECTURE tb OF tb_lofar2_unb2c_sdp_station_bf_bst_offload IS
...
@@ -94,13 +113,15 @@ ARCHITECTURE tb OF tb_lofar2_unb2c_sdp_station_bf_bst_offload IS
CONSTANT
c_eth_crc_size
:
NATURAL
:
=
1
;
-- word
CONSTANT
c_eth_crc_size
:
NATURAL
:
=
1
;
-- word
CONSTANT
c_eth_packet_size
:
NATURAL
:
=
c_eth_header_size
+
c_eth_crc_size
+
(
c_sdp_W_statistic
/
c_word_w
)
*
c_sdp_S_sub_bf
*
c_sdp_N_pol
;
-- 20 + 2 * 488 * 2 = 1972
CONSTANT
c_eth_packet_size
:
NATURAL
:
=
c_eth_header_size
+
c_eth_crc_size
+
(
c_sdp_W_statistic
/
c_word_w
)
*
c_sdp_S_sub_bf
*
c_sdp_N_pol
;
-- 20 + 2 * 488 * 2 = 1972
CONSTANT
c_eth_check_nof_valid
:
NATURAL
:
=
c_eth_check_nof_packets
*
c_eth_packet_size
;
CONSTANT
c_eth_check_nof_valid
:
NATURAL
:
=
c_eth_check_nof_packets
*
c_eth_packet_size
;
CONSTANT
c_eth_runtime_timeout
:
TIME
:
=
(
c_nof_sync
+
1
)
*
c_nof_clk_per_sync
*
c_ext_clk_period
;
-- eth statistics should be done after c_nof_sync intervals
-- eth statistics should be done after c_nof_sync + 1 intervals (+1 because first new_interval is skipped)
CONSTANT
c_eth_runtime_timeout
:
TIME
:
=
(
c_nof_sync
+
2
)
*
c_nof_clk_per_sync
*
c_ext_clk_period
;
-- DUT
-- DUT
SIGNAL
ext_clk
:
STD_LOGIC
:
=
'0'
;
SIGNAL
ext_clk
:
STD_LOGIC
:
=
'0'
;
SIGNAL
pps
:
STD_LOGIC
:
=
'0'
;
SIGNAL
pps
:
STD_LOGIC
:
=
'0'
;
SIGNAL
ext_pps
:
STD_LOGIC
:
=
'0'
;
SIGNAL
ext_pps
:
STD_LOGIC
:
=
'0'
;
SIGNAL
pps_rst
:
STD_LOGIC
:
=
'
0
'
;
SIGNAL
pps_rst
:
STD_LOGIC
:
=
'
1
'
;
SIGNAL
WDI
:
STD_LOGIC
;
SIGNAL
WDI
:
STD_LOGIC
;
SIGNAL
INTA
:
STD_LOGIC
;
SIGNAL
INTA
:
STD_LOGIC
;
...
@@ -119,6 +140,7 @@ ARCHITECTURE tb OF tb_lofar2_unb2c_sdp_station_bf_bst_offload IS
...
@@ -119,6 +140,7 @@ ARCHITECTURE tb OF tb_lofar2_unb2c_sdp_station_bf_bst_offload IS
SIGNAL
rx_hdr_fields_out
:
STD_LOGIC_VECTOR
(
1023
DOWNTO
0
);
SIGNAL
rx_hdr_fields_out
:
STD_LOGIC_VECTOR
(
1023
DOWNTO
0
);
SIGNAL
rx_hdr_fields_raw
:
STD_LOGIC_VECTOR
(
1023
DOWNTO
0
)
:
=
(
OTHERS
=>
'0'
);
SIGNAL
rx_hdr_fields_raw
:
STD_LOGIC_VECTOR
(
1023
DOWNTO
0
)
:
=
(
OTHERS
=>
'0'
);
SIGNAL
rx_sdp_stat_header
:
t_sdp_stat_header
;
SIGNAL
rx_sdp_stat_header
:
t_sdp_stat_header
;
SIGNAL
exp_sdp_stat_header
:
t_sdp_stat_header
;
-- back transceivers
-- back transceivers
SIGNAL
JESD204B_SERIAL_DATA
:
STD_LOGIC_VECTOR
(
c_sdp_S_pn
-1
downto
0
);
SIGNAL
JESD204B_SERIAL_DATA
:
STD_LOGIC_VECTOR
(
c_sdp_S_pn
-1
downto
0
);
...
@@ -199,7 +221,26 @@ BEGIN
...
@@ -199,7 +221,26 @@ BEGIN
BEGIN
BEGIN
-- Wait for DUT power up after reset
-- Wait for DUT power up after reset
WAIT
FOR
1
us
;
WAIT
FOR
1
us
;
pps_rst
<=
'0'
;
----------------------------------------------------------------------------
-- Offload destination MAC/IP/UDP
----------------------------------------------------------------------------
mmf_mm_bus_wr
(
c_mm_file_reg_stat_hdr_dat_bst
,
42
,
TO_UINT
(
c_sdp_stat_eth_dst_mac
(
47
DOWNTO
32
)),
tb_clk
);
mmf_mm_bus_wr
(
c_mm_file_reg_stat_hdr_dat_bst
,
41
,
TO_SINT
(
c_sdp_stat_eth_dst_mac
(
31
DOWNTO
0
)),
tb_clk
);
-- use signed to fit 32 b in INTEGER
mmf_mm_bus_wr
(
c_mm_file_reg_stat_hdr_dat_bst
,
26
,
TO_SINT
(
c_sdp_stat_ip_dst_addr
),
tb_clk
);
-- use signed to fit 32 b in INTEGER
mmf_mm_bus_wr
(
c_mm_file_reg_stat_hdr_dat_bst
,
24
,
TO_UINT
(
c_sdp_stat_udp_dst_port
),
tb_clk
);
proc_common_wait_cross_clock_domain_latency
(
c_mm_clk_period
,
c_ext_clk_period
);
----------------------------------------------------------------------------
-- Set SDP info
----------------------------------------------------------------------------
mmf_mm_bus_wr
(
c_mm_file_reg_sdp_info
,
7
,
TO_UINT
(
c_exp_sdp_info
.
station_id
),
tb_clk
);
mmf_mm_bus_wr
(
c_mm_file_reg_sdp_info
,
6
,
TO_UINT
(
slv
(
c_exp_sdp_info
.
antenna_band_index
)),
tb_clk
);
mmf_mm_bus_wr
(
c_mm_file_reg_sdp_info
,
5
,
TO_UINT
(
c_exp_sdp_info
.
observation_id
),
tb_clk
);
mmf_mm_bus_wr
(
c_mm_file_reg_sdp_info
,
4
,
TO_UINT
(
c_exp_sdp_info
.
nyquist_zone_index
),
tb_clk
);
mmf_mm_bus_wr
(
c_mm_file_reg_sdp_info
,
1
,
TO_UINT
(
slv
(
c_exp_sdp_info
.
beam_repositioning_flag
)),
tb_clk
);
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-- Enable BSN
-- Enable BSN
----------------------------------------------------------------------------
----------------------------------------------------------------------------
...
@@ -244,7 +285,7 @@ BEGIN
...
@@ -244,7 +285,7 @@ BEGIN
eth_rx_data
<=
eth_rx_sosi
.
data
(
c_32
-1
DOWNTO
0
);
eth_rx_data
<=
eth_rx_sosi
.
data
(
c_32
-1
DOWNTO
0
);
-- . Verify XST packet header
-- . Verify XST packet header
u_
rx_statistics
:
ENTITY
dp_lib
.
dp_offload_rx
u_
dp_offload_rx
:
ENTITY
dp_lib
.
dp_offload_rx
GENERIC
MAP
(
GENERIC
MAP
(
g_nof_streams
=>
1
,
g_nof_streams
=>
1
,
g_data_w
=>
c_word_w
,
g_data_w
=>
c_word_w
,
...
@@ -269,4 +310,25 @@ BEGIN
...
@@ -269,4 +310,25 @@ BEGIN
rx_sdp_stat_header
<=
func_sdp_map_stat_header
(
rx_hdr_fields_raw
);
rx_sdp_stat_header
<=
func_sdp_map_stat_header
(
rx_hdr_fields_raw
);
exp_sdp_stat_header
<=
func_sdp_compose_stat_header
(
c_exp_sdp_info
,
"BST"
,
'1'
,
-- fixed '1' for BST and XST, weighted_subbands_flag
c_gn_nr
,
c_nof_block_per_sync
,
0
,
-- not used for BST, sst_signal_input
c_exp_beamlet_index
,
0
,
-- not used for BST, subband_index
0
,
-- not used for BST, xst_signal_input_A
0
,
-- not used for BST, xst_signal_input_B
0
);
-- dp_bsn
p_verify_header
:
PROCESS
(
rx_offload_sosi
)
VARIABLE
v_bool
:
BOOLEAN
;
BEGIN
-- Prepare exp_sdp_stat_header before rx_offload_sosi.eop, so that it can be verified at rx_offload_sosi.eop
IF
rx_offload_sosi
.
eop
=
'1'
THEN
v_bool
:
=
func_sdp_verify_stat_header
(
"BST"
,
rx_sdp_stat_header
,
exp_sdp_stat_header
);
END
IF
;
END
PROCESS
;
END
tb
;
END
tb
;
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