From f028949e63132abf8d87e5db26ebab53994cea21 Mon Sep 17 00:00:00 2001
From: Frans Schreuder <f.schreuder@nikhef.nl>
Date: Tue, 9 Jul 2024 14:35:22 +0200
Subject: [PATCH] clear last_subchunk variable at start of block

---
 sources/CRToHost/ToHostAxiStreamController.vhd | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sources/CRToHost/ToHostAxiStreamController.vhd b/sources/CRToHost/ToHostAxiStreamController.vhd
index c6e70a0ca..438afb124 100644
--- a/sources/CRToHost/ToHostAxiStreamController.vhd
+++ b/sources/CRToHost/ToHostAxiStreamController.vhd
@@ -436,6 +436,7 @@ begin
                 end if;
                 if(blockCounter = 0) then
                     first_subchunk := '0';
+                    last_subchunk := '0';
                 end if;
                 --                if((blockCounter = (NUMBER_OF_WORDS_PER_BLOCK-2)) and create_timeout_trailer = '0' and create_trailer = '0' and ((s_axis.tvalid = '1'and s_axis_tready_s = '1') or blockCounter /= 0)) then --end of block, always create trailer.
                 if(((word32out_valid_s = '0' AND blockCounter = (NUMBER_OF_WORDS_PER_BLOCK-1))  or
-- 
GitLab