From 8039670d999657052dd714c9c7c51a80cdd003ba Mon Sep 17 00:00:00 2001
From: Eric Kooistra <kooistra@astron.nl>
Date: Tue, 1 Nov 2022 10:40:44 +0100
Subject: [PATCH] Correct BG bps logging.

---
 libraries/io/eth/tb/vhdl/tb_eth_tester.vhd | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libraries/io/eth/tb/vhdl/tb_eth_tester.vhd b/libraries/io/eth/tb/vhdl/tb_eth_tester.vhd
index d0087479d3..f0f0574905 100644
--- a/libraries/io/eth/tb/vhdl/tb_eth_tester.vhd
+++ b/libraries/io/eth/tb/vhdl/tb_eth_tester.vhd
@@ -103,9 +103,9 @@ ARCHITECTURE tb OF tb_eth_tester IS
   CONSTANT c_eth_packet_len_others : NATURAL := func_eth_tester_eth_packet_length(c_bg_block_len_others);
 
   -- Use REAL to avoid NATURAL overflow in bps calculation
-  CONSTANT c_eth_nof_bps_first     : REAL := REAL(c_eth_packet_len_first * c_octet_w) * REAL(c_nof_st_clk_per_s) / REAL(c_bg_slot_len_first);
-  CONSTANT c_eth_nof_bps_others    : REAL := REAL(c_eth_packet_len_others * c_octet_w) * REAL(c_nof_st_clk_per_s) / REAL(c_bg_slot_len_others);
-  CONSTANT c_eth_nof_bps_total     : REAL := c_eth_nof_bps_first + REAL(g_nof_streams - 1) * c_eth_nof_bps_others;
+  CONSTANT c_bg_nof_bps_first      : REAL := REAL(c_bg_block_len_first * c_octet_w) * REAL(c_nof_st_clk_per_s) / REAL(c_bg_slot_len_first);
+  CONSTANT c_bg_nof_bps_others     : REAL := REAL(c_bg_block_len_others * c_octet_w) * REAL(c_nof_st_clk_per_s) / REAL(c_bg_slot_len_others);
+  CONSTANT c_bg_nof_bps_total      : REAL := c_bg_nof_bps_first + REAL(g_nof_streams - 1) * c_bg_nof_bps_others;
 
   CONSTANT c_bg_sync_period_first  : NATURAL := c_bg_slot_len_first * g_bg_ctrl_first.blocks_per_sync;
   CONSTANT c_bg_sync_period_others : NATURAL := c_bg_slot_len_others * g_bg_ctrl_others.blocks_per_sync;
@@ -346,19 +346,19 @@ BEGIN
       IF I = 0 THEN
         print_str(c_tb_str &
             "ETH bit rate (" & NATURAL'IMAGE(I) & ") :" &
-            " c_eth_nof_bps_first = " & REAL'IMAGE(c_eth_nof_bps_first) & " bps");
+            " c_bg_nof_bps_first = " & REAL'IMAGE(c_bg_nof_bps_first) & " bps");
       ELSE
         print_str(c_tb_str &
             "ETH bit rate (" & NATURAL'IMAGE(I) & ") :" &
-            " c_eth_nof_bps_others = " & REAL'IMAGE(c_eth_nof_bps_others) & " bps");
+            " c_bg_nof_bps_others = " & REAL'IMAGE(c_bg_nof_bps_others) & " bps");
       END IF;
     END LOOP;
     IF g_nof_streams > 1 THEN
         print_str(c_tb_str &
             "ETH bit rate total :" &
-            " c_eth_nof_bps_total = " & REAL'IMAGE(c_eth_nof_bps_total) & " bps");
+            " c_bg_nof_bps_total = " & REAL'IMAGE(c_bg_nof_bps_total) & " bps");
     END IF;
-    ASSERT c_eth_nof_bps_total < 10.0**9 REPORT "Tx flow control will keep ETH bitrate < 1Gbps." SEVERITY NOTE;
+    ASSERT c_bg_nof_bps_total < 10.0**9 REPORT "Tx flow control will keep ETH bitrate < 1Gbps." SEVERITY NOTE;
 
     -------------------------------------------------------------------------
     -- Verification: Total counts
@@ -397,7 +397,7 @@ BEGIN
 
       -- Verify, only log when wrong
       IF g_corrupted_en = FALSE THEN
-        IF c_eth_nof_bps_total < 10.0**9 THEN
+        IF c_bg_nof_bps_total < 10.0**9 THEN
           ASSERT tx_total_count_nof_packet_arr(I) = exp_total_count_nof_packet_arr(I) REPORT c_tb_str &
               "Wrong Tx total nof packets count(" & NATURAL'IMAGE(I) &
               "), Tx count = " & NATURAL'IMAGE(tx_total_count_nof_packet_arr(I)) &
@@ -484,7 +484,7 @@ BEGIN
           ", nof_valid = " & NATURAL'IMAGE(rx_mon_nof_valid_arr(I)) &
           ", latency = " & NATURAL'IMAGE(rx_mon_latency_arr(I)));
 
-      IF c_eth_nof_bps_total < 10.0**9 THEN
+      IF c_bg_nof_bps_total < 10.0**9 THEN
         -- Verify BSN monitors only when the BG sync interval is stable, so
         -- the ETH data rate < 1 Gbps and no BG block flow control.
         -- Verify, only log when wrong
-- 
GitLab