diff --git a/hdl/combpm_protocol_electron.vhd b/hdl/combpm_protocol_electron.vhd index c36c6ac53805549bfd26ec392b90a5bd415d12ef..214f3b6e2550faa83ce74542719f5ab026955286 100644 --- a/hdl/combpm_protocol_electron.vhd +++ b/hdl/combpm_protocol_electron.vhd @@ -84,6 +84,8 @@ architecture rtl of combpm_protocol_electron is signal packet : t_bpmpacket; signal m_axi_tvalid : std_logic; + signal pps_r : std_logic; + begin @@ -276,19 +278,23 @@ begin p_framecnt:process(clk, rst_n) begin if rst_n = '0' then - cnt_frame_seq_r <= (others => '0'); - cnt_valid_r <= (others => '0'); - cnt_invalid_r <= (others => '0'); - rate_valid_r <= (others => '0'); - rate_invalid_r <= (others => '0'); - frame_valid_rate<= (others => '0'); - frame_invalid_rate<= (others => '0'); - last_seq <= (others => '0'); - last_cnt_seq_r <= (others => '0'); - seq_discontinuity <= '0'; + cnt_frame_seq_r <= (others => '0'); + cnt_valid_r <= (others => '0'); + cnt_invalid_r <= (others => '0'); + rate_valid_r <= (others => '0'); + rate_invalid_r <= (others => '0'); + frame_valid_rate <= (others => '0'); + frame_invalid_rate <= (others => '0'); + last_seq <= (others => '0'); + last_cnt_seq_r <= (others => '0'); + seq_discontinuity <= '0'; cnt_seq_mismatch <= '0'; + pps_r <= '0'; elsif rising_edge(clk) then + -- Register for rising edge filter + pps_r <= pps; + if soft_reset = '1' then cnt_frame_seq_r <= (others => '0'); cnt_valid_r <= (others => '0'); @@ -313,7 +319,7 @@ begin end if; -- Rate counter - if pps = '1' then + if pps = '1' and pps_r = '0' then frame_valid_rate <= std_logic_vector(rate_valid_r); frame_invalid_rate <= std_logic_vector(rate_invalid_r); rate_valid_r <= (others => '0');