Changeset 10366 for firmware/FTM/ethernet
- Timestamp:
- 04/13/11 15:02:49 (14 years ago)
- Location:
- firmware/FTM/ethernet
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
firmware/FTM/ethernet/cram_control_beha.vhd
r10256 r10366 65 65 coin_win_p : OUT std_logic_vector (15 downto 0) := (others => '0'); 66 66 coin_win_c : OUT std_logic_vector (15 downto 0) := (others => '0'); 67 prescaling_FTU01 : OUT std_logic_vector (15 downto 0) := (others => '0'); 67 68 ftu_active_cr0 : OUT std_logic_vector (15 downto 0) := (others => '0'); 68 69 ftu_active_cr1 : OUT std_logic_vector (15 downto 0) := (others => '0'); … … 162 163 when CR_CONFIG_START => 163 164 if (addr_cnt < SD_BLOCK_SIZE) then 164 if ((addr_cnt < SD_FTU_BASE_ADDR) OR (addr_cnt >= SD_FTU_ACTIVE_BASE_ADDR)) then 165 if ((addr_cnt < SD_FTU_BASE_ADDR) 166 OR (addr_cnt = SD_ADDR_ftu_prescaling_0) 167 OR (addr_cnt >= SD_FTU_ACTIVE_BASE_ADDR) 168 ) then 165 169 local_sd_addr <= addr_cnt; 166 170 next_state <= CR_CONFIG_01; 167 171 state_cram_proc <= CR_READ_START; 168 172 elsif (addr_cnt = SD_FTU_BASE_ADDR) then 173 addr_cnt <= SD_ADDR_ftu_prescaling_0; 174 elsif (addr_cnt = (SD_ADDR_ftu_prescaling_0 + 1)) then 169 175 addr_cnt <= SD_FTU_ACTIVE_BASE_ADDR; 170 176 end if; … … 242 248 when SD_ADDR_coin_win_c => 243 249 coin_win_c <= local_sd_data; 250 when SD_ADDR_ftu_prescaling_0 => 251 prescaling_FTU01 <= local_sd_data; 244 252 when SD_ADDR_ftu_active_cr0 => 245 253 ftu_active_cr0 <= local_sd_data; -
firmware/FTM/ethernet/ethernet_modul_beha.vhd
r10256 r10366 2 2 -- 3 3 -- Created: 4 -- by - kai. UNKNOWN (E5PCXX)5 -- at - 1 1:52:19 03.03.20114 -- by - kai.users (tpkw.local.priv) 5 -- at - 10:39:41 04/13/11 6 6 -- 7 7 -- Generated by Mentor Graphics' HDL Designer(TM) 2009.1 (Build 12) 8 8 -- 9 10 9 LIBRARY ieee; 11 10 USE ieee.std_logic_1164.all; … … 16 15 USE ftm_definitions.ftm_constants.all; 17 16 17 18 18 ENTITY ethernet_modul IS 19 PORT( 20 wiz_reset : OUT std_logic := '1'; 21 wiz_addr : OUT std_logic_vector (9 DOWNTO 0); 22 wiz_data : INOUT std_logic_vector (15 DOWNTO 0); 23 wiz_cs : OUT std_logic := '1'; 24 wiz_wr : OUT std_logic := '1'; 25 wiz_rd : OUT std_logic := '1'; 26 wiz_int : IN std_logic; 27 clk : IN std_logic; 28 sd_ready : OUT std_logic; 29 sd_busy : OUT std_logic; 30 led : OUT std_logic_vector (7 DOWNTO 0); 31 sd_read_ftu : IN std_logic; 32 sd_started_ftu : OUT std_logic := '0'; 33 cc_R0 : OUT std_logic_vector (31 DOWNTO 0); 34 cc_R1 : OUT std_logic_vector (31 DOWNTO 0); 35 cc_R11 : OUT std_logic_vector (31 DOWNTO 0); 36 cc_R13 : OUT std_logic_vector (31 DOWNTO 0); 37 cc_R14 : OUT std_logic_vector (31 DOWNTO 0); 38 cc_R15 : OUT std_logic_vector (31 DOWNTO 0); 39 cc_R8 : OUT std_logic_vector (31 DOWNTO 0); 40 cc_R9 : OUT std_logic_vector (31 DOWNTO 0); 41 coin_n_c : OUT std_logic_vector (15 DOWNTO 0); 42 coin_n_p : OUT std_logic_vector (15 DOWNTO 0); 43 dead_time : OUT std_logic_vector (15 DOWNTO 0); 44 -- data from config ram 45 general_settings : OUT std_logic_vector (15 DOWNTO 0); 46 lp1_amplitude : OUT std_logic_vector (15 DOWNTO 0); 47 lp1_delay : OUT std_logic_vector (15 DOWNTO 0); 48 lp2_amplitude : OUT std_logic_vector (15 DOWNTO 0); 49 lp2_delay : OUT std_logic_vector (15 DOWNTO 0); 50 lp_pt_freq : OUT std_logic_vector (15 DOWNTO 0); 51 lp_pt_ratio : OUT std_logic_vector (15 DOWNTO 0); 52 timemarker_delay : OUT std_logic_vector (15 DOWNTO 0); 53 trigger_delay : OUT std_logic_vector (15 DOWNTO 0); 54 sd_addr_ftu : IN std_logic_vector (11 DOWNTO 0); 55 sd_data_out_ftu : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); 56 ftu_active_cr0 : OUT std_logic_vector (15 DOWNTO 0); 57 ftu_active_cr1 : OUT std_logic_vector (15 DOWNTO 0); 58 ftu_active_cr2 : OUT std_logic_vector (15 DOWNTO 0); 59 ftu_active_cr3 : OUT std_logic_vector (15 DOWNTO 0); 60 new_config : OUT std_logic := '0'; 61 config_started : IN std_logic; 62 config_start_eth : IN std_logic; 63 config_started_eth : OUT std_logic := '0'; 64 config_ready_eth : OUT std_logic := '0'; 65 config_started_ack : OUT std_logic := '0'; 66 fl_busy : OUT std_logic; 67 fl_ready : OUT std_logic; 68 fl_write_ftu : IN std_logic; 69 fl_started_ftu : OUT std_logic := '0'; 70 fl_addr_ftu : IN std_logic_vector (11 DOWNTO 0); 71 fl_data_in_ftu : IN std_logic_vector (15 DOWNTO 0) := (others => '0'); 72 -- 73 ping_ftu_start : OUT std_logic := '0'; 74 ping_ftu_started : IN std_logic; 75 ping_ftu_ready : IN std_logic; 76 dd_write_ftu : IN std_logic; 77 dd_started_ftu : OUT std_logic := '0'; 78 dd_data_in_ftu : IN std_logic_vector (15 DOWNTO 0); 79 dd_addr_ftu : IN std_logic_vector (11 DOWNTO 0); 80 dd_busy : OUT std_logic; 81 dd_ready : OUT std_logic; 82 coin_win_c : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); 83 coin_win_p : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); 84 dd_block_ready_ftu : IN std_logic; 85 dd_block_start_ack_ftu : OUT std_logic := '0'; 86 dd_block_start_ftu : IN std_logic; 87 dd_send : IN std_logic; 88 dd_send_ack : OUT std_logic := '1'; 89 dd_send_ready : OUT std_logic := '1' 90 ); 19 PORT( 20 wiz_reset : OUT std_logic := '1'; 21 wiz_addr : OUT std_logic_vector (9 DOWNTO 0); 22 wiz_data : INOUT std_logic_vector (15 DOWNTO 0); 23 wiz_cs : OUT std_logic := '1'; 24 wiz_wr : OUT std_logic := '1'; 25 wiz_rd : OUT std_logic := '1'; 26 wiz_int : IN std_logic; 27 clk : IN std_logic; 28 sd_ready : OUT std_logic; 29 sd_busy : OUT std_logic; 30 led : OUT std_logic_vector (7 DOWNTO 0); 31 sd_read_ftu : IN std_logic; 32 sd_started_ftu : OUT std_logic := '0'; 33 cc_R0 : OUT std_logic_vector (31 DOWNTO 0); 34 cc_R1 : OUT std_logic_vector (31 DOWNTO 0); 35 cc_R11 : OUT std_logic_vector (31 DOWNTO 0); 36 cc_R13 : OUT std_logic_vector (31 DOWNTO 0); 37 cc_R14 : OUT std_logic_vector (31 DOWNTO 0); 38 cc_R15 : OUT std_logic_vector (31 DOWNTO 0); 39 cc_R8 : OUT std_logic_vector (31 DOWNTO 0); 40 cc_R9 : OUT std_logic_vector (31 DOWNTO 0); 41 coin_n_c : OUT std_logic_vector (15 DOWNTO 0); 42 coin_n_p : OUT std_logic_vector (15 DOWNTO 0); 43 dead_time : OUT std_logic_vector (15 DOWNTO 0); 44 -- data from config ram 45 general_settings : OUT std_logic_vector (15 DOWNTO 0); 46 lp1_amplitude : OUT std_logic_vector (15 DOWNTO 0); 47 lp1_delay : OUT std_logic_vector (15 DOWNTO 0); 48 lp2_amplitude : OUT std_logic_vector (15 DOWNTO 0); 49 lp2_delay : OUT std_logic_vector (15 DOWNTO 0); 50 lp_pt_freq : OUT std_logic_vector (15 DOWNTO 0); 51 lp_pt_ratio : OUT std_logic_vector (15 DOWNTO 0); 52 timemarker_delay : OUT std_logic_vector (15 DOWNTO 0); 53 trigger_delay : OUT std_logic_vector (15 DOWNTO 0); 54 sd_addr_ftu : IN std_logic_vector (11 DOWNTO 0); 55 sd_data_out_ftu : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); 56 ftu_active_cr0 : OUT std_logic_vector (15 DOWNTO 0); 57 ftu_active_cr1 : OUT std_logic_vector (15 DOWNTO 0); 58 ftu_active_cr2 : OUT std_logic_vector (15 DOWNTO 0); 59 ftu_active_cr3 : OUT std_logic_vector (15 DOWNTO 0); 60 new_config : OUT std_logic := '0'; 61 config_started : IN std_logic; 62 config_start_eth : IN std_logic; 63 config_started_eth : OUT std_logic := '0'; 64 config_ready_eth : OUT std_logic := '0'; 65 config_started_ack : OUT std_logic := '0'; 66 fl_busy : OUT std_logic; 67 fl_ready : OUT std_logic; 68 fl_write_ftu : IN std_logic; 69 fl_started_ftu : OUT std_logic := '0'; 70 fl_addr_ftu : IN std_logic_vector (11 DOWNTO 0); 71 fl_data_in_ftu : IN std_logic_vector (15 DOWNTO 0) := (others => '0'); 72 ping_ftu_start : OUT std_logic := '0'; 73 ping_ftu_started : IN std_logic; 74 ping_ftu_ready : IN std_logic; 75 dd_write_ftu : IN std_logic; 76 dd_started_ftu : OUT std_logic := '0'; 77 dd_data_in_ftu : IN std_logic_vector (15 DOWNTO 0); 78 dd_addr_ftu : IN std_logic_vector (11 DOWNTO 0); 79 dd_busy : OUT std_logic; 80 dd_ready : OUT std_logic; 81 coin_win_c : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); 82 coin_win_p : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); 83 dd_block_ready_ftu : IN std_logic; 84 dd_block_start_ack_ftu : OUT std_logic := '0'; 85 dd_block_start_ftu : IN std_logic; 86 dd_send : IN std_logic; 87 dd_send_ack : OUT std_logic := '1'; 88 dd_send_ready : OUT std_logic := '1'; 89 ftu_error_calls : IN std_logic_vector (15 DOWNTO 0); 90 ftu_error_data : IN std_logic_vector (223 DOWNTO 0); -- (28 * 8) - 1 91 ftu_error_send : IN std_logic; 92 ftu_error_send_ack : OUT std_logic := '1'; 93 ftu_error_send_ready : OUT std_logic := '1'; 94 prescaling_FTU01 : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); 95 trigger_counter : IN std_logic_vector (31 DOWNTO 0) := (others => '0'); 96 trigger_counter_read : OUT std_logic := '0'; 97 trigger_counter_valid : IN std_logic 98 ); 99 91 100 END ethernet_modul ; 92 101 … … 241 250 coin_win_p : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); 242 251 coin_win_c : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); 252 prescaling_FTU01 : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); 243 253 ftu_active_cr0 : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); 244 254 ftu_active_cr1 : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); … … 328 338 get_header_started : OUT std_logic := '0'; 329 339 get_header_ready : OUT std_logic := '0'; 340 trigger_counter_read : OUT std_logic := '0'; 341 trigger_counter_valid : IN std_logic ; 342 trigger_counter : IN std_logic_vector (31 DOWNTO 0) := (others => '0'); 330 343 header_board_id : OUT std_logic_vector (63 DOWNTO 0) := (others => '0'); 331 344 header_firmware_id : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); … … 386 399 fl_busy : IN std_logic ; 387 400 -- 401 ftu_error_send : IN std_logic ; 402 ftu_error_send_ack : OUT std_logic := '1'; 403 ftu_error_send_ready : OUT std_logic := '1'; 404 ftu_error_calls : IN std_logic_vector (15 DOWNTO 0); 405 ftu_error_data : IN std_logic_vector (223 DOWNTO 0); -- (28 * 8) - 1 406 -- 388 407 get_header : OUT std_logic := '0'; 389 408 get_header_started : IN std_logic ; … … 395 414 ); 396 415 END COMPONENT; 397 398 -- Optional embedded configurations399 -- pragma synthesis_off400 -- FOR ALL : CRAM_4096_16b USE ENTITY FACT_FTM_lib.CRAM_4096_16b;401 -- FOR ALL : DRAM_4096_16b USE ENTITY FACT_FTM_lib.DRAM_4096_16b;402 -- FOR ALL : FRAM_4096_16b USE ENTITY FACT_FTM_lib.FRAM_4096_16b;403 -- FOR ALL : cram_control USE ENTITY FACT_FTM_lib.cram_control;404 -- FOR ALL : dd_write_general_modul USE ENTITY FACT_FTM_lib.dd_write_general_modul;405 -- FOR ALL : dram_control USE ENTITY FACT_FTM_lib.dram_control;406 -- FOR ALL : eth_config_modul USE ENTITY FACT_FTM_lib.eth_config_modul;407 -- FOR ALL : fram_control USE ENTITY FACT_FTM_lib.fram_control;408 -- FOR ALL : header_modul USE ENTITY FACT_FTM_lib.header_modul;409 -- FOR ALL : w5300_modul USE ENTITY FACT_FTM_lib.w5300_modul;410 -- pragma synthesis_on411 416 412 417 BEGIN … … 492 497 coin_win_p => coin_win_p, 493 498 coin_win_c => coin_win_c, 499 prescaling_FTU01 => prescaling_FTU01, 494 500 ftu_active_cr0 => ftu_active_cr0, 495 501 ftu_active_cr1 => ftu_active_cr1, … … 574 580 get_header_started => get_header_started, 575 581 get_header_ready => get_header_ready, 582 trigger_counter_read => trigger_counter_read, 583 trigger_counter_valid => trigger_counter_valid, 584 trigger_counter => trigger_counter, 576 585 header_board_id => header_board_id, 577 586 header_firmware_id => header_firmware_id, … … 626 635 fl_ready => fl_ready_internal, 627 636 fl_busy => fl_busy_internal, 637 ftu_error_send => ftu_error_send, 638 ftu_error_send_ack => ftu_error_send_ack, 639 ftu_error_send_ready => ftu_error_send_ready, 640 ftu_error_calls => ftu_error_calls, 641 ftu_error_data => ftu_error_data, 628 642 get_header => get_header, 629 643 get_header_started => get_header_started, -
firmware/FTM/ethernet/header_modul_beha.vhd
r10256 r10366 8 8 -- using Mentor Graphics HDL Designer(TM) 2009.1 (Build 12) 9 9 -- 10 11 10 LIBRARY ieee; 12 11 USE ieee.std_logic_1164.all; 13 12 USE ieee.std_logic_arith.all; 14 13 USE IEEE.STD_LOGIC_UNSIGNED.all; 15 -- 16 -- 17 -- 14 --LIBRARY FACT_FTM_lib; 15 --USE FACT_FTM_lib.ftm_array_types.all; 16 --USE FACT_FTM_lib.ftm_constants.all; 18 17 library ftm_definitions; 19 18 USE ftm_definitions.ftm_array_types.all; … … 26 25 get_header_started : OUT std_logic := '0'; 27 26 get_header_ready : OUT std_logic := '0'; 27 trigger_counter_read : OUT std_logic := '0'; 28 trigger_counter_valid : IN std_logic; 29 trigger_counter : IN std_logic_vector (31 DOWNTO 0) := (others => '0'); 28 30 header_board_id : OUT std_logic_vector (63 DOWNTO 0) := (others => '0'); 29 31 header_firmware_id : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); … … 36 38 ARCHITECTURE beha OF header_modul IS 37 39 38 type state_header_proc_type is (HP_INIT, HP_CONFIG, HP_IDLE, HP_START, HP_ END);40 type state_header_proc_type is (HP_INIT, HP_CONFIG, HP_IDLE, HP_START, HP_TRG_CNT, HP_END); 39 41 40 42 signal state_header_proc : state_header_proc_type := HP_INIT; … … 62 64 header_board_id <= to_stdlogicvector (DNA_FOR_SIM); 63 65 header_firmware_id <= X"00" & FIRMWARE_ID; 64 header_trigger_counter <= X"22221111";65 66 header_timestamp_counter <= X"333322221111"; 66 state_header_proc <= HP_END; 67 68 trigger_counter_read <= '1'; 69 state_header_proc <= HP_TRG_CNT; 70 71 when HP_TRG_CNT => 72 trigger_counter_read <= '0'; 73 if (trigger_counter_valid = '1') then 74 header_trigger_counter <= trigger_counter; 75 state_header_proc <= HP_END; 76 end if; 67 77 68 78 when HP_END => … … 78 88 79 89 END ARCHITECTURE beha; 90 -
firmware/FTM/ethernet/w5300_modul.vhd
r10256 r10366 23 23 USE IEEE.STD_LOGIC_ARITH.all; 24 24 USE IEEE.STD_LOGIC_UNSIGNED.all; 25 -- LIBRARY FACT_FTM_lib; 26 -- USE FACT_FTM_lib.ftm_array_types.all; 27 -- USE FACT_FTM_lib.ftm_constants.all; 25 26 --LIBRARY FACT_FTM_lib; 27 --USE FACT_FTM_lib.ftm_array_types.all; 28 --USE FACT_FTM_lib.ftm_constants.all; 28 29 library ftm_definitions; 29 30 USE ftm_definitions.ftm_array_types.all; … … 34 35 library UNISIM; 35 36 use UNISIM.VComponents.all; 36 37 37 38 38 ENTITY w5300_modul IS … … 88 88 fl_busy : IN std_logic; 89 89 -- 90 ftu_error_send : IN std_logic; 91 ftu_error_send_ack : OUT std_logic := '1'; 92 ftu_error_send_ready : OUT std_logic := '1'; 93 ftu_error_calls : IN std_logic_vector (15 DOWNTO 0); 94 ftu_error_data : IN std_logic_vector (223 DOWNTO 0); -- (28 * 8) - 1 95 -- 90 96 get_header : OUT std_logic := '0'; 91 97 get_header_started : IN std_logic; … … 95 101 header_trigger_counter : IN std_logic_vector (31 DOWNTO 0); 96 102 header_timestamp_counter : IN std_logic_vector (47 DOWNTO 0) 103 97 104 ); 98 105 … … 103 110 type state_init_type is (INTERRUPT, RESET, WRITE_REG, READ_REG, WRITE_DATA, 104 111 INIT, IM, MT, STX, STX1, STX2, STX3, SRX, SRX1, SRX2, SRX3, MAC, MAC1, MAC2, GW, GW1, SNM, SNM1, IP, IP1, TIMEOUT, RETRY, 105 SI, SI1, SI2, SI3, SI4, SI5, SI6, ESTABLISH, EST1, CONFIG, MAIN, MAIN1, MAIN2, MAIN3, CHK_RECEIVED, 106 READ_DATA, WRITE_TO_SD_ADDR, READ_F ROM_SD_ADDR, READ_FROM_DD_ADDR, READ_FROM_FL_ADDR, READ_FROM_HEADER_MODUL);112 SI, SI1, SI2, SI3, SI4, SI5, SI6, ESTABLISH, EST1, CONFIG, MAIN, MAIN1, MAIN2, MAIN3, CHK_RECEIVED, SEND_FTU_ERROR, 113 READ_DATA, WRITE_TO_SD_ADDR, READ_FTU_ERROR, READ_FROM_SD_ADDR, READ_FROM_DD_ADDR, READ_FROM_FL_ADDR, READ_FROM_HEADER_MODUL); 107 114 type state_write_type is (WR_START, WR_LENGTH, WR_01, WR_02, WR_03, WR_04, WR_05, WR_06, WR_07, WR_08, 108 115 WR_GET_HEADER, WR_GET_HEADER_WAIT, WR_FIFO_DATA, WR_FIFO_DATA_01, WR_FIFO_HEADER, WR_FIFO_HEADER_01); … … 116 123 type state_read_dd_type is (READ_DD_START, READ_DD_WAIT, READ_DD_END); 117 124 type state_read_dd_block_type is (READ_DD_BLOCK_START, READ_DD_BLOCK_WRITE_GENERAL, READ_DD_BLOCK_WRITE, READ_DD_BLOCK_END, READ_DD_BLOCK_INTERN); 125 type state_send_ftu_error_type is (SFE_START, SFE_END); 118 126 119 127 signal RST_TIME : std_logic_vector(19 downto 0) := X"7A120"; … … 137 145 signal state_read_dd : state_read_dd_type := READ_DD_START; 138 146 signal state_read_dd_block : state_read_dd_block_type := READ_DD_BLOCK_START; 147 signal state_send_ftu_error : state_send_ftu_error_type := SFE_START; 139 148 140 149 … … 144 153 signal zaehler : std_logic_vector (19 downto 0) := (others => '0'); 145 154 signal data_cnt : integer := 0; 146 signal header_cnt : integer := 0;155 signal header_cnt : std_logic_vector (7 DOWNTO 0) := X"00"; 147 156 signal socket_cnt : std_logic_vector (2 downto 0) := "000"; 148 157 … … 164 173 signal internal_cmd : std_logic := '0'; 165 174 175 signal autosend_flag : std_logic := '1'; 176 166 177 -- -- -- 167 178 signal led_int : std_logic_vector (7 downto 0) := X"00"; … … 289 300 state_read_dd <= READ_DD_START; 290 301 state_read_dd_block <= READ_DD_BLOCK_START; 302 state_send_ftu_error <= SFE_START; 291 303 -- reset output signals 292 304 new_config <= '0'; … … 302 314 dd_write_general <= '0'; 303 315 fl_read <= '0'; 316 ftu_error_send_ack <= '1'; 317 ftu_error_send_ready <= '1'; 304 318 -- set internal signals 305 319 new_config_flag <= '0'; … … 312 326 end if; 313 327 314 328 -- Init 315 329 when INIT => 316 330 par_addr <= W5300_MR; … … 319 333 next_state <= IM; 320 334 321 335 -- Interrupt Mask 322 336 when IM => 323 337 par_addr <= W5300_IMR; … … 326 340 next_state <= MT; 327 341 328 342 -- Memory Type 329 343 when MT => 330 344 par_addr <= W5300_MTYPER; … … 333 347 next_state <= STX; 334 348 335 349 -- Socket TX Memory Size 336 350 when STX => 337 351 par_data <= X"4000"; -- 64K TX for socket 0, others 0 … … 375 389 next_state <= MAC; 376 390 377 391 -- MAC 378 392 when MAC => 379 393 par_addr <= W5300_SHAR; … … 392 406 next_state <= GW; 393 407 394 408 -- Gateway 395 409 when GW => 396 410 par_addr <= W5300_GAR; … … 406 420 next_state <= SNM; 407 421 408 422 -- Subnet Mask 409 423 when SNM => 410 424 par_addr <= W5300_SUBR; … … 419 433 state_init <= WRITE_REG; 420 434 next_state <= IP; 421 435 -- Own IP-Address 422 436 when IP => 423 437 par_addr <= W5300_SIPR; … … 432 446 state_init <= WRITE_REG; 433 447 next_state <= SI; 434 448 -- Socket Init 435 449 when SI => 436 450 par_addr <= W5300_S0_MR + socket_cnt * W5300_S_INC; … … 438 452 state_init <= WRITE_REG; 439 453 next_state <= SI1; 440 454 -- Sx Interrupt Mask 441 455 when SI1 => 442 456 par_addr <= W5300_S0_IMR + socket_cnt * W5300_S_INC; … … 493 507 dd_send_ack <= '0'; 494 508 dd_send_ready <= '0'; 509 ftu_error_send_ack <= '0'; 510 ftu_error_send_ready <= '0'; 495 511 led_int <= X"00"; 496 512 -- -- -- … … 538 554 dd_send_ack <= '1'; 539 555 dd_send_ready <= '0'; 540 -- "simulate" command read dynamic data block 541 cmd_array (0) <= CMD_START_DELIMITER; 542 cmd_array (1) <= CMD_READ; 543 cmd_array (2) <= PAR_READ_DD; 544 state_read_data <= RD_CMD_PARSE; 556 if (autosend_flag = '0') then 557 state_read_dd_block <= READ_DD_BLOCK_END; 558 end if; 559 state_read_data <= RD_READ_DD_BLOCK; 545 560 state_init <= READ_DATA; 561 elsif (ftu_error_send = '1') then 562 ftu_error_send_ack <= '1'; 563 ftu_error_send_ready <= '0'; 564 if (autosend_flag = '0') then 565 state_send_ftu_error <= SFE_END; 566 end if; 567 state_init <= SEND_FTU_ERROR; 546 568 end if; 547 569 548 570 571 -- send FTU error message 572 when SEND_FTU_ERROR => 573 case state_send_ftu_error is 574 when SFE_START => 575 next_state <= SEND_FTU_ERROR; 576 read_addr_state <= READ_FTU_ERROR; 577 local_sd_addr <= X"000"; 578 local_write_length <= "00000" & FTU_ERROR_LENGTH; 579 state_send_ftu_error <= SFE_END; 580 state_init <= WRITE_DATA; 581 when SFE_END => 582 if (ftu_error_send = '0') then 583 ftu_error_send_ack <= '0'; 584 ftu_error_send_ready <= '1'; 585 state_send_ftu_error <= SFE_START; 586 state_init <= MAIN; 587 end if; 588 end case; 589 590 549 591 -- read data from socket 0 550 592 when READ_DATA => … … 664 706 state_ping <= PING_START; 665 707 state_read_data <= RD_PING; 708 709 when CMD_AUTOSEND => 710 state_read_data <= RD_5; 711 case cmd_array (2) is 712 when PAR_AUTOSEND_EA => 713 autosend_flag <= '1'; 714 when PAR_AUTOSEND_DA => 715 autosend_flag <= '0'; 716 when others => 717 null; 718 end case; 666 719 667 720 when others => … … 791 844 end case; -- state_read_data 792 845 793 846 847 -- read FTU errors 848 when READ_FTU_ERROR => 849 state_init <= next_state; 850 if (data_cnt = 0) then 851 local_sd_data <= ftu_error_calls; 852 else 853 local_sd_data <= X"00" & ftu_error_data (((data_cnt * 8) - 1) DOWNTO ((data_cnt * 8) - 8)); 854 end if; 855 856 794 857 -- read from header modul 795 858 when READ_FROM_HEADER_MODUL => 796 859 state_init <= next_state; 797 860 case header_cnt is 798 when 0=>861 when X"00" => 799 862 local_sd_data <= header_board_id (63 DOWNTO 48); 800 when 1=>863 when X"01" => 801 864 local_sd_data <= header_board_id (47 DOWNTO 32); 802 when 2=>865 when X"02" => 803 866 local_sd_data <= header_board_id (31 DOWNTO 16); 804 when 3=>867 when X"03" => 805 868 local_sd_data <= header_board_id (15 DOWNTO 0); 806 when 4=>869 when X"04" => 807 870 local_sd_data <= header_firmware_id; 808 when 5=>871 when X"05" => 809 872 local_sd_data <= header_trigger_counter (31 DOWNTO 16); 810 when 6=>873 when X"06" => 811 874 local_sd_data <= header_trigger_counter (15 DOWNTO 0); 812 when 7=>875 when X"07" => 813 876 local_sd_data <= header_timestamp_counter (47 DOWNTO 32); 814 when 8=>877 when X"08" => 815 878 local_sd_data <= header_timestamp_counter (31 DOWNTO 16); 816 when 9=>879 when X"09" => 817 880 local_sd_data <= header_timestamp_counter (15 DOWNTO 0); 818 when 10=>881 when X"0A" => 819 882 local_sd_data <= X"FFFF"; -- spare 820 883 when others => … … 920 983 write_length_bytes <= (FTM_HEADER_LENGTH + local_write_length (15 downto 0)) & '0'; -- shift left (*2) 921 984 data_cnt <= 0; 922 header_cnt <= 0;985 header_cnt <= X"00"; 923 986 state_write <= WR_01; 924 987 -- Check FIFO Size … … 1074 1137 1075 1138 end Behavioral; 1076
Note:
See TracChangeset
for help on using the changeset viewer.