diff --git a/sources/CRToHost/ToHostAxiStreamController.vhd b/sources/CRToHost/ToHostAxiStreamController.vhd index 5305ff3711c9e418ed5d2ef2e8d8392fe6db491c..6d903cb8c67455d967a44bc4df723274de650aae 100644 --- a/sources/CRToHost/ToHostAxiStreamController.vhd +++ b/sources/CRToHost/ToHostAxiStreamController.vhd @@ -114,6 +114,7 @@ architecture Behavioral of ToHostAxiStreamController is signal is_soc : std_logic_vector(STREAMS_TOHOST-1 downto 0); --This is the next valid word after s_axis.tlast. signal stream_select_s: integer range 0 to STREAMS_TOHOST; + signal stream_select_p1_s: integer range 0 to STREAMS_TOHOST; --pipelined version signal stream_select_switched: std_logic; signal stream_select_and_value : axis_tready_array_type(0 to STREAMS_TOHOST-1); signal SwitchAxiStream : std_logic; @@ -447,11 +448,13 @@ begin ChunkErrorFlag := '0'; BUSYFlag := '0'; trunc := '0'; + stream_select_p1_s <= STREAMS_TOHOST; else reset_chunkCounter_chunk <= '0'; create_trailer_v := '0'; create_trailer <= '0'; + stream_select_p1_s <= stream_select_s; --1 clock delayed stream_select for is_soc generation. if(s_axis.tvalid = '1' and s_axis_tready_s = '1') then if(s_axis.tuser(0) = '1') then -- Check for CRC error flag in tuser CRCErrorFlag := '1'; @@ -499,9 +502,6 @@ begin create_zero_trailer <= '1'; --will be pipelined, zero trailer comes next clock cycle end if; if(create_trailer_v = '1') then --add trailer to the datastream, - if trunc = '1' then - is_soc(stream_select_s) <= '1'; - end if; trailerType := (((not first_subchunk(stream_select_s)) and (not last_subchunk(stream_select_s))) and (not trunc)) & (last_subchunk(stream_select_s) or trunc) & first_subchunk(stream_select_s); @@ -515,6 +515,9 @@ begin end if; if create_zero_trailer = '1' then create_zero_trailer <= '0'; + if chunk_trailer(12) = '1' then --Truncation flag was set + is_soc(stream_select_p1_s) <= '1'; + end if; end if; if ( create_timeout_trailer = '1' and create_trailer = '0' and create_zero_trailer = '0') then -- implement timout mechanism. Check reset chunk counter to make sure we don't get 2 timeoout trailers next to each other. is_soc(stream_select_s) <= '1';