diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd index b08a4b80ef3714623c82db66b4cfacf35dad5d08..b56659d1cbd979a31db04feb6da4a07b52a2db6d 100644 --- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd +++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd @@ -219,9 +219,23 @@ PACKAGE sdp_pkg is CONSTANT c_sdp_stat_version_id : NATURAL := 5; CONSTANT c_sdp_stat_nof_hdr_fields : NATURAL := 1+3+12+4+20+1; -- 608b; 19 32b words - CONSTANT c_sdp_stat_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_stat_nof_hdr_fields-1 DOWNTO 0) := "1"&"101"&"111011111001"&"0100"&"0100"&"000000010"&"1000000"&"0"; -- 0=data path, 1=MM controlled ---CONSTANT c_sdp_stat_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_stat_nof_hdr_fields-1 DOWNTO 0) := "1"&"101"&"111011111001"&"0101"&"0100"&"000000000"&"0000100"&"0"; -- 0=data path, 1=MM controlled TODO (26 nov 2021) ---CONSTANT c_sdp_stat_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_stat_nof_hdr_fields-1 DOWNTO 0) := "0"&"100"&"000000010001"&"0100"&"0100"&"000000010"&"1000000"&"0"; -- 0=data path, 1=MM controlled TODO + -- hdr_field_sel bit selects where the hdr_field value is set: + -- . 0 = data path controlled, value is set in sdp_statistics_offload.vhd, so field_default() is not used. + -- . 1 = MM controlled, value is set via MM or by the field_default(), so any data path setting in + -- sdp_statistics_offload.vhd is not used. + -- Remarks: + -- . For constant values it is convenient to use MM controlled, because then the field_default() + -- is used that can be set here in c_sdp_stat_hdr_field_arr. + -- . For reserved values it is convenient to use MM controlled, because then in future they + -- could still be changed via MM without having to recompile the FW. + -- . Typically only use data path controlled if the value has to be set dynamically, so dependent + -- on the state of the FW. + -- . If a data path controlled field is not set in the FW, then it defaults to 0, e.g. udp_checksum, + -- so this is equivalent to using MM controlled and field_default(0). + -- eth ip udp app + CONSTANT c_sdp_stat_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_stat_nof_hdr_fields-1 DOWNTO 0) := "1"&"101"&"111011111001"&"0100"&"0100"&"000000010"&"1000000"&"0"; -- current +--CONSTANT c_sdp_stat_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_stat_nof_hdr_fields-1 DOWNTO 0) := "1"&"101"&"111011111001"&"0101"&"0100"&"000000000"&"0000100"&"0"; -- previous 26 nov 2021 +--CONSTANT c_sdp_stat_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_stat_nof_hdr_fields-1 DOWNTO 0) := "0"&"100"&"000000010001"&"0100"&"0100"&"000000010"&"1000000"&"0"; -- initial CONSTANT c_sdp_stat_hdr_field_arr : t_common_field_arr(c_sdp_stat_nof_hdr_fields-1 DOWNTO 0) := ( ( field_name_pad("word_align" ), "RW", 16, field_default(0) ), -- Tx TSE IP will strip these 2 padding bytes @@ -232,7 +246,7 @@ PACKAGE sdp_pkg is ( field_name_pad("ip_version" ), "RW", 4, field_default(4) ), ( field_name_pad("ip_header_length" ), "RW", 4, field_default(5) ), ( field_name_pad("ip_services" ), "RW", 8, field_default(0) ), - ( field_name_pad("ip_total_length" ), "RW", 16, field_default(0) ), + ( field_name_pad("ip_total_length" ), "RW", 16, field_default(0) ), -- differs for SST, BST, XST so set by data path ( field_name_pad("ip_identification" ), "RW", 16, field_default(0) ), ( field_name_pad("ip_flags" ), "RW", 3, field_default(2) ), ( field_name_pad("ip_fragment_offset" ), "RW", 13, field_default(0) ), @@ -244,10 +258,10 @@ PACKAGE sdp_pkg is ( field_name_pad("udp_src_port" ), "RW", 16, field_default(0) ), ( field_name_pad("udp_dst_port" ), "RW", 16, field_default(c_sdp_stat_udp_dst_port) ), - ( field_name_pad("udp_total_length" ), "RW", 16, field_default(0) ), + ( field_name_pad("udp_total_length" ), "RW", 16, field_default(0) ), -- differs for SST, BST, XST so set by data path ( field_name_pad("udp_checksum" ), "RW", 16, field_default(0) ), - ( field_name_pad("sdp_marker" ), "RW", 8, field_default(0) ), + ( field_name_pad("sdp_marker" ), "RW", 8, field_default(0) ), -- differs for SST, BST, XST so set by data path ( field_name_pad("sdp_version_id" ), "RW", 8, field_default(c_sdp_stat_version_id) ), ( field_name_pad("sdp_observation_id" ), "RW", 32, field_default(0) ), ( field_name_pad("sdp_station_id" ), "RW", 16, field_default(0) ), @@ -346,8 +360,15 @@ PACKAGE sdp_pkg is CONSTANT c_sdp_cep_packet_nof_longwords : NATURAL := ceil_div(c_sdp_cep_header_len, c_longword_sz) + c_sdp_cep_payload_nof_longwords; -- without tail CRC, the CRC is applied by 10GbE MAC CONSTANT c_sdp_cep_nof_hdr_fields : NATURAL := 3+12+4+18+1; -- c_sdp_cep_header_len / c_longword_sz = 74 / 8 = 9.25 64b words = 592b - CONSTANT c_sdp_cep_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_cep_nof_hdr_fields-1 DOWNTO 0) := "101"&"111111111001"&"0111"&"1100"&"00000010"&"000110"&"0"; -- 0=data path, 1=MM controlled TODO ---CONSTANT c_sdp_cep_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_cep_nof_hdr_fields-1 DOWNTO 0) := "100"&"000000010001"&"0100"&"0100"&"00000000"&"101000"&"0"; -- 0=data path, 1=MM controlled TODO + -- hdr_field_sel bit selects where the hdr_field value is set: + -- . 0 = data path controlled, value is set in sdp_beamformer_output.vhd, so field_default() is not used. + -- . 1 = MM controlled, value is set via MM or by the field_default(), so any data path setting in + -- sdp_beamformer_output.vhd is not used. + -- Remarks: see remarks at c_sdp_stat_nof_hdr_fields. + -- eth ip udp app + CONSTANT c_sdp_cep_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_cep_nof_hdr_fields-1 DOWNTO 0) := "111"&"111111111011"&"1110"&"1100"&"00000010"&"100110"&"0"; -- current +--CONSTANT c_sdp_cep_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_cep_nof_hdr_fields-1 DOWNTO 0) := "101"&"111111111001"&"0111"&"1100"&"00000010"&"000110"&"0"; -- previous 27 sep 2022 +--CONSTANT c_sdp_cep_hdr_field_sel : STD_LOGIC_VECTOR(c_sdp_cep_nof_hdr_fields-1 DOWNTO 0) := "100"&"000000010001"&"0100"&"0100"&"00000000"&"101000"&"0"; -- initial CONSTANT c_sdp_cep_hdr_field_arr : t_common_field_arr(c_sdp_cep_nof_hdr_fields-1 DOWNTO 0) := ( ( field_name_pad("eth_dst_mac" ), "RW", 48, field_default(c_sdp_cep_eth_dst_mac) ),