type sending_state_t is (idle, sending_ack);
signal next_sending_state, sending_state : sending_state_t;
+ signal sending_state_bits : std_logic;
begin
--full buffers (despite the sbuf) can only occur on the last packet.
COMB_NEXT_TRANSFER : process(comb_dataready, transfer_counter, current_NOP_word,
CURRENT_DATA_COUNT, reg_SEND_ACK_IN, INT_DATAREADY_IN, INT_DATA_IN,
- reg_INT_READ_OUT, saved_packet_type,
+ reg_INT_READ_OUT, saved_packet_type, sending_state,
current_DATA_word, send_ACK, send_EOB, sbuf_free,
current_ACK_word, current_EOB_word,
next_TRANSMITTED_BUFFERS, TRANSMITTED_BUFFERS, send_DATA)
next_DATA_COUNT <= CURRENT_DATA_COUNT;
next_SEND_ACK_IN <= send_ACK;
comb_dataready <= '0';
+ next_sending_state <= sending_state;
if (reg_INT_READ_OUT = '1' and INT_DATAREADY_IN = '1') then
--can only happen if idle or sending_data
end if;
if send_ACK = '1' then
next_INT_READ_OUT <= '0';
+ next_sending_state <= sending_ack;
end if;
end if;
end if;
+
if sending_state = sending_ack then
next_INT_READ_OUT <= '0';
current_output_data_buffer <= current_ACK_word;
end if;
end if;
end if;
- if send_ACK = '1' and transfer_counter = "00" then
+
+ if send_ACK = '1' and transfer_counter = "00" and (reg_INT_READ_OUT and INT_DATAREADY_IN) = '0' then
next_sending_state <= sending_ack;
next_INT_READ_OUT <= '0';
end if;
end if;
end process;
+sending_state_bits <= '1' when sending_state = sending_ack else '0';
REG1 : process(CLK)
begin