From b409a56525910457a1a8bb1d0f77fd0268b02294 Mon Sep 17 00:00:00 2001
From: Reinier van der Walle <walle@astron.nl>
Date: Tue, 13 Oct 2020 16:25:07 +0200
Subject: [PATCH] ORed the err field of incoming packets to reflect combined
 error status.

---
 libraries/base/dp/src/vhdl/dp_packet_merge.vhd | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libraries/base/dp/src/vhdl/dp_packet_merge.vhd b/libraries/base/dp/src/vhdl/dp_packet_merge.vhd
index dea61acafa..47c100423e 100644
--- a/libraries/base/dp/src/vhdl/dp_packet_merge.vhd
+++ b/libraries/base/dp/src/vhdl/dp_packet_merge.vhd
@@ -318,7 +318,7 @@ BEGIN
     v.src_out.bsn     := r.src_out.bsn;
     v.src_out.channel := r.src_out.channel;
     v.src_out.empty   := r.src_out.empty;
-    v.src_out.err     := r.src_out.err;
+    v.src_out.err     := r.src_out.err OR snk_in.err; -- OR the err fields of the packets to reflect combined error status.
     v.src_out.sync    := '0';
     v.src_out.sop     := '0';
     v.src_out.eop     := '0';
@@ -329,6 +329,7 @@ BEGIN
         v.src_out.sync    := snk_in.sync;     -- only preserve sync when sync interval and nof_pkt interval are aligned, else sync gets lost but could still be recovered from BSN
         v.src_out.bsn     := snk_in.bsn;      -- use BSN     of first packet for merged packet
         v.src_out.channel := snk_in.channel;  -- use channel of first packet for merged packet
+        v.src_out.err     := snk_in.err;  
       END IF;
     END IF;
     
@@ -336,7 +337,6 @@ BEGIN
       IF r.pkt_cnt = r.nof_pkt-1 THEN
         v.src_out.eop   := '1';
         v.src_out.empty := snk_in.empty;
-        v.src_out.err   := snk_in.err;        -- use err of last packet for merged packet
       END IF;
     END IF;
     
-- 
GitLab