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;
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;
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;