LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
-USE IEEE.std_logic_ARITH.ALL;
-USE IEEE.std_logic_UNSIGNED.ALL;
+-- USE IEEE.std_logic_ARITH.ALL;
+-- USE IEEE.std_logic_UNSIGNED.ALL;
use ieee.numeric_std.all;
library work;
type state_type is (SENDING_DATA, SENDING_REPLY_TRM);
signal current_state, next_state : state_type;
- signal packet_counter : std_logic_vector(c_NUM_WIDTH-1 downto 0);
- signal data_counter : std_logic_vector(7 downto 0);
+ signal packet_counter : unsigned(c_NUM_WIDTH-1 downto 0);
+ signal data_counter : unsigned(7 downto 0);
signal SEQ_NR : std_logic_vector(7 downto 0);
signal comb_REPLY_POOL_DATAREADY : std_logic;
signal comb_REPLY_POOL_DATA : std_logic_vector(c_DATA_WIDTH-1 downto 0);
timeout_found <= or_all(connection_timed_out);
if REPLY_DATAREADY_IN(i) = '1' or real_activepoints(i) = '0' or locked = '0' or locking_point(i) = '1' or reg_CTRL_TIMEOUT_TIME = x"F" then
timeout_counter(i) <= (others => '0');
- elsif timeout_counter(i)(conv_integer(reg_CTRL_TIMEOUT_TIME(2 downto 0)&'1')) = '1' then
+ elsif timeout_counter(i)(to_integer(unsigned(reg_CTRL_TIMEOUT_TIME(2 downto 0)&'1'))) = '1' then
connection_timed_out(i) <= '1';
elsif timer_ms_tick = '1' then
timeout_counter(i) <= timeout_counter(i) + to_unsigned(1,1);
begin
if rising_edge(CLK) then
if reset_i = '1' or locked = '0' then
- packet_counter <= c_H0;
+ packet_counter <= unsigned(c_H0);
elsif comb_REPLY_POOL_DATAREADY = '1' then
- if packet_counter = c_max_word_number then
+ if packet_counter = unsigned(c_max_word_number) then
packet_counter <= (others => '0');
else
- packet_counter <= packet_counter + 1;
+ packet_counter <= packet_counter + to_unsigned(1,1);
end if;
end if;
end if;
data_counter <= (others => '0');
elsif comb_REPLY_POOL_PACKET_NUM = c_H0 and comb_REPLY_POOL_DATAREADY = '1'
and comb_REPLY_POOL_DATA(2 downto 0) = TYPE_DAT then
- data_counter <= data_counter + 1;
+ data_counter <= data_counter + to_unsigned(1,1);
end if;
end if;
end process;
release_locked <= '0';
next_state <= current_state;
comb_REPLY_POOL_DATAREADY <= '0';
- comb_REPLY_POOL_PACKET_NUM <= packet_counter;
+ comb_REPLY_POOL_PACKET_NUM <= std_logic_vector(packet_counter);
comb_REPLY_POOL_DATA <= (others => '0');
next_waiting_for_init_finish <= waiting_for_init_finish;
next_state <= SENDING_DATA;
next_waiting_for_init_finish <= '0';
end if;
- case packet_counter is
+ case std_logic_vector(packet_counter) is
when c_F0 =>
comb_REPLY_POOL_DATA <=REPLY_combined_trm_F0;
when c_F1 =>