signal saved_packet_type : std_logic_vector(2 downto 0);
signal reg_SEND_ACK_IN_2,next_SEND_ACK_IN_2 : std_logic;
+ type sending_state_t is (idle, sending_ack);
+ signal next_sending_state, sending_state : sending_state_t;
+
begin
SBUF: trb_net16_sbuf
else
next_DATA_COUNT <= CURRENT_DATA_COUNT +1;
end if;
- if (send_ACK = '1') then
+ if send_ACK = '1' then
next_INT_READ_OUT <= '0';
end if;
end if;
- elsif (send_ACK = '1') then
+ end if;
+ if sending_state = sending_ack then
next_INT_READ_OUT <= '0';
current_output_data_buffer <= current_ACK_word;
if sbuf_free = '1' then
comb_dataready <= '1';
if (transfer_counter = "11") then
next_SEND_ACK_IN <= '0';
+ next_sending_state <= idle;
end if;
end if;
end if;
+ if send_ACK = '1' and transfer_counter = "00" then
+ next_sending_state <= sending_ack;
+ next_INT_READ_OUT <= '0';
+ end if;
if sbuf_free = '0' or send_DATA = '0' then
next_INT_READ_OUT <= '0';
end if;
-
end process;
+
REG1 : process(CLK)
begin
if rising_edge(CLK) then
if RESET = '1' then
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;
end if;
end if;
end process;