]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
only small change
authorIngo Froehlich <ingo@nomail.fake>
Sun, 15 Jul 2018 19:49:51 +0000 (21:49 +0200)
committerIngo Froehlich <ingo@nomail.fake>
Sun, 15 Jul 2018 19:49:51 +0000 (21:49 +0200)
media_interfaces/sync/rx_control.vhd
media_interfaces/sync/tx_control.vhd

index 1898854e87810cc09f90dfd36bbf51f1b8be58a5..bf94a4818de032d7186791874ac565c8ab54652b 100644 (file)
@@ -99,7 +99,9 @@ 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 load_use_crc        : std_logic := '0';
+--signal last_load_use_crc   : std_logic := '0';
 signal disable_crc         : std_logic := '0';
 
 signal num_crc          : unsigned(3 downto 0) := (others => '0');
@@ -128,32 +130,33 @@ 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);
+--use_crc  <= next_use_crc when rising_edge(CLK_100);
 
 process begin
   wait until rising_edge(CLK_100);
-  
-  if pulse_good_100 = '1' then
-    got_pulse_good <= '1';
-    good_pos_counter <= std_logic_vector(unsigned(good_pos_counter)+5);
-  else
-    if buf_rx_write_out = '1' and use_crc = '0' then
-      --fake pointer increase
+
+  if ct_fifo_empty = '1' then
+    got_pulse_bad <= '0';
+    got_pulse_good <= '0';
+    if load_use_crc = '1' then
+      use_crc <= '1';
+    else
+      use_crc <= '0';
+    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 ct_fifo_empty = '1' then
-      got_pulse_good <= '0';
-      if load_use_crc = '1' then
-        use_crc <= '1';
-      else
-        use_crc <= '0';
-      end if;
-    end if;
+  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_bad_100 = '1' then
     got_pulse_bad  <= '1';
-    got_pulse_good <= '0';
-  elsif ct_fifo_empty = '1' then
-    got_pulse_bad <= '0';
   end if;
 
   if RX_ALLOW_IN = '0' then
@@ -162,9 +165,6 @@ process begin
   elsif buf_rx_write_out = '1' then
     if rx_packet_num = "100" then
       rx_packet_num <= "000";
-      --if use_crc = '0' then
-        --good_pos_counter <= std_logic_vector(unsigned(good_pos_counter)+5);
-      --end if;
     else
       rx_packet_num <= std_logic_vector(unsigned(rx_packet_num)+1);
     end if;  
@@ -180,7 +180,8 @@ process begin
   end if;
 end process;
 
-last_good_pos_counter <= good_pos_counter when rising_edge(CLK_100) and resub_mode = '1';
+last_good_pos_counter <= good_pos_counter when rising_edge(CLK_100) ; -- and waiting_for_retr = '1';
+-- and resub_mode = '1';
 last_send_link_reset_i <= send_link_reset_i when rising_edge(CLK_100);
 
 ----------------------------------------------------------------------
@@ -308,7 +309,8 @@ PROC_RX_FSM : process begin
       if (use_crc = '0') then
         -- first time
         load_use_crc <= '1';
-        pulse_good   <= '1';
+        --pulse_good   <= '1';
+        disable_crc  <= '0';
       else  
         if ((crc_q = reg_rx_data_in and waiting_for_retr = '0') --- and num_pakets = 5)
                                                                and force_crc_error = '0') or disable_crc = '1' then -- CRC match
index e0251a04625ad0fbb16db15d86e3ee553294b98c..62630bf918d4e7c8bd494fdcac6fc3943e886f01 100644 (file)
@@ -201,12 +201,12 @@ begin
           ram_read_addr <= (others => '0');
           --ram_read_addr2 <= (others => '0');
         elsif load_read_pointer_i = '1' then
+          ram_read_addr1 <= ram_read_addr;
           ram_read_addr <= unsigned(restart_position_i);
           ram_read_addr2 <= unsigned(restart_position_i);
-          ram_read_addr1 <= ram_read_addr;
         elsif ram_read = '1' then
           ram_read_addr <= ram_read_addr + to_unsigned(1,1);
-        end if;          
+        end if;
       end if;
     end process;