]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
basic functions working, IF
authorIngo Froehlich <ingo@nomail.fake>
Wed, 28 Feb 2018 12:54:39 +0000 (13:54 +0100)
committerIngo Froehlich <ingo@nomail.fake>
Wed, 28 Feb 2018 12:54:39 +0000 (13:54 +0100)
media_interfaces/sync/rx_control.vhd
media_interfaces/sync/tb/med_sync_tb.vhd

index b447a8f6ad57b9e9b63eb36107b201a219fccc79..7345eb8a003d9aedde65375389610df989c836fa 100644 (file)
@@ -93,6 +93,8 @@ signal got_pulse_bad       : std_logic := '0';
 signal pulse_good_100      : std_logic;
 signal pulse_bad_100       : std_logic;
 signal waiting_for_retr    : std_logic := '0';
+signal good_pos_counter    : unsigned(7 downto 0) := (others => '0');
+
 
 begin
 
@@ -115,6 +117,7 @@ process begin
   wait until rising_edge(CLK_100);
   if pulse_good_100 = '1' then
     got_pulse_good <= '1';
+    good_pos_counter <= good_pos_counter+5;
   elsif ct_fifo_empty = '1' then
     got_pulse_good <= '0';
   end if;
@@ -125,6 +128,7 @@ process begin
   end if;  
   if RX_ALLOW_IN = '0' then
     rx_packet_num <= "100";
+    good_pos_counter <= (others => '0');
   elsif buf_rx_write_out = '1' then
     if rx_packet_num = "100" then
       rx_packet_num <= "000";
@@ -367,10 +371,8 @@ PULSE_BAD_SYNC : pulse_sync
   );
 
 
-
-
-
-REQUEST_POSITION_OUT   <= x"00";  --TODO: check incoming data
+--REQUEST_POSITION_OUT   <= x"00";  --TODO: check incoming data
+REQUEST_POSITION_OUT   <= std_logic_vector(good_pos_counter);
 
 SEND_LINK_RESET_OUT    <= send_link_reset_i when rising_edge(CLK_200);
 MAKE_RESET_OUT         <= make_reset_i when rising_edge(CLK_200);
index 98842085459c674f96f552921bc956b66fcadc51..663c72a3a8ae8e3721c4adff7d19d737224fd747 100644 (file)
@@ -120,6 +120,8 @@ process begin
   int2med_m.dataready <= '0';
   wait for 30 us;
 
+  -- generate good packages to test the RAM overflow
+  GEN_GOOD: for i in 0 to 60 loop
   wait until rising_edge(clk_100_m); wait for 1 ns;
   int2med_m.data <= x"affe";
   int2med_m.packet_num <= "100";
@@ -143,7 +145,10 @@ process begin
   wait until rising_edge(clk_100_m); wait for 1 ns;
   int2med_m.dataready <= '0';
   int2med_m.data <= x"0000";
-  wait for 1 us;
+  end loop;
+
+  --bad package
+  --wait for 1 us;
   wait until rising_edge(clk_100_m); wait for 1 ns;
   int2med_m.data <= x"1122";
   int2med_m.packet_num <= "100";
@@ -169,6 +174,7 @@ process begin
   wait until rising_edge(clk_100_m); wait for 1 ns;
   wait until rising_edge(clk_100_m); wait for 1 ns;
 
+  --good package which should be thrown away
   wait until rising_edge(clk_100_m); wait for 1 ns;
   int2med_m.data <= x"dead";
   int2med_m.packet_num <= "100";