From 09dc961073fa6616682280deff00ba8d82812a2a Mon Sep 17 00:00:00 2001
From: Eric Kooistra <kooistra@astron.nl>
Date: Wed, 5 Oct 2022 10:10:52 +0200
Subject: [PATCH] Use ref_sync as capture moment for the running MM total
 counts in dp_block_validate_err.

---
 libraries/base/ring/src/vhdl/ring_rx.vhd | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libraries/base/ring/src/vhdl/ring_rx.vhd b/libraries/base/ring/src/vhdl/ring_rx.vhd
index 65dab32489..80f7847d42 100644
--- a/libraries/base/ring/src/vhdl/ring_rx.vhd
+++ b/libraries/base/ring/src/vhdl/ring_rx.vhd
@@ -115,6 +115,10 @@ BEGIN
   );
 
   -- Validate error field 
+  -- . Use ref_sync as capture moment for the running MM total counts in dp_block_validate_err.
+  --   The rx_packet_sosi does not have rx_packet_sosi.sync, because it carries encoded packets
+  --   and because the rx_packet_sosi can carry packets from multiple sources (so multiple sync
+  --   intervals multiplexed on one lane).
   u_dp_block_validate_err : ENTITY dp_lib.dp_block_validate_err
   GENERIC MAP (
     g_cnt_w           => c_word_w,  -- <= c_word_w = 32
@@ -123,12 +127,15 @@ BEGIN
     g_min_block_size  => c_packet_size,
     g_nof_err_counts  => g_nof_err_counts,
     g_fifo_size       => c_packet_size, -- can be same as g_max_block_size as src_in.ready = '1'
+    g_use_sync        => FALSE,  -- no need to pass on ref_sync
     g_data_w          => g_data_w
   )
   PORT MAP (
     dp_rst => dp_rst,
     dp_clk => dp_clk,
 
+    ref_sync => ref_sync,
+
     snk_in  => packet_sosi,
     src_out => validated_sosi,
 
-- 
GitLab