From efc1a7cdaca5ebcef819aa7d214e7e5352dee352 Mon Sep 17 00:00:00 2001 From: hadeshyp Date: Thu, 11 Jun 2009 15:25:25 +0000 Subject: [PATCH] *** empty log message *** --- trb_net16_regIO.vhd | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/trb_net16_regIO.vhd b/trb_net16_regIO.vhd index a4643a7..3597fcf 100644 --- a/trb_net16_regIO.vhd +++ b/trb_net16_regIO.vhd @@ -545,7 +545,7 @@ begin next_length <= '0' & API_DATA_IN(14 downto 0); next_addr_counter_enable <= API_DATA_IN(15); next_DAT_READ_ENABLE_OUT <= '1'; - next_dat_data_counter <= dat_data_counter + 1; +-- next_dat_data_counter <= dat_data_counter + 1; next_state <= MEM_READ; elsif API_PACKET_NUM_IN = c_F0 then next_address <= API_DATA_IN; @@ -558,22 +558,21 @@ begin end if; when MEM_READ => - next_API_DATAREADY_OUT <= '1'; + next_API_DATAREADY_OUT <= '0'; + next_API_SEND_OUT <= '1'; case next_packet_counter is when c_F0 => next_timeout_counter <= timeout_counter + 1; - if DAT_DATAREADY_IN = '0' and DAT_DATAREADY_IN_before = '0' then - next_API_DATAREADY_OUT <= '0'; - end if; - if length = 0 or DAT_NO_MORE_DATA_IN = '1' then - next_state <= SEND_REPLY_SHORT_TRANSFER; - next_nomoredata <= DAT_NO_MORE_DATA_IN; - next_API_DATAREADY_OUT <= '0'; + if length = 0 then + next_state <= SEND_REPLY_DATA_finish; + elsif DAT_NO_MORE_DATA_IN = '1' then + next_state <= SEND_REPLY_DATA_finish; + next_nomoredata <= '1'; elsif DAT_UNKNOWN_ADDR_IN = '1' then next_state <= SEND_REPLY_DATA_finish; next_unknown <= '1'; - elsif DAT_DATAREADY_IN = '1' then - next_API_SEND_OUT <= '1'; + elsif DAT_DATAREADY_IN = '1' or DAT_DATAREADY_IN_before = '1' then + next_API_DATAREADY_OUT <= '1'; next_API_DATA_OUT <= address; elsif timeout_counter(c_regio_timeout_bit) = '1' then next_state <= SEND_REPLY_DATA_finish; @@ -581,17 +580,20 @@ begin end if; when c_F1 => next_API_DATA_OUT <= buf_DAT_DATA_IN(31 downto 16); + next_API_DATAREADY_OUT <= '1'; when c_F2 => next_API_DATA_OUT <= buf_DAT_DATA_IN(15 downto 0); + next_API_DATAREADY_OUT <= '1'; when c_F3 => - next_length <= length-1; next_API_DATA_OUT <= (others => '0'); - if length > 1 and API_READ_IN = '1' then - next_DAT_READ_ENABLE_OUT <= '1'; - next_dat_data_counter <= dat_data_counter + 1; - next_timeout_counter <= (others => '0'); - if addr_counter_enable = '1' then - next_address <= address + 1; + next_API_DATAREADY_OUT <= '1'; + if API_READ_IN = '1' then + next_length <= length-1; + if length > 1 then + next_DAT_READ_ENABLE_OUT <= '1'; + if addr_counter_enable = '1' then + next_address <= address + 1; + end if; end if; end if; when others => null; -- 2.43.0