From 4e94d3d4511eb813a5f795479c57625d5953f443 Mon Sep 17 00:00:00 2001
From: Nayib Boukadida <nayib.boukadida@cern.ch>
Date: Fri, 2 Feb 2024 20:41:37 +0100
Subject: [PATCH] Added fix for short burst messages (with SEOP)

---
 .../interlaken/transmitter/interlaken_transmitter_channel.vhd | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sources/interlaken/transmitter/interlaken_transmitter_channel.vhd b/sources/interlaken/transmitter/interlaken_transmitter_channel.vhd
index 3a75117..18977f7 100644
--- a/sources/interlaken/transmitter/interlaken_transmitter_channel.vhd
+++ b/sources/interlaken/transmitter/interlaken_transmitter_channel.vhd
@@ -201,12 +201,12 @@ begin
         if(insert_burst_short = '1') then
             idle_pad <= '1';
             burstCounter := burstCounter + 8;
-            if burstCounter = (BurstShort) then
+            if burstCounter >= (BurstShort) then -- equal or bigger (since EOP/tlast and burst short can trigger same moment and miss the equal frame)
                 burstCounter := 0;
                 insert_burst_short <= '0';
                 idle_pad <= '0';
             end if;
-        elsif SOP_FLAG = '1' then
+        elsif SOP_FLAG = '1' or insert_burst_seop = '1' then -- reset counter after SOP of SEOP word
             burstCounter :=  0; --SOP is not counted in frame length, so all others are counter
         elsif(m_axis_mapped.tvalid = '1' and m_axis_tready_mapped = '1' and axis_burst_mode = '0') then
             if (m_axis_mapped.tlast = '0') then
-- 
GitLab