diff --git a/applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_pkg.vhd b/applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_pkg.vhd index ff1823f32a6a1c6548be0944cc9ba1a5e1cf5bcf..d905af1d81408584d7240267628053baee46f4a5 100644 --- a/applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_pkg.vhd +++ b/applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_pkg.vhd @@ -117,6 +117,7 @@ PACKAGE BODY tb_sdp_pkg IS FUNCTION func_sdp_verify_cep_header(in_hdr, exp_hdr : t_sdp_cep_header) RETURN BOOLEAN IS + VARIABLE v_beamlet_index : NATURAL; BEGIN -- eth header ASSERT in_hdr.eth.dst_mac = exp_hdr.eth.dst_mac REPORT "Wrong beamlet eth.dst_mac" SEVERITY ERROR; @@ -160,7 +161,9 @@ PACKAGE BODY tb_sdp_pkg IS ASSERT in_hdr.app.sdp_reserved = exp_hdr.app.sdp_reserved REPORT "Wrong beamlet app.sdp_reserved" SEVERITY ERROR; ASSERT in_hdr.app.sdp_beamlet_scale = exp_hdr.app.sdp_beamlet_scale REPORT "Wrong beamlet app.sdp_beamlet_scale" SEVERITY ERROR; - ASSERT in_hdr.app.sdp_beamlet_index = exp_hdr.app.sdp_beamlet_index REPORT "Wrong beamlet app.sdp_beamlet_index" SEVERITY ERROR; + -- Treat beamlet_index modulo c_sdp_S_sub_bf, because the beamlet packets from different beamsets may arrive in arbitrary order + v_beamlet_index := TO_UINT(in_hdr.app.sdp_beamlet_index) MOD c_sdp_S_sub_bf; + ASSERT v_beamlet_index = TO_UINT(exp_hdr.app.sdp_beamlet_index) REPORT "Wrong beamlet app.sdp_beamlet_index" SEVERITY ERROR; ASSERT in_hdr.app.sdp_nof_blocks_per_packet = exp_hdr.app.sdp_nof_blocks_per_packet REPORT "Wrong beamlet app.sdp_nof_blocks_per_packet" SEVERITY ERROR; ASSERT in_hdr.app.sdp_nof_beamlets_per_block = exp_hdr.app.sdp_nof_beamlets_per_block REPORT "Wrong beamlet app.sdp_nof_beamlets_per_block" SEVERITY ERROR; ASSERT in_hdr.app.sdp_block_period = exp_hdr.app.sdp_block_period REPORT "Wrong beamlet app.sdp_block_period" SEVERITY ERROR;