signal dont_understand, next_dont_understand : std_logic;
signal packet_counter : std_logic_vector(c_NUM_WIDTH-1 downto 0);
signal next_packet_counter : std_logic_vector(c_NUM_WIDTH-1 downto 0);
+ signal addr_counter_enable, next_addr_counter_enable : std_logic;
begin
next_dont_understand <= '1';
else
if API_TYP_IN = TYPE_DAT and API_PACKET_NUM_IN = c_F1 and API_DATAREADY_IN = '1' then
- next_length <= API_DATA_IN;
+ next_length <= '0' & API_DATA_IN(14 downto 0);
+ next_addr_counter_enable <= API_DATA_IN(15);
next_DAT_READ_ENABLE_OUT <= '1';
next_state <= MEM_READ;
elsif API_TYP_IN = TYPE_DAT and API_PACKET_NUM_IN = c_F0 and API_DATAREADY_IN = '1' then
next_API_DATA_OUT <= (others => '0');
if length > 1 and API_READ_IN = '1' then
next_DAT_READ_ENABLE_OUT <= '1';
+ if addr_counter_enable = '1' then
+ next_address <= address + 1;
+ end if;
end if;
when others => null;
end case;
next_dont_understand <= '1';
elsif API_PACKET_NUM_IN = c_F0 and API_TYP_IN = TYPE_DAT and API_DATAREADY_IN = '1' then
next_address <= API_DATA_IN;
+ elsif API_PACKET_NUM_IN = c_F1 and API_TYP_IN = TYPE_DAT and API_DATAREADY_IN = '1' then
+ next_addr_counter_enable <= API_DATA_IN(15);
+ elsif API_PACKET_NUM_IN = c_F3 and API_TYP_IN = TYPE_DAT and API_DATAREADY_IN = '1' then
next_state <= MEM_WRITE;
end if;
when c_F2 =>
next_Reg_low <= API_DATA_IN;
next_DAT_WRITE_ENABLE_OUT <= '1';
+ when c_F3 =>
+ if addr_counter_enable = '1' then
+ next_address <= address + 1;
+ end if;
when others => null;
end case;
if API_TYP_IN = TYPE_TRM then
next_state <= DAT_START_READ;
next_DAT_READ_ENABLE_OUT <= '1';
+ next_API_SEND_OUT <= '1';
end if;
end if;
when DAT_START_READ =>
if DAT_DATAREADY_IN = '1' then
next_state <= DAT_READ;
+ elsif DAT_NO_MORE_DATA_IN = '1' then
+ next_state <= SEND_REPLY_SHORT_TRANSFER;
end if;
when DAT_READ =>
buf_rom_read_addr <= "000";
length <= (others => '0');
dont_understand <= '0';
+ addr_counter_enable <= '0';
else
current_state <= next_state;
-- HDR_F0 <= next_HDR_F0;
buf_rom_read_addr <= rom_read_addr;
length <= next_length;
dont_understand <= next_dont_understand;
+ addr_counter_enable <= next_addr_counter_enable;
end if;
end if;
end process;