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
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;
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";
);
-
-
-
-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);
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";
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";
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";