From f1cedbc9267534eb952ee764a296c930904be685 Mon Sep 17 00:00:00 2001
From: mriggire <marco.riggirello@cern.ch>
Date: Mon, 4 Sep 2023 16:27:16 +0200
Subject: [PATCH] LinkAggregatorCore bug fix

---
 common/firmware/hdl/LinkAggregatorCore.vhd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/firmware/hdl/LinkAggregatorCore.vhd b/common/firmware/hdl/LinkAggregatorCore.vhd
index 7f139d05..0d51e7d2 100644
--- a/common/firmware/hdl/LinkAggregatorCore.vhd
+++ b/common/firmware/hdl/LinkAggregatorCore.vhd
@@ -231,7 +231,7 @@ begin
             begin
                 if rising_edge(clk_p) then
                     if packet_start_buffered = '1' then
-                        if unsigned(count_cache) >= thresholds_l(i) and (unsigned(count_cache) <= thresholds_u(i) or thresholds_u(i) = "0000") then
+                        if unsigned(count_cache) >= thresholds_l(i) and (unsigned(count_cache) <= thresholds_u(i) or to_integer(unsigned(thresholds_u(i))) = 0) then
                             bx_valid_array(N_LINKS*j + i) <= '1';
                         else
                             bx_valid_array(N_LINKS*j + i) <= '0';
-- 
GitLab