-
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
use ieee.numeric_std.all;
attribute syn_sharing of trb_net16_obuf_arch : architecture is "off";
- signal current_output_data_buffer : STD_LOGIC_VECTOR (c_DATA_WIDTH-1 downto 0);
- signal current_output_num_buffer : STD_LOGIC_VECTOR (c_NUM_WIDTH-1 downto 0);
- signal current_ACK_word, current_EOB_word, current_DATA_word, current_NOP_word :
- STD_LOGIC_VECTOR (15 downto 0);
- signal comb_dataready, comb_next_read, comb_read ,sbuf_free: STD_LOGIC;
- signal reg_INT_READ_OUT , next_INT_READ_OUT:STD_LOGIC;
-
- signal next_SEND_ACK_IN, reg_SEND_ACK_IN : STD_LOGIC;
- signal send_ACK, send_EOB, send_DATA : STD_LOGIC;
-
- signal CURRENT_DATA_COUNT : unsigned (DATA_COUNT_WIDTH-1 downto 0);
--- signal max_DATA_COUNT, next_max_DATA_COUNT : STD_LOGIC_VECTOR (15 downto 0);
- signal max_DATA_COUNT_minus_one : unsigned (DATA_COUNT_WIDTH-1 downto 0);
- signal TRANSMITTED_BUFFERS : unsigned (1 downto 0);
- signal increase_TRANSMITTED_BUFFERS, decrease_TRANSMITTED_BUFFERS : STD_LOGIC;
-
- signal SEND_BUFFER_SIZE_IN : STD_LOGIC_VECTOR (3 downto 0);
- signal REC_BUFFER_SIZE_IN : STD_LOGIC_VECTOR (3 downto 0);
- signal SEND_ACK_IN : STD_LOGIC;
- signal GOT_ACK_IN : STD_LOGIC;
-
- signal transfer_counter : std_logic_vector(c_NUM_WIDTH-1 downto 0);
- signal saved_packet_type : std_logic_vector(2 downto 0);
- signal reg_SEND_ACK_IN_2,next_SEND_ACK_IN_2 : std_logic;
+ signal current_output_data_buffer : std_logic_vector (c_DATA_WIDTH-1 downto 0);
+ signal current_output_num_buffer : std_logic_vector (c_NUM_WIDTH-1 downto 0);
+ signal current_ACK_word : std_logic_vector (15 downto 0);
+ signal current_EOB_word : std_logic_vector (15 downto 0);
+ signal current_DATA_word : std_logic_vector (15 downto 0);
+ signal current_NOP_word : std_logic_vector (15 downto 0);
+ signal comb_dataready : std_logic;
+ signal comb_next_read : std_logic;
+ signal sbuf_free : std_logic;
+ signal reg_INT_READ_OUT : std_logic;
+ signal next_INT_READ_OUT : std_logic;
+ signal next_SEND_ACK_IN : std_logic;
+ signal reg_SEND_ACK_IN : std_logic;
+ signal send_ACK : std_logic;
+ signal send_EOB : std_logic;
+ signal send_DATA : std_logic;
+ signal CURRENT_DATA_COUNT : unsigned (DATA_COUNT_WIDTH-1 downto 0);
+ signal max_DATA_COUNT_minus_one : unsigned (DATA_COUNT_WIDTH-1 downto 0);
+ signal TRANSMITTED_BUFFERS : unsigned (1 downto 0);
+ signal inc_TRANSMITTED_BUFFERS : std_logic;
+ signal decrease_TRANSMITTED_BUFFERS : std_logic;
+
+ signal SEND_BUFFER_SIZE_IN : std_logic_vector (3 downto 0);
+ signal REC_BUFFER_SIZE_IN : std_logic_vector (3 downto 0);
+ signal SEND_ACK_IN : std_logic;
+ signal GOT_ACK_IN : std_logic;
+
+ signal transfer_counter : std_logic_vector(c_NUM_WIDTH-1 downto 0);
+ signal saved_packet_type : std_logic_vector(2 downto 0);
+ signal reg_SEND_ACK_IN_2 : std_logic;
+ signal next_SEND_ACK_IN_2 : std_logic;
type sending_state_t is (idle, sending_ack, sending_eob);
- signal next_sending_state, sending_state : sending_state_t;
--- signal sending_state_bits : std_logic;
-
- signal reset_DATA_COUNT : std_logic;
- signal increase_DATA_COUNT : std_logic;
-
- signal CRC_RESET, CRC_enable : std_logic;
- signal CRC : std_logic_vector(15 downto 0);
- signal buf_MED_DATAREADY_OUT : std_logic;
- signal buf_MED_PACKET_NUM_OUT : std_logic_vector(c_NUM_WIDTH-1 downto 0);
- signal sbuf_status : std_logic;
- signal crc_match : std_logic;
- signal buffer_number : unsigned(15 downto 0);
-
- signal buf_INT_READ_OUT : std_logic;
- signal int_dataready_in_i : std_logic;
- signal int_data_in_i : std_logic_vector(15 downto 0);
- signal int_packet_num_in_i: std_logic_vector(2 downto 0);
- signal last_buf_INT_READ_OUT : std_logic;
-
- signal wait_for_ack_timeout : std_logic;
- signal wait_for_ack_counter : unsigned(8 downto 0);
- signal wait_for_ack_max_bit : std_logic_vector(2 downto 0);
- signal timer_tick : std_logic;
-
- attribute syn_preserve : boolean;
- attribute syn_keep : boolean;
+ signal next_sending_state : sending_state_t;
+ signal sending_state : sending_state_t;
+
+ signal reset_DATA_COUNT : std_logic;
+ signal inc_DATA_COUNT : std_logic;
+
+ signal CRC_RESET : std_logic;
+ signal CRC_enable : std_logic;
+ signal CRC : std_logic_vector(15 downto 0);
+ signal buf_MED_DATAREADY_OUT : std_logic;
+ signal buf_MED_PACKET_NUM_OUT : std_logic_vector(c_NUM_WIDTH-1 downto 0);
+ signal sbuf_status : std_logic;
+ signal crc_match : std_logic;
+ signal buffer_number : unsigned(15 downto 0);
+
+ signal buf_INT_READ_OUT : std_logic;
+ signal int_dataready_in_i : std_logic;
+ signal int_data_in_i : std_logic_vector(15 downto 0);
+ signal int_packet_num_in_i : std_logic_vector(2 downto 0);
+ signal last_buf_INT_READ_OUT : std_logic;
+
+ signal wait_for_ack_timeout : std_logic;
+ signal wait_for_ack_counter : unsigned(8 downto 0);
+ signal wait_for_ack_max_bit : std_logic_vector(2 downto 0);
+ signal timer_tick : std_logic;
+
+ attribute syn_preserve : boolean;
+ attribute syn_keep : boolean;
attribute syn_preserve of wait_for_ack_timeout : signal is true;
attribute syn_preserve of wait_for_ack_counter : signal is true;
attribute syn_preserve of wait_for_ack_max_bit : signal is true;
- attribute syn_preserve of timer_tick : signal is true;
- attribute syn_keep of wait_for_ack_timeout : signal is true;
- attribute syn_keep of wait_for_ack_counter : signal is true;
- attribute syn_keep of wait_for_ack_max_bit : signal is true;
- attribute syn_keep of timer_tick : signal is true;
+ attribute syn_preserve of timer_tick : signal is true;
+ attribute syn_keep of wait_for_ack_timeout : signal is true;
+ attribute syn_keep of wait_for_ack_counter : signal is true;
+ attribute syn_keep of wait_for_ack_max_bit : signal is true;
+ attribute syn_keep of timer_tick : signal is true;
begin
- INT_READ_OUT <= buf_INT_READ_OUT;
+---------------------------------------------------------------------
+-- read signal to internal logic
+---------------------------------------------------------------------
buf_INT_READ_OUT <= not int_dataready_in_i or reg_INT_READ_OUT;
+---------------------------------------------------------------------
+-- I/O
+---------------------------------------------------------------------
+ INT_READ_OUT <= buf_INT_READ_OUT;
+ MED_PACKET_NUM_OUT <= buf_MED_PACKET_NUM_OUT;
+ MED_DATAREADY_OUT <= buf_MED_DATAREADY_OUT;
- SYNC_INT_DATA_INPUTS : process(CLK)
- begin
- if rising_edge(CLK) then
- if RESET = '1' then
- int_dataready_in_i <= '0';
- elsif buf_INT_READ_OUT = '1' then --reply_dataready_in_i(i) = '0' or buf_REPLY_READ_OUT(i) = '1' then
- int_dataready_in_i <= INT_DATAREADY_IN;
- int_data_in_i <= INT_DATA_IN;
- int_packet_num_in_i <= INT_PACKET_NUM_IN;
- end if;
+---------------------------------------------------------------------
+-- Register inputs from internal logic
+---------------------------------------------------------------------
+
+ SYNC_INT_DATA_INPUTS : process(CLK)
+ begin
+ if rising_edge(CLK) then
+ if RESET = '1' then
+ int_dataready_in_i <= '0';
+ elsif buf_INT_READ_OUT = '1' then --reply_dataready_in_i(i) = '0' or buf_REPLY_READ_OUT(i) = '1' then
+ int_dataready_in_i <= INT_DATAREADY_IN;
+ int_data_in_i <= INT_DATA_IN;
+ int_packet_num_in_i <= INT_PACKET_NUM_IN;
end if;
- end process;
+ end if;
+ end process;
proc_SAVE_INT_READ_OUT : process(CLK)
begin
end if;
end process;
--- gen_sbuf : if SECURE_MODE = 1 generate
- THE_SBUF : trb_net16_sbuf
- generic map (
- VERSION => SBUF_VERSION
- )
- port map (
- CLK => CLK,
- RESET => RESET,
- CLK_EN => CLK_EN,
- COMB_DATAREADY_IN => comb_dataready,
- COMB_next_READ_OUT => comb_next_read,
- COMB_READ_IN => comb_read,
- COMB_DATA_IN => current_output_data_buffer,
- COMB_PACKET_NUM_IN => current_output_num_buffer,
- SYN_DATAREADY_OUT => buf_MED_DATAREADY_OUT,
- SYN_DATA_OUT => MED_DATA_OUT,
- SYN_PACKET_NUM_OUT => buf_MED_PACKET_NUM_OUT,
- SYN_READ_IN => MED_READ_IN,
- STAT_BUFFER => sbuf_status
- );
-
- MED_PACKET_NUM_OUT <= buf_MED_PACKET_NUM_OUT;
- MED_DATAREADY_OUT <= buf_MED_DATAREADY_OUT;
- comb_read <= '1';
-
- process(CLK)
+---------------------------------------------------------------------
+-- The SBUF to buffer data to the multiplexer
+---------------------------------------------------------------------
+ THE_SBUF : trb_net16_sbuf
+ generic map (
+ VERSION => SBUF_VERSION
+ )
+ port map (
+ CLK => CLK,
+ RESET => RESET,
+ CLK_EN => CLK_EN,
+ COMB_DATAREADY_IN => comb_dataready,
+ COMB_next_READ_OUT => comb_next_read,
+ COMB_READ_IN => '1',
+ COMB_DATA_IN => current_output_data_buffer,
+ COMB_PACKET_NUM_IN => current_output_num_buffer,
+ SYN_DATAREADY_OUT => buf_MED_DATAREADY_OUT,
+ SYN_DATA_OUT => MED_DATA_OUT,
+ SYN_PACKET_NUM_OUT => buf_MED_PACKET_NUM_OUT,
+ SYN_READ_IN => MED_READ_IN,
+ STAT_BUFFER => sbuf_status
+ );
+
+ proc_delay_sbuf_free : process(CLK)
begin
if rising_edge(CLK) then
if RESET = '1' then
end if;
end if;
end process;
- --sbuf_free <= comb_next_read;
--- end generate;
--- gen_non_sbuf : if SECURE_MODE = 0 generate
--- MED_DATAREADY_OUT <= comb_dataready;
--- MED_DATA_OUT <= current_output_data_buffer;
--- MED_PACKET_NUM_OUT <= current_output_num_buffer;
--- sbuf_free <= MED_READ_IN;
--- end generate;
-
-
+---------------------------------------------------------------------
+-- Make control and status signals based on if ack. is used or not
+---------------------------------------------------------------------
gen1 : if USE_ACKNOWLEDGE = 1 generate
decrease_TRANSMITTED_BUFFERS <= GOT_ACK_IN;
- send_ACK <= SEND_ACK_IN or reg_SEND_ACK_IN or reg_SEND_ACK_IN_2;
- next_SEND_ACK_IN_2 <= (reg_SEND_ACK_IN_2 or SEND_ACK_IN) and reg_SEND_ACK_IN;
- send_DATA <= not TRANSMITTED_BUFFERS(1);
- send_EOB <= '1' when (CURRENT_DATA_COUNT = max_DATA_COUNT_minus_one and saved_packet_type /= TYPE_TRM) else '0';
+ send_ACK <= SEND_ACK_IN or reg_SEND_ACK_IN or reg_SEND_ACK_IN_2;
+ next_SEND_ACK_IN_2 <= (reg_SEND_ACK_IN_2 or SEND_ACK_IN) and reg_SEND_ACK_IN;
+ send_DATA <= not TRANSMITTED_BUFFERS(1);
+ send_EOB <= '1' when (CURRENT_DATA_COUNT = max_DATA_COUNT_minus_one and saved_packet_type /= TYPE_TRM) else '0';
-- buffer registers
- STAT_BUFFER(1 downto 0) <= std_logic_vector(TRANSMITTED_BUFFERS);
- STAT_BUFFER(14 downto 2) <= (others => '0');
- STAT_BUFFER(15) <= send_DATA;
- STAT_BUFFER(20 downto 16) <= std_logic_vector(CURRENT_DATA_COUNT(4 downto 0));
- STAT_BUFFER(31 downto 21) <= (others => '0');
- SEND_BUFFER_SIZE_IN <= CTRL_BUFFER(3 downto 0);
- REC_BUFFER_SIZE_IN <= CTRL_BUFFER(7 downto 4);
- SEND_ACK_IN <= CTRL_BUFFER(8);
- GOT_ACK_IN <= CTRL_BUFFER(9);
+ STAT_BUFFER(1 downto 0) <= std_logic_vector(TRANSMITTED_BUFFERS);
+ STAT_BUFFER(14 downto 2) <= (others => '0');
+ STAT_BUFFER(15) <= send_DATA;
+ STAT_BUFFER(20 downto 16) <= std_logic_vector(CURRENT_DATA_COUNT(4 downto 0));
+ STAT_BUFFER(31 downto 21) <= (others => '0');
+ SEND_BUFFER_SIZE_IN <= CTRL_BUFFER(3 downto 0);
+ REC_BUFFER_SIZE_IN <= CTRL_BUFFER(7 downto 4);
+ SEND_ACK_IN <= CTRL_BUFFER(8);
+ GOT_ACK_IN <= CTRL_BUFFER(9);
end generate;
gen1a : if USE_ACKNOWLEDGE = 0 generate
- send_EOB <= '0';
- send_ACK <= '0';
- reg_SEND_ACK_IN <= '0';
- reg_SEND_ACK_IN_2 <= '0';
- send_DATA <= '1';
- CURRENT_DATA_COUNT <= (others => '0');
- max_DATA_COUNT_minus_one <= (others => '0');
+ send_EOB <= '0';
+ send_ACK <= '0';
+ reg_SEND_ACK_IN <= '0';
+ reg_SEND_ACK_IN_2 <= '0';
+ send_DATA <= '1';
+ CURRENT_DATA_COUNT <= (others => '0');
+ max_DATA_COUNT_minus_one <= (others => '0');
end generate;
+
+---------------------------------------------------------------------
+-- Builds the three different packet types the Obuf can send: ACK, EOB, DATA
+---------------------------------------------------------------------
GENERATE_WORDS : process (transfer_counter, saved_packet_type, int_data_in_i, CRC, buffer_number,
CTRL_BUFFER, send_buffer_size_in, current_data_count)
begin
end if;
end process;
+---------------------------------------------------------------------
+-- makes the packet number
+---------------------------------------------------------------------
REG_TRANSFER_COUNTER : process(CLK)
begin
if rising_edge(CLK) then
end if;
end process;
+---------------------------------------------------------------------
+-- save which packet type is currently be sent
+---------------------------------------------------------------------
SAVE_PACKET_TYPE : process(CLK)
begin
if rising_edge(CLK) then
end process;
-
+---------------------------------------------------------------------
+-- CRC generator
+---------------------------------------------------------------------
GEN_CRC : if USE_CHECKSUM = 1 generate
CRC_gen : trb_net_CRC
port map(
CRC_OUT => CRC,
CRC_match => crc_match
);
- end generate GEN_CRC;
+ end generate;
GEN_NO_CRC : if USE_CHECKSUM = 0 generate
CRC <= (others => '0');
end generate;
+---------------------------------------------------------------------
+-- The main control process (combinatorial part)
+---------------------------------------------------------------------
--since we count only 64Bit packets, each counter is updated on the last packet
--the EOB and ACK flags must be available when the last packet is sent.
--full buffers (despite the sbuf) can only occur on the last packet.
begin
current_output_data_buffer <= current_NOP_word;
current_output_num_buffer <= std_logic_vector(transfer_counter);
- next_INT_READ_OUT <= '1';
- increase_TRANSMITTED_BUFFERS <= '0';
- increase_DATA_COUNT <= '0';
- reset_DATA_COUNT <= '0';
- next_SEND_ACK_IN <= send_ACK;
- comb_dataready <= '0';
- next_sending_state <= sending_state;
- CRC_enable <= '0';
- CRC_RESET <= RESET;
- --only data words are CRC'ed
-
+ next_INT_READ_OUT <= '1';
+ inc_TRANSMITTED_BUFFERS <= '0';
+ inc_DATA_COUNT <= '0';
+ reset_DATA_COUNT <= '0';
+ next_SEND_ACK_IN <= send_ACK;
+ comb_dataready <= '0';
+ next_sending_state <= sending_state;
+ CRC_enable <= '0';
+ CRC_RESET <= RESET;
+
+-- if data is read from INT --can only happen if idle or sending_data
if (reg_INT_READ_OUT = '1' and int_dataready_in_i = '1') then
- --can only happen if idle or sending_data
current_output_data_buffer <= current_DATA_word;
+ --CRC is only used for data payload
if int_packet_num_in_i(2) = '0' and saved_packet_type /= TYPE_TRM then
CRC_enable <= '1';
else
comb_dataready <= '1';
if transfer_counter = c_F3_next then
- increase_DATA_COUNT <= '1'; --transfer_counter(1) and not transfer_counter(0);
+ inc_DATA_COUNT <= '1'; --transfer_counter(1) and not transfer_counter(0);
end if;
+--end of current packet reached, determine next state
if transfer_counter = c_F3 then
- if saved_packet_type = TYPE_TRM then -- or saved_packet_type = TYPE_EOB
+ if saved_packet_type = TYPE_TRM then
reset_DATA_COUNT <= '1';
CRC_RESET <= '1';
- increase_TRANSMITTED_BUFFERS <= '1';
+ inc_TRANSMITTED_BUFFERS <= '1';
if TRANSMITTED_BUFFERS(0) = '1' then
next_INT_READ_OUT <= '0';
end if;
end if;
end if;
end if;
+--state: sending EOB word
if sending_state = sending_eob then
next_INT_READ_OUT <= '0';
current_output_data_buffer <= current_EOB_word;
next_sending_state <= idle;
CRC_RESET <= '1';
reset_DATA_COUNT <= '1';
- increase_TRANSMITTED_BUFFERS <= '1';
+ inc_TRANSMITTED_BUFFERS <= '1';
end if;
end if;
end if;
+--state: sending ACK word
if sending_state = sending_ack then
next_INT_READ_OUT <= '0';
current_output_data_buffer <= current_ACK_word;
end if;
end if;
+--switch to EOB / ACK sending in case of idle
if send_EOB = '1' and transfer_counter = c_H0 and (reg_INT_READ_OUT and int_dataready_in_i) = '0' then
next_sending_state <= sending_eob;
next_INT_READ_OUT <= '0';
end if;
end process;
---sending_state_bits <= '1' when sending_state = sending_ack else '0' when sending_state = sending_eob else 'U';
+---------------------------------------------------------------------
+-- Register control process signals
+---------------------------------------------------------------------
REG1 : process(CLK)
begin
if rising_edge(CLK) then
if RESET = '1' then
- reg_INT_READ_OUT <= '0';
- sending_state <= idle;
+ reg_INT_READ_OUT <= '0';
+ sending_state <= idle;
elsif CLK_EN = '1' then
- reg_INT_READ_OUT <= next_INT_READ_OUT;
- sending_state <= next_sending_state;
+ reg_INT_READ_OUT <= next_INT_READ_OUT;
+ sending_state <= next_sending_state;
end if;
end if;
end process;
gen3 : if USE_ACKNOWLEDGE = 0 generate
- STAT_BUFFER <= (others => '0');
+ STAT_BUFFER <= (others => '0');
TRANSMITTED_BUFFERS <= (others => '0');
end generate;
GEN2 : if USE_ACKNOWLEDGE = 1 generate
+
+--count sent data words
REG_DATA_COUNT : process(CLK)
begin
if rising_edge(CLK) then
if RESET = '1' or reset_DATA_COUNT = '1' then
CURRENT_DATA_COUNT <= (others => '0');
- elsif CLK_EN = '1' and increase_DATA_COUNT = '1' then
+ elsif CLK_EN = '1' and inc_DATA_COUNT = '1' then
CURRENT_DATA_COUNT <= CURRENT_DATA_COUNT + 1;
end if;
end if;
end if;
end process;
+-- decode maximum buffer size
process(CLK)
begin
if rising_edge(CLK) then
end if;
end process;
+-- count how many EOB have been sent and how many ACK have been received. transmitted_buffers is the difference between both
reg_TRANSMITTED_BUFFERS : process(CLK)
begin
if rising_edge(CLK) then
TRANSMITTED_BUFFERS <= "00";
buffer_number <= (others => '0');
elsif CLK_EN = '1' then
- if (increase_TRANSMITTED_BUFFERS = '1' and decrease_TRANSMITTED_BUFFERS = '0') then
+ if (inc_TRANSMITTED_BUFFERS = '1' and decrease_TRANSMITTED_BUFFERS = '0') then
TRANSMITTED_BUFFERS <= TRANSMITTED_BUFFERS +1;
- elsif (increase_TRANSMITTED_BUFFERS = '0' and decrease_TRANSMITTED_BUFFERS = '1') then
+ elsif (inc_TRANSMITTED_BUFFERS = '0' and decrease_TRANSMITTED_BUFFERS = '1') then
TRANSMITTED_BUFFERS <= TRANSMITTED_BUFFERS -1;
end if;
- if increase_TRANSMITTED_BUFFERS = '1' then
+ if inc_TRANSMITTED_BUFFERS = '1' then
buffer_number <= buffer_number + to_unsigned(1,1);
end if;
end if;
end if;
- end process reg_TRANSMITTED_BUFFERS;
+ end process;
end generate;
-
+---------------------------------------------------------------------
+-- measure time waiting for two ACK - if too long, set error flag
+---------------------------------------------------------------------
proc_reg_setting : process (CLK)
begin
if rising_edge(CLK) then
begin
if rising_edge(CLK) then
wait_for_ack_timeout <= '0';
- if TRANSMITTED_BUFFERS(1) = '0' or wait_for_ack_max_bit = "000" then
+ if TRANSMITTED_BUFFERS(1) = '0' or wait_for_ack_max_bit = "000" or wait_for_ack_max_bit = "111" then
wait_for_ack_counter <= (others => '0');
- elsif wait_for_ack_counter(to_integer(unsigned(wait_for_ack_max_bit)+to_unsigned(1,1))) = '1' then
+ elsif wait_for_ack_counter(to_integer(unsigned(wait_for_ack_max_bit&'1'))) = '1' then
wait_for_ack_timeout <= '1';
elsif timer_tick = '1' then
wait_for_ack_counter <= wait_for_ack_counter + to_unsigned(1,1);
end if;
end process;
-
-STAT_DEBUG(0) <= '0'; --comb_dataready;
-STAT_DEBUG(3 downto 1) <= "000"; --transfer_counter;
-STAT_DEBUG(4) <= '0'; --buf_MED_DATAREADY_OUT;
-STAT_DEBUG(7 downto 5) <= "000"; --buf_MED_PACKET_NUM_OUT;
-STAT_DEBUG(8) <= '0'; --sbuf_free;
-STAT_DEBUG(9) <= '0'; --comb_next_read;
-STAT_DEBUG(10) <= '0'; --SEND_ACK_IN;
-STAT_DEBUG(11) <= '0'; --reg_SEND_ACK_IN;
-STAT_DEBUG(12) <= '0'; --RESET;
-STAT_DEBUG(14 downto 13) <= std_logic_vector(TRANSMITTED_BUFFERS);
-STAT_DEBUG(17 downto 15) <= REC_BUFFER_SIZE_IN(2 downto 0);
-STAT_DEBUG(19 downto 18) <= transfer_counter(1 downto 0); --used in hub monitoring!
-STAT_DEBUG(20) <= wait_for_ack_timeout; --used in hub monitoring
-STAT_DEBUG(31 downto 21) <= (others => '0');
+---------------------------------------------------------------------
+-- Debug output
+---------------------------------------------------------------------
+ STAT_DEBUG(0) <= '0'; --comb_dataready;
+ STAT_DEBUG(3 downto 1) <= "000"; --transfer_counter;
+ STAT_DEBUG(4) <= '0'; --buf_MED_DATAREADY_OUT;
+ STAT_DEBUG(7 downto 5) <= "000"; --buf_MED_PACKET_NUM_OUT;
+ STAT_DEBUG(8) <= '0'; --sbuf_free;
+ STAT_DEBUG(9) <= '0'; --comb_next_read;
+ STAT_DEBUG(10) <= '0'; --SEND_ACK_IN;
+ STAT_DEBUG(11) <= '0'; --reg_SEND_ACK_IN;
+ STAT_DEBUG(12) <= '0'; --RESET;
+ STAT_DEBUG(14 downto 13) <= std_logic_vector(TRANSMITTED_BUFFERS);
+ STAT_DEBUG(17 downto 15) <= REC_BUFFER_SIZE_IN(2 downto 0);
+ STAT_DEBUG(19 downto 18) <= transfer_counter(1 downto 0); --used in hub monitoring!
+ STAT_DEBUG(20) <= wait_for_ack_timeout; --used in hub monitoring
+ STAT_DEBUG(31 downto 21) <= (others => '0');
end architecture;