From 319bdbcb27d9602e99caaf8047cb3ec873b6f844 Mon Sep 17 00:00:00 2001 From: Erik Kooistra <kooistra@astron.nl> Date: Fri, 21 Dec 2018 11:17:56 +0000 Subject: [PATCH] Pass on the other snk_in_arr fields as well, so e.g. preserve sync field also with the packetized data. Fixed potential bug in case the header fits in a single word, by assigning valid = sop = eop. --- .../base/dp/src/vhdl/dp_concat_field_blk.vhd | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libraries/base/dp/src/vhdl/dp_concat_field_blk.vhd b/libraries/base/dp/src/vhdl/dp_concat_field_blk.vhd index 2e531791bb..7430a6a5c5 100644 --- a/libraries/base/dp/src/vhdl/dp_concat_field_blk.vhd +++ b/libraries/base/dp/src/vhdl/dp_concat_field_blk.vhd @@ -106,8 +106,18 @@ BEGIN p_wire_valid : PROCESS(snk_in_arr, hdr_fields_in_arr) BEGIN FOR i IN 0 TO g_nof_streams-1 LOOP - dp_field_blk_snk_in_arr(i).data(field_slv_len(g_hdr_field_arr)-1 DOWNTO 0) <= hdr_fields_in_arr(i)(field_slv_len(g_hdr_field_arr)-1 DOWNTO 0); - dp_field_blk_snk_in_arr(i).valid <= snk_in_arr(i).sop; + -- default pass on the other snk_in_arr fields as well, especially the sync, bsn and channel can + -- be useful to preserve for the packetized output, even though only the sosi.data of the + -- packetized output will get transmitted. + dp_field_blk_snk_in_arr(i) <= snk_in_arr(i); + -- Prepare packet header as a data block with only one data word, so valid = sop = eop. If + -- c_dp_field_blk_snk_data_w > c_dp_field_blk_src_data_w then dp_repack_data in dp_field_blk will + -- repack this data word into a multi word header block, else dp_field_blk will pass on the + -- dp_field_blk_snk_in_arr as a single word header block. + dp_field_blk_snk_in_arr(i).data <= RESIZE_DP_DATA(hdr_fields_in_arr(i)(field_slv_len(g_hdr_field_arr)-1 DOWNTO 0)); + dp_field_blk_snk_in_arr(i).valid <= snk_in_arr(i).sop; + dp_field_blk_snk_in_arr(i).sop <= snk_in_arr(i).sop; -- necessary for single word header block + dp_field_blk_snk_in_arr(i).eop <= snk_in_arr(i).sop; -- necessary for single word header block END LOOP; END PROCESS; @@ -146,6 +156,7 @@ BEGIN END GENERATE; + -- Prepend the header block to the input block gen_dp_concat : FOR i IN 0 TO g_nof_streams-1 GENERATE dp_concat_snk_in_2arr(i)(0) <= snk_in_arr(i); -- GitLab