From cf42e10ee571e14dd1fd7f378268aea2d2f1fc7f Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Tue, 15 Jan 2008 18:09:44 +0000 Subject: [PATCH] *** empty log message *** --- trb_net16_obuf.vhd | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/trb_net16_obuf.vhd b/trb_net16_obuf.vhd index 94db7e4..046ee8d 100644 --- a/trb_net16_obuf.vhd +++ b/trb_net16_obuf.vhd @@ -93,6 +93,9 @@ architecture trb_net16_obuf_arch of trb_net16_obuf is 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 @@ -231,33 +234,41 @@ begin 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; -- 2.43.0