From 9b9f90369bd8d5fb71e72833471617eb5c4deda0 Mon Sep 17 00:00:00 2001 From: Ingo Froehlich Date: Mon, 16 Jul 2018 14:06:08 +0200 Subject: [PATCH] first running version --- media_interfaces/sync/rx_control.vhd | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/media_interfaces/sync/rx_control.vhd b/media_interfaces/sync/rx_control.vhd index bf94a48..0d2c98c 100644 --- a/media_interfaces/sync/rx_control.vhd +++ b/media_interfaces/sync/rx_control.vhd @@ -99,7 +99,7 @@ signal good_pos_counter : std_logic_vector(7 downto 0) := (others => '0'); signal num_pakets : unsigned(3 downto 0) := (others => '0'); signal use_crc : std_logic := '0'; ---signal next_use_crc : std_logic := '0'; +signal last_use_crc : std_logic := '0'; signal load_use_crc : std_logic := '0'; --signal last_load_use_crc : std_logic := '0'; signal disable_crc : std_logic := '0'; @@ -130,7 +130,7 @@ RX_PACKET_NUMBER_OUT <= rx_packet_num; last_ct_fifo_read <= ct_fifo_read when rising_edge(CLK_100); last_ct_fifo_empty <= ct_fifo_empty when rising_edge(CLK_100); ---last_load_use_crc <= load_use_crc when rising_edge(CLK_100); +last_use_crc <= use_crc when rising_edge(CLK_100); --use_crc <= next_use_crc when rising_edge(CLK_100); process begin @@ -146,15 +146,15 @@ process begin end if; end if; - if use_crc = '0' then --check disabled, just dummy counter - if buf_rx_write_out = '1' then - good_pos_counter <= std_logic_vector(unsigned(good_pos_counter)+1); - end if; + if last_use_crc = '0' and buf_rx_write_out = '1' then + good_pos_counter <= std_logic_vector(unsigned(good_pos_counter)+1); elsif pulse_good_100 = '1' then - got_pulse_good <= '1'; good_pos_counter <= std_logic_vector(unsigned(good_pos_counter)+5); end if; - + + if pulse_good_100 = '1' then + got_pulse_good <= '1'; + end if; if pulse_bad_100 = '1' then got_pulse_bad <= '1'; end if; -- 2.43.0