Ignore:
Timestamp:
05/18/11 13:59:12 (14 years ago)
Author:
weitzel
Message:
several bugfixes for FTM firmware
File:
1 edited

Legend:

Unmodified
Added
Removed
  • firmware/FTM/ftu_control/FTM_ftu_control.vhd

    r10418 r10740  
    219219  signal frame_cnt           : integer range 0 to (FTU_RS485_BLOCK_WIDTH / 8) := 0;
    220220  signal FTU_list_reg_cnt    : integer range 0 to NO_OF_FTU_LIST_REG := 0;
    221   signal FTU_list_header_cnt : integer range 0 to FTU_LIST_RAM_OFFSET := 0;
     221  signal FTU_list_header_cnt : integer range 0 to (FTU_LIST_RAM_OFFSET  + 1):= 0;
    222222  signal DD_RAM_reg_cnt      : integer range 0 to NO_OF_DD_RAM_REG := 0;
    223223 
     
    442442          reset_crc_from_FSM_sig <= '0';
    443443          enable_crc_from_FSM_sig <= '0';
    444           new_config_done <= '0';
    445           ping_all_done   <= '0';
    446           read_rates_done <= '0';
     444          --new_config_done <= '0';
     445          --ping_all_done   <= '0';
     446          --read_rates_done <= '0';
    447447          if (new_config = '1') then
     448            new_config_done <= '0';--
    448449            new_config_started <= '1';
    449450            ping_all_started   <= '0';
     
    451452            FTM_ftu_rs485_control_State <= ACTIVE_LIST;
    452453          elsif (new_config = '0' and  ping_all = '1') then
     454            ping_all_done   <= '0';--
    453455            new_config_started <= '0';
    454456            ping_all_started   <= '1';
     
    457459            FTM_ftu_rs485_control_State <= PING;
    458460          elsif (new_config = '0' and  ping_all = '0' and read_rates = '1') then
     461            read_rates_done <= '0';--
    459462            new_config_started <= '0';
    460463            ping_all_started   <= '0';
     
    836839        when PING_END =>  -- add final ping statistics to FTU-list
    837840          if (FTU_list_header_cnt < FTU_LIST_RAM_OFFSET) then
    838             FTU_list_header_cnt <= FTU_list_header_cnt + 1;
     841            --FTU_list_header_cnt <= FTU_list_header_cnt + 1;
    839842            FTM_ftu_rs485_control_State <= PING_END_1;
    840843          else
     
    854857          if (FTUlist_RAM_busy = '0') then
    855858            write_FTUlist_RAM <= '1';
    856             addr_FTUlist_RAM <= conv_std_logic_vector((FTU_list_header_cnt - 1), FTU_LIST_RAM_ADDR_WIDTH);
    857             if ((FTU_list_header_cnt - 1) = 0) then
     859            --addr_FTUlist_RAM <= conv_std_logic_vector((FTU_list_header_cnt - 1), FTU_LIST_RAM_ADDR_WIDTH);
     860            addr_FTUlist_RAM <= conv_std_logic_vector((FTU_list_header_cnt), FTU_LIST_RAM_ADDR_WIDTH);
     861            --if ((FTU_list_header_cnt - 1) = 0) then
     862            if ((FTU_list_header_cnt) = 0) then
    858863              data_FTUlist_RAM <= conv_std_logic_vector(no_of_FTU_answer_sig, 16);
    859             elsif ((FTU_list_header_cnt - 1) < 5) then
    860               data_FTUlist_RAM <= conv_std_logic_vector(FTU_answer_array_sig(FTU_list_header_cnt - 2), 16);
    861             elsif ((FTU_list_header_cnt - 1) < 9) then
    862               data_FTUlist_RAM <= active_FTU_array_sig(FTU_list_header_cnt - 6);
     864            --elsif ((FTU_list_header_cnt - 1) < 5) then
     865            elsif ((FTU_list_header_cnt) < 5) then
     866              --data_FTUlist_RAM <= conv_std_logic_vector(FTU_answer_array_sig(FTU_list_header_cnt - 2), 16);
     867              data_FTUlist_RAM <= conv_std_logic_vector(FTU_answer_array_sig(FTU_list_header_cnt - 1), 16);
     868            --elsif ((FTU_list_header_cnt - 1) < 9) then
     869            elsif ((FTU_list_header_cnt) < 9) then
     870              --data_FTUlist_RAM <= active_FTU_array_sig(FTU_list_header_cnt - 6);
     871              --data_FTUlist_RAM <= conv_std_logic_vector(FTU_list_header_cnt - 6, 16);
     872              data_FTUlist_RAM <= active_FTU_array_sig(FTU_list_header_cnt - 5);
    863873            end if;
    864874            FTM_ftu_rs485_control_State <= PING_END_2;
     
    873883        when PING_END_3 =>
    874884          if (FTUlist_RAM_ready = '1') then
     885            FTU_list_header_cnt <= FTU_list_header_cnt + 1;
    875886            FTM_ftu_rs485_control_State <= PING_END;
    876887          end if;
Note: See TracChangeset for help on using the changeset viewer.