From 339a0b60f59db60d9a7f5361616207caaa8c2fac Mon Sep 17 00:00:00 2001
From: donker <donker@astron.nl>
Date: Thu, 25 Jun 2020 09:01:14 +0200
Subject: [PATCH] L2SDP-78, changes after in between review Eric.

---
 libraries/io/ppsh/src/vhdl/ppsh.vhd     | 5 +----
 libraries/io/ppsh/src/vhdl/ppsh_reg.vhd | 4 +++-
 libraries/io/ppsh/tb/vhdl/tb_ppsh.vhd   | 2 --
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/libraries/io/ppsh/src/vhdl/ppsh.vhd b/libraries/io/ppsh/src/vhdl/ppsh.vhd
index 40f63e29fc..eb9dc3991b 100644
--- a/libraries/io/ppsh/src/vhdl/ppsh.vhd
+++ b/libraries/io/ppsh/src/vhdl/ppsh.vhd
@@ -93,8 +93,6 @@ ARCHITECTURE rtl OF ppsh IS
   
   SIGNAL i_capture_cnt     : STD_LOGIC_VECTOR(capture_cnt'RANGE) := (OTHERS=>'1');
 
-  SIGNAL i_offset_cnt      : STD_LOGIC_VECTOR(offset_cnt'RANGE) := (OTHERS=>'1');
-
   SIGNAL pps_sys_buf       : STD_LOGIC;
   SIGNAL i_pps_toggle      : STD_LOGIC;
   SIGNAL nxt_pps_toggle    : STD_LOGIC;
@@ -105,7 +103,6 @@ ARCHITECTURE rtl OF ppsh IS
 BEGIN
 
   capture_cnt <= i_capture_cnt;
-  offset_cnt  <= i_offset_cnt;
   pps_toggle  <= i_pps_toggle;
 
   pps_ext_delayed(0) <= pps_ext;  -- no input delay support
@@ -176,7 +173,7 @@ BEGIN
     in_evt        => pps_ext_revt,
     -- MM
     interval_cnt  => i_capture_cnt,
-    clk_cnt       => i_offset_cnt
+    clk_cnt       => offset_cnt
   );
   
   -- Output the pps_sys with extra pipelining to ease timing of pps_sys fan out
diff --git a/libraries/io/ppsh/src/vhdl/ppsh_reg.vhd b/libraries/io/ppsh/src/vhdl/ppsh_reg.vhd
index de648f5e9f..31789f7f36 100644
--- a/libraries/io/ppsh/src/vhdl/ppsh_reg.vhd
+++ b/libraries/io/ppsh/src/vhdl/ppsh_reg.vhd
@@ -31,6 +31,8 @@
 --  |-----------------------------------------------------------------------|
 --  |edge[31],                xxx                       expected_cnt = [n:0]|  1
 --  |-----------------------------------------------------------------------|
+--  |                         xxx                         offset_cnt = [n:0]|  2
+--  |-----------------------------------------------------------------------|
 
 
 -- Info from L2SDP-78 ticket.
@@ -230,7 +232,7 @@ BEGIN
       out_new     => OPEN
     );
 
-  u_offset_cnt : ENTITY common_lib.common_reg_cross_domain
+    u_offset_cnt : ENTITY common_lib.common_reg_cross_domain
     PORT MAP (
       in_rst      => st_rst,
       in_clk      => st_clk,
diff --git a/libraries/io/ppsh/tb/vhdl/tb_ppsh.vhd b/libraries/io/ppsh/tb/vhdl/tb_ppsh.vhd
index c775285732..4887a8489d 100644
--- a/libraries/io/ppsh/tb/vhdl/tb_ppsh.vhd
+++ b/libraries/io/ppsh/tb/vhdl/tb_ppsh.vhd
@@ -246,14 +246,12 @@ BEGIN
 
       -- check if offset_cnt is counting
       IF (NOW > 7500 ms) AND (NOW <= 7500 ms + c_clk_period) THEN
-        --REPORT "PPSH : offset_cnt = " & integer'image(To_integer(unsigned(offset_cnt))) SEVERITY ERROR;
         IF UNSIGNED(offset_cnt)/=475 THEN
           REPORT "PPSH : Unexpected offset count value at 5.5 s." SEVERITY ERROR;
         END IF;
       END IF;
 
       IF (NOW > 7700 ms) AND (NOW <= 7700 ms + c_clk_period) THEN
-        --REPORT "PPSH : offset_cnt = " & integer'image(To_integer(unsigned(offset_cnt))) SEVERITY ERROR;
         IF UNSIGNED(offset_cnt)/=675 THEN
           REPORT "PPSH : Unexpected offset count value at 5.5 s." SEVERITY ERROR;
         END IF;
-- 
GitLab