Changeset 10366
- Timestamp:
- 04/13/11 15:02:49 (14 years ago)
- Location:
- firmware/FTM
- Files:
-
- 43 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
firmware/FTM/FTM_central_control.vhd
r10328 r10366 35 35 port( 36 36 clk : IN std_logic; 37 clk_ready : in std_logic; 37 38 clk_scaler : IN std_logic; 38 39 new_config : IN std_logic; … … 60 61 config_start_cc : out std_logic := '0'; 61 62 config_started_cc : in std_logic; 62 config_ready_cc : in std_logic 63 config_ready_cc : in std_logic; 64 config_trigger : out std_logic := '0'; 65 config_trigger_done : in std_logic 63 66 ); 64 67 end FTM_central_control; … … 82 85 CP_CONFIG_FTU, CP_CONFIG_FTU_01, 83 86 CP_CONFIG_SCALER, CP_CONFIG_SCALER_01, 87 CP_CONFIG_TRIGGER, CP_CONFIG_TRIGGER_01, 84 88 CP_IDLE, CP_PING, CP_READ_RATES, CP_READ_RATES_01, 85 89 CP_SEND_START, CP_SEND_END); … … 94 98 95 99 when CP_INIT => 96 state_central_proc <= CP_CONFIG; 97 100 if (clk_ready = '1') then 101 state_central_proc <= CP_CONFIG; 102 end if; 103 98 104 when CP_CONFIG_START => 99 105 if (config_started_ack = '1') then … … 154 160 wait_cnt_sig <= 0; 155 161 reset_scaler_sig <= '0'; 162 state_central_proc <= CP_CONFIG_TRIGGER; 163 end if; 164 165 when CP_CONFIG_TRIGGER => 166 --config trigger_manager block 167 config_trigger <= '1'; 168 state_central_proc <= CP_CONFIG_TRIGGER_01; 169 170 when CP_CONFIG_TRIGGER_01 => 171 config_trigger <= '0'; 172 if (config_trigger_done = '1') then 156 173 state_central_proc <= CP_IDLE; 157 174 end if; -
firmware/FTM/FTM_top.vhd
r10256 r10366 89 89 -- on IO-Bank 2 90 90 ------------------------------------------------------------------------------- 91 --Trig_Prim_A : in STD_LOGIC_VECTOR(9 downto 0); -- crate 092 --Trig_Prim_B : in STD_LOGIC_VECTOR(9 downto 0); -- crate 193 --Trig_Prim_C : in STD_LOGIC_VECTOR(9 downto 0); -- crate 294 --Trig_Prim_D : in STD_LOGIC_VECTOR(9 downto 0); -- crate 391 Trig_Prim_A : in STD_LOGIC_VECTOR(9 downto 0); -- crate 0 92 Trig_Prim_B : in STD_LOGIC_VECTOR(9 downto 0); -- crate 1 93 Trig_Prim_C : in STD_LOGIC_VECTOR(9 downto 0); -- crate 2 94 Trig_Prim_D : in STD_LOGIC_VECTOR(9 downto 0); -- crate 3 95 95 96 96 … … 98 98 ------------------------------------------------------------------------------ 99 99 -- on IO-Bank 3 100 --ext_Trig : in STD_LOGIC_VECTOR(2 downto 1); -- external trigger input101 --Veto : in STD_LOGIC; -- trigger veto input100 ext_Trig : in STD_LOGIC_VECTOR(2 downto 1); -- external trigger input 101 Veto : in STD_LOGIC; -- trigger veto input 102 102 -- NIM_In : in STD_LOGIC_VECTOR(2 downto 0); -- auxiliary inputs 103 103 … … 186 186 -- on IO-Bank 3 187 187 ------------------------------------------------------------------------------- 188 --Busy0 : in STD_LOGIC;189 --Busy1 : in STD_LOGIC;190 --Busy2 : in STD_LOGIC;191 --Busy3 : in STD_LOGIC;188 Busy0 : in STD_LOGIC; 189 Busy1 : in STD_LOGIC; 190 Busy2 : in STD_LOGIC; 191 Busy3 : in STD_LOGIC; 192 192 193 193 … … 215 215 -- RES_n : out STD_LOGIC; -- RES- IO-Bank 0 216 216 217 --TRG_p : out STD_LOGIC; -- TRG+ Trigger218 --TRG_n : out STD_LOGIC; -- TRG- IO-Bank 0219 220 --TIM_Run_p : out STD_LOGIC; -- TIM_Run+ Time Marker221 --TIM_Run_n : out STD_LOGIC; -- TIM_Run- IO-Bank 2217 TRG_p : out STD_LOGIC; -- TRG+ Trigger 218 TRG_n : out STD_LOGIC; -- TRG- IO-Bank 0 219 220 TIM_Run_p : out STD_LOGIC; -- TIM_Run+ Time Marker 221 TIM_Run_n : out STD_LOGIC; -- TIM_Run- IO-Bank 2 222 222 TIM_Sel : out STD_LOGIC -- Time Marker selector on IO-Bank 2 223 223 … … 336 336 signal dd_send_ack_sig : std_logic := '1'; 337 337 signal dd_send_ready_sig : std_logic := '1'; 338 --very new stuff 339 SIGNAL ftu_error_send_ack_sig : std_logic := '1'; 340 SIGNAL ftu_error_send_ready_sig : std_logic := '1'; 341 SIGNAL ftu_error_calls_sig : std_logic_vector(15 DOWNTO 0) := X"0000"; 342 SIGNAL ftu_error_data_sig : std_logic_vector(223 DOWNTO 0) := (others => '0'); 343 SIGNAL ftu_error_send_sig : std_logic := '0'; 344 signal prescaling_FTU01_sig : std_logic_vector (15 DOWNTO 0); 345 signal trigger_counter_sig : std_logic_vector (31 DOWNTO 0); 346 signal trigger_counter_read_sig : std_logic; 347 signal trigger_counter_valid_sig : std_logic; 348 338 349 signal config_start_cc_sig : std_logic := '0'; 339 350 signal config_started_cc_sig : std_logic := '0'; 340 351 signal config_ready_cc_sig : std_logic := '0'; 352 353 signal config_trigger_sig : std_logic; 354 signal config_trigger_done_sig : std_logic; 341 355 342 356 signal clk_buf_sig : std_logic; … … 349 363 signal reset_sig : STD_LOGIC := '0'; -- initialize to 0 on power-up 350 364 365 signal trigger_signal_sig : std_logic := '0'; 366 signal TIM_signal_sig : std_logic := '0'; 367 351 368 signal led_sig : std_logic_vector(7 downto 0) := (others => '0'); 352 369 353 component FTM_clk_gen 370 -- component FTM_clk_gen 371 -- port( 372 -- clk : IN STD_LOGIC; 373 -- rst : IN STD_LOGIC; 374 -- clk_1 : OUT STD_LOGIC; 375 -- clk_50 : OUT STD_LOGIC; 376 -- clk_250 : OUT STD_LOGIC; 377 -- clk_250_ps : OUT STD_LOGIC; 378 -- ready : OUT STD_LOGIC 379 -- ); 380 -- end component; 381 382 component FTM_clk_gen_2 354 383 port( 355 384 clk : IN STD_LOGIC; … … 362 391 ); 363 392 end component; 364 393 394 component trigger_manager 395 port( 396 --clocks 397 clk_50MHz : in std_logic; 398 clk_250MHz : in std_logic; 399 clk_250MHz_180 : in std_logic; 400 --trigger primitives from FTUs 401 trig_prim_0 : in std_logic_vector(9 downto 0); --crate 0 402 trig_prim_1 : in std_logic_vector(9 downto 0); --crate 1 403 trig_prim_2 : in std_logic_vector(9 downto 0); --crate 2 404 trig_prim_3 : in std_logic_vector(9 downto 0); --crate 3 405 --external signals 406 ext_trig_1 : in std_logic; 407 ext_trig_2 : in std_logic; 408 ext_veto : in std_logic; 409 FAD_busy_0 : in std_logic; --crate 0 410 FAD_busy_1 : in std_logic; --crate 1 411 FAD_busy_2 : in std_logic; --crate 2 412 FAD_busy_3 : in std_logic; --crate 3 413 --control signals from e.g. main control 414 start_run : in std_logic; --enable trigger output 415 stop_run : in std_logic; --disable trigger output 416 new_config : in std_logic; 417 --settings register (see FTM Firmware Specifications) 418 general_settings : in std_logic_vector(15 downto 0); 419 LP_and_PED_freq : in std_logic_vector(15 downto 0); 420 LP1_LP2_PED_ratio : in std_logic_vector(15 downto 0); 421 maj_coinc_n_phys : in std_logic_vector(15 downto 0); 422 maj_coinc_n_calib : in std_logic_vector(15 downto 0); 423 trigger_delay : in std_logic_vector(15 downto 0); 424 TIM_delay : in std_logic_vector(15 downto 0); 425 dead_time : in std_logic_vector(15 downto 0); 426 coinc_window_phys : in std_logic_vector(15 downto 0); 427 coinc_window_calib : in std_logic_vector(15 downto 0); 428 active_FTU_list_0 : in std_logic_vector(15 downto 0); 429 active_FTU_list_1 : in std_logic_vector(15 downto 0); 430 active_FTU_list_2 : in std_logic_vector(15 downto 0); 431 active_FTU_list_3 : in std_logic_vector(15 downto 0); 432 --control signals or information for other entities 433 trigger_ID_read : in std_logic; 434 trig_cnt_copy_read : in std_logic; 435 trigger_ID_ready : out std_logic; 436 trigger_ID : out std_logic_vector(55 downto 0); 437 trig_cnt_copy : out std_logic_vector(31 downto 0); --counter reading 438 trig_cnt_copy_valid : out std_logic; --trigger counter reading is valid 439 trigger_active : out std_logic; --phys triggers are enabled/active 440 config_done : out std_logic; 441 LP1_pulse : out std_logic; --send start signal to light pulser 1 442 LP2_pulse : out std_logic; --send start signal to light pulser 2 443 --trigger and time marker output signals to FADs 444 trigger_signal : out std_logic; 445 TIM_signal : out std_logic 446 ); 447 end component; 448 365 449 component Clock_cond_interface is 366 450 port( … … 390 474 port( 391 475 clk : IN std_logic; 476 clk_ready : in std_logic; 392 477 clk_scaler : IN std_logic; 393 478 new_config : IN std_logic; … … 415 500 config_start_cc : out std_logic := '0'; 416 501 config_started_cc : in std_logic; 417 config_ready_cc : in std_logic 502 config_ready_cc : in std_logic; 503 config_trigger : out std_logic; 504 config_trigger_done : in std_logic 418 505 ); 419 506 end component; … … 536 623 dd_send : IN std_logic; 537 624 dd_send_ack : OUT std_logic := '1'; 538 dd_send_ready : OUT std_logic := '1' 625 dd_send_ready : OUT std_logic := '1'; 626 --very new stuff 627 ftu_error_calls : IN std_logic_vector (15 DOWNTO 0); 628 ftu_error_data : IN std_logic_vector (223 DOWNTO 0); -- (28 * 8) - 1 629 ftu_error_send : IN std_logic; 630 ftu_error_send_ack : OUT std_logic := '1'; 631 ftu_error_send_ready : OUT std_logic := '1'; 632 prescaling_FTU01 : OUT std_logic_vector (15 DOWNTO 0) := (others => '0'); 633 trigger_counter : IN std_logic_vector (31 DOWNTO 0) := (others => '0'); 634 trigger_counter_read : OUT std_logic := '0'; 635 trigger_counter_valid : IN std_logic 539 636 ); 540 637 end component; … … 542 639 begin 543 640 544 -- IBUFG: Single-ended global clock input buffer 545 -- Spartan-3A 546 -- Xilinx HDL Language Template, version 11.4 547 548 IBUFG_inst : IBUFG 549 generic map ( 550 IBUF_DELAY_VALUE => "0", -- Specify the amount of added input delay for buffer, 551 -- "0"-"16" 552 IOSTANDARD => "DEFAULT") 553 port map ( 554 O => clk_buf_sig, -- Clock buffer output 555 I => clk -- Clock buffer input (connect directly to top-level port) 556 ); 557 558 Inst_FTM_clk_gen : FTM_clk_gen 641 -- -- IBUFG: Single-ended global clock input buffer 642 -- -- Spartan-3A 643 -- -- Xilinx HDL Language Template, version 11.4 644 645 -- IBUFG_inst : IBUFG 646 -- generic map ( 647 -- IBUF_DELAY_VALUE => "0", -- Specify the amount of added input delay for buffer, 648 -- -- "0"-"16" 649 -- IOSTANDARD => "DEFAULT") 650 -- port map ( 651 -- O => clk_buf_sig, -- Clock buffer output 652 -- I => clk -- Clock buffer input (connect directly to top-level port) 653 -- ); 654 655 -- Inst_FTM_clk_gen : FTM_clk_gen 656 -- port map( 657 -- clk => clk_buf_sig, 658 -- rst => reset_sig, 659 -- clk_1 => clk_1M_sig, 660 -- clk_50 => clk_50M_sig, 661 -- clk_250 => clk_250M_sig, 662 -- clk_250_ps => clk_250M_ps_sig, 663 -- ready => clk_ready_sig 664 -- ); 665 666 Inst_FTM_clk_gen_2 : FTM_clk_gen_2 559 667 port map( 560 clk => clk _buf_sig,668 clk => clk, 561 669 rst => reset_sig, 562 670 clk_1 => clk_1M_sig, … … 566 674 ready => clk_ready_sig 567 675 ); 568 676 677 --differential output buffer for trigger signal 678 OBUFDS_LVDS_33_TRG : OBUFDS_LVDS_33 679 port map( 680 O => TRG_p, 681 OB => TRG_n, 682 I => trigger_signal_sig 683 ); 684 685 --differential output buffer for trigger signal 686 OBUFDS_LVDS_33_TIM : OBUFDS_LVDS_33 687 port map( 688 O => TIM_Run_p, 689 OB => TIM_Run_n, 690 I => TIM_signal_sig 691 ); 692 693 Inst_trigger_manager : trigger_manager 694 port map( 695 --clocks 696 clk_50MHz => clk_50M_sig, 697 clk_250MHz => clk_250M_sig, 698 clk_250MHz_180 => clk_250M_ps_sig, 699 --trigger primitives from FTUs 700 trig_prim_0 => Trig_Prim_A, --crate 0 701 trig_prim_1 => Trig_Prim_B, --crate 1 702 trig_prim_2 => Trig_Prim_C, --crate 2 703 trig_prim_3 => Trig_Prim_D, --crate 3 704 --external signals 705 ext_trig_1 => ext_Trig(1), 706 ext_trig_2 => ext_Trig(2), 707 ext_veto => Veto, 708 FAD_busy_0 => Busy0, --crate 0 709 FAD_busy_1 => Busy1, --crate 1 710 FAD_busy_2 => Busy2, --crate 2 711 FAD_busy_3 => Busy3, --crate 3 712 --control signals from e.g. main control 713 start_run => '1', --enable trigger output 714 stop_run => '0', --disable trigger output 715 new_config => config_trigger_sig, 716 --settings register (see FTM Firmware Specifications) 717 general_settings => general_settings_sig, 718 LP_and_PED_freq => lp_pt_freq_sig, 719 LP1_LP2_PED_ratio => lp_pt_ratio_sig, 720 maj_coinc_n_phys => coin_n_p_sig, 721 maj_coinc_n_calib => coin_n_c_sig, 722 trigger_delay => trigger_delay_sig, 723 TIM_delay => timemarker_delay_sig, 724 dead_time => dead_time_sig, 725 coinc_window_phys => coin_win_p_sig, 726 coinc_window_calib => coin_win_c_sig, 727 active_FTU_list_0 => ftu_active_cr0_sig, 728 active_FTU_list_1 => ftu_active_cr1_sig, 729 active_FTU_list_2 => ftu_active_cr2_sig, 730 active_FTU_list_3 => ftu_active_cr3_sig, 731 --control signals or information for other entities 732 trigger_ID_read => '0', 733 trig_cnt_copy_read => trigger_counter_read_sig, 734 trigger_ID_ready => open, 735 trigger_ID => open, 736 trig_cnt_copy => trigger_counter_sig, --counter reading 737 trig_cnt_copy_valid => trigger_counter_valid_sig, --trigger counter reading is valid 738 trigger_active => open, --phys triggers are enabled/active 739 config_done => config_trigger_done_sig, 740 LP1_pulse => open, --send start signal to light pulser 1 741 LP2_pulse => open, --send start signal to light pulser 2 742 --trigger and time marker output signals to FADs 743 trigger_signal => trigger_signal_sig, 744 TIM_signal => TIM_signal_sig 745 ); 746 569 747 Inst_Clock_cond_interface : Clock_cond_interface 570 748 port map( … … 593 771 port map( 594 772 clk => clk_50M_sig, 773 clk_ready => clk_ready_sig, 595 774 clk_scaler => clk_1M_sig, 596 775 new_config => new_config_sig, … … 612 791 rates_started_ftu => rates_ftu_started_sig, 613 792 rates_ready_ftu => rates_ftu_ready_sig, 614 prescaling_FTU01 => "00010011",793 prescaling_FTU01 => prescaling_FTU01_sig(7 downto 0), 615 794 dd_send => dd_send_sig, 616 795 dd_send_ack => dd_send_ack_sig, … … 618 797 config_start_cc => config_start_cc_sig, 619 798 config_started_cc => config_started_cc_sig, 620 config_ready_cc => config_ready_cc_sig 799 config_ready_cc => config_ready_cc_sig, 800 config_trigger => config_trigger_sig, 801 config_trigger_done => config_trigger_done_sig 621 802 ); 622 803 … … 737 918 dd_send => dd_send_sig, 738 919 dd_send_ack => dd_send_ack_sig, 739 dd_send_ready => dd_send_ready_sig 920 dd_send_ready => dd_send_ready_sig, 921 --very new stuff 922 ftu_error_calls => ftu_error_calls_sig, 923 ftu_error_data => ftu_error_data_sig, 924 ftu_error_send => ftu_error_send_sig, 925 ftu_error_send_ack => ftu_error_send_ack_sig, 926 ftu_error_send_ready => ftu_error_send_ready_sig, 927 prescaling_FTU01 => prescaling_FTU01_sig, 928 trigger_counter => trigger_counter_sig, 929 trigger_counter_read => trigger_counter_read_sig, 930 trigger_counter_valid => trigger_counter_valid_sig 740 931 ); 741 932 -
firmware/FTM/FTM_top_tb.vhd
r10328 r10366 92 92 -- Trigger primitives inputs 93 93 ------------------------------------------------------------------------------- 94 --Trig_Prim_A : in STD_LOGIC_VECTOR(9 downto 0); -- crate 095 --Trig_Prim_B : in STD_LOGIC_VECTOR(9 downto 0); -- crate 196 --Trig_Prim_C : in STD_LOGIC_VECTOR(9 downto 0); -- crate 297 --Trig_Prim_D : in STD_LOGIC_VECTOR(9 downto 0); -- crate 394 Trig_Prim_A : in STD_LOGIC_VECTOR(9 downto 0); -- crate 0 95 Trig_Prim_B : in STD_LOGIC_VECTOR(9 downto 0); -- crate 1 96 Trig_Prim_C : in STD_LOGIC_VECTOR(9 downto 0); -- crate 2 97 Trig_Prim_D : in STD_LOGIC_VECTOR(9 downto 0); -- crate 3 98 98 99 99 100 100 -- NIM inputs 101 101 ------------------------------------------------------------------------------ 102 --ext_Trig : in STD_LOGIC_VECTOR(2 downto 1); -- external trigger input103 --Veto : in STD_LOGIC; -- trigger veto input102 ext_Trig : in STD_LOGIC_VECTOR(2 downto 1); -- external trigger input 103 Veto : in STD_LOGIC; -- trigger veto input 104 104 -- NIM_In : in STD_LOGIC_VECTOR(2 downto 0); -- auxiliary inputs 105 105 … … 141 141 142 142 Bus1_RxD_3 : in STD_LOGIC; -- crate 3 143 Bus1_TxD_3 : out STD_LOGIC 143 Bus1_TxD_3 : out STD_LOGIC; 144 144 145 145 … … 183 183 -- Busy signals from the FAD boards 184 184 ------------------------------------------------------------------------------- 185 --Busy0 : in STD_LOGIC;186 --Busy1 : in STD_LOGIC;187 --Busy2 : in STD_LOGIC;188 --Busy3 : in STD_LOGIC;185 Busy0 : in STD_LOGIC; 186 Busy1 : in STD_LOGIC; 187 Busy2 : in STD_LOGIC; 188 Busy3 : in STD_LOGIC; 189 189 190 190 … … 211 211 -- RES_n : out STD_LOGIC; -- RES- 212 212 213 --TRG_p : out STD_LOGIC; -- TRG+ Trigger214 --TRG_n : out STD_LOGIC; -- TRG-215 216 --TIM_Run_p : out STD_LOGIC; -- TIM_Run+ Time Marker217 -- TIM_Run_n : out STD_LOGIC;-- TIM_Run-213 TRG_p : out STD_LOGIC; -- TRG+ Trigger 214 TRG_n : out STD_LOGIC; -- TRG- 215 216 TIM_Run_p : out STD_LOGIC; -- TIM_Run+ Time Marker 217 TIM_Run_n : out STD_LOGIC -- TIM_Run- 218 218 -- TIM_Sel : out STD_LOGIC; -- Time Marker selector 219 219 … … 368 368 -- SIO => SIO_sig, 369 369 -- TS_CS => TS_CS_sig, 370 --Trig_Prim_A => Trig_Prim_A_sig,371 --Trig_Prim_B => Trig_Prim_B_sig,372 --Trig_Prim_C => Trig_Prim_C_sig,373 --Trig_Prim_D => Trig_Prim_D_sig,374 --ext_Trig => ext_Trig_sig,375 --Veto => Veto_sig,370 Trig_Prim_A => Trig_Prim_A_sig, 371 Trig_Prim_B => Trig_Prim_B_sig, 372 Trig_Prim_C => Trig_Prim_C_sig, 373 Trig_Prim_D => Trig_Prim_D_sig, 374 ext_Trig => ext_Trig_sig, 375 Veto => Veto_sig, 376 376 -- NIM_In => NIM_In_sig, 377 377 -- NIM_In3_GCLK => NIM_In3_GCLK_sig, … … 393 393 Bus1_TxD_2 => Bus1_TxD_2_sig, 394 394 Bus1_RxD_3 => Bus1_RxD_3_sig, 395 Bus1_TxD_3 => Bus1_TxD_3_sig 395 Bus1_TxD_3 => Bus1_TxD_3_sig, 396 396 -- Bus2_Tx_En => Bus2_Tx_En_sig, 397 397 -- Bus2_Rx_En => Bus2_Rx_En_sig, … … 408 408 -- Crate_Res2 => Crate_Res2_sig, 409 409 -- Crate_Res3 => Crate_Res3_sig, 410 --Busy0 => Busy0_sig,411 --Busy1 => Busy1_sig,412 --Busy2 => Busy2_sig,413 --Busy3 => Busy3_sig,410 Busy0 => Busy0_sig, 411 Busy1 => Busy1_sig, 412 Busy2 => Busy2_sig, 413 Busy3 => Busy3_sig, 414 414 -- RES_p => RES_p_sig, 415 415 -- RES_n => RES_n_sig, 416 --TRG_p => TRG_p_sig,417 --TRG_n => TRG_n_sig,418 --TIM_Run_p => TIM_Run_p_sig,419 -- TIM_Run_n => TIM_Run_n_sig, 416 TRG_p => TRG_p_sig, 417 TRG_n => TRG_n_sig, 418 TIM_Run_p => TIM_Run_p_sig, 419 TIM_Run_n => TIM_Run_n_sig 420 420 -- TIM_Sel => TIM_Sel_sig, 421 421 -- Cal_0_p => Cal_0_p_sig, … … 446 446 end process clk_proc; 447 447 448 -- Stimulus process for busy signals 449 busy_proc: process 450 begin 451 wait for 500us; 452 Busy0_sig <= '1'; 453 wait for 100us; 454 Busy0_sig <= '0'; 455 wait for 1ms; 456 Busy0_sig <= '1'; 457 wait for 500us; 458 Busy0_sig <= '0'; 459 wait; 460 end process busy_proc; 461 462 -- Stimulus process for trigger 463 trigger_proc: process 464 begin 465 --------------------------------------------------------------------------- 466 -- FTUs not yet initialized 467 --------------------------------------------------------------------------- 468 wait for 10us; 469 Trig_Prim_A_sig(0) <= '1'; 470 wait for 100ns; 471 Trig_Prim_A_sig(0) <= '0'; 472 wait for 99us; 473 Trig_Prim_B_sig(0) <= '1'; 474 wait for 100ns; 475 Trig_Prim_B_sig(0) <= '0'; 476 wait for 1us; 477 Trig_Prim_B_sig(0) <= '1'; 478 wait for 100ns; 479 Trig_Prim_B_sig(0) <= '0'; 480 --------------------------------------------------------------------------- 481 -- now FTUs are initialized 482 --------------------------------------------------------------------------- 483 wait for 2200us; 484 Trig_Prim_A_sig(0) <= '1'; 485 Trig_Prim_B_sig(0) <= '1'; 486 wait for 100ns; 487 Trig_Prim_A_sig(0) <= '0'; 488 Trig_Prim_B_sig(0) <= '0'; 489 wait for 4us; 490 Trig_Prim_A_sig(0) <= '1'; 491 wait for 100ns; 492 Trig_Prim_A_sig(0) <= '0'; 493 wait for 22us; 494 Trig_Prim_B_sig(0) <= '1'; 495 wait for 100ns; 496 Trig_Prim_B_sig(0) <= '0'; 497 wait; 498 end process trigger_proc; 499 448 500 -- Stimulus process for RS485 of crate 0 449 501 rs485_0_proc: process -
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 -
firmware/FTM/ftm_board.ucf
r10256 r10366 98 98 # crate 0 99 99 # crate A 100 #NET Trig_Prim_A<0> LOC = AC6 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<0>101 #NET Trig_Prim_A<1> LOC = AD6 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<1>102 #NET Trig_Prim_A<2> LOC = AF3 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<2>103 #NET Trig_Prim_A<3> LOC = AE4 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<3>104 #NET Trig_Prim_A<4> LOC = AE6 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<4>105 #NET Trig_Prim_A<5> LOC = AE7 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<5>106 #NET Trig_Prim_A<6> LOC = AE8 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<6>107 #NET Trig_Prim_A<7> LOC = AC8 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<7>108 #NET Trig_Prim_A<8> LOC = AC11 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<8>109 #NET Trig_Prim_A<9> LOC = AD11 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<9>100 NET Trig_Prim_A<0> LOC = AC6 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<0> 101 NET Trig_Prim_A<1> LOC = AD6 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<1> 102 NET Trig_Prim_A<2> LOC = AF3 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<2> 103 NET Trig_Prim_A<3> LOC = AE4 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<3> 104 NET Trig_Prim_A<4> LOC = AE6 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<4> 105 NET Trig_Prim_A<5> LOC = AE7 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<5> 106 NET Trig_Prim_A<6> LOC = AE8 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<6> 107 NET Trig_Prim_A<7> LOC = AC8 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<7> 108 NET Trig_Prim_A<8> LOC = AC11 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<8> 109 NET Trig_Prim_A<9> LOC = AD11 | IOSTANDARD=LVCMOS33; # Trig_Prim_0_<9> 110 110 111 111 # crate 1 112 112 # crate B 113 #NET Trig_Prim_B<0> LOC = AB16 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<0>114 #NET Trig_Prim_B<1> LOC = AC15 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<1>115 #NET Trig_Prim_B<2> LOC = AC16 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<2>116 #NET Trig_Prim_B<3> LOC = AE17 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<3>117 #NET Trig_Prim_B<4> LOC = AD19 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<4>118 #NET Trig_Prim_B<5> LOC = AE19 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<5>119 #NET Trig_Prim_B<6> LOC = AE20 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<6>120 #NET Trig_Prim_B<7> LOC = AF20 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<7>121 #NET Trig_Prim_B<8> LOC = AD21 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<8>122 #NET Trig_Prim_B<9> LOC = AE23 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<9>113 NET Trig_Prim_B<0> LOC = AB16 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<0> 114 NET Trig_Prim_B<1> LOC = AC15 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<1> 115 NET Trig_Prim_B<2> LOC = AC16 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<2> 116 NET Trig_Prim_B<3> LOC = AE17 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<3> 117 NET Trig_Prim_B<4> LOC = AD19 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<4> 118 NET Trig_Prim_B<5> LOC = AE19 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<5> 119 NET Trig_Prim_B<6> LOC = AE20 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<6> 120 NET Trig_Prim_B<7> LOC = AF20 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<7> 121 NET Trig_Prim_B<8> LOC = AD21 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<8> 122 NET Trig_Prim_B<9> LOC = AE23 | IOSTANDARD=LVCMOS33; # Trig_Prim_1_<9> 123 123 124 124 # crate 2 125 125 # crate C 126 #NET Trig_Prim_C<0> LOC = AF23 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<0>127 #NET Trig_Prim_C<1> LOC = AC21 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<1>128 #NET Trig_Prim_C<2> LOC = AE21 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<2>129 #NET Trig_Prim_C<3> LOC = AD20 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<3>130 #NET Trig_Prim_C<4> LOC = AC20 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<4>131 #NET Trig_Prim_C<5> LOC = AF19 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<5>132 #NET Trig_Prim_C<6> LOC = AC19 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<6>133 #NET Trig_Prim_C<7> LOC = AD17 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<7>134 #NET Trig_Prim_C<8> LOC = AD14 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<8>135 #NET Trig_Prim_C<9> LOC = AC14 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<9>126 NET Trig_Prim_C<0> LOC = AF23 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<0> 127 NET Trig_Prim_C<1> LOC = AC21 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<1> 128 NET Trig_Prim_C<2> LOC = AE21 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<2> 129 NET Trig_Prim_C<3> LOC = AD20 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<3> 130 NET Trig_Prim_C<4> LOC = AC20 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<4> 131 NET Trig_Prim_C<5> LOC = AF19 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<5> 132 NET Trig_Prim_C<6> LOC = AC19 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<6> 133 NET Trig_Prim_C<7> LOC = AD17 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<7> 134 NET Trig_Prim_C<8> LOC = AD14 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<8> 135 NET Trig_Prim_C<9> LOC = AC14 | IOSTANDARD=LVCMOS33; # Trig_Prim_2_<9> 136 136 137 137 # crate 3 138 138 # crate D 139 #NET Trig_Prim_D<0> LOC = AB12 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<0>140 #NET Trig_Prim_D<1> LOC = AC12 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<1>141 #NET Trig_Prim_D<2> LOC = AC9 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<2>142 #NET Trig_Prim_D<3> LOC = AB9 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<3>143 #NET Trig_Prim_D<4> LOC = AB7 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<4>144 #NET Trig_Prim_D<5> LOC = AF8 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<5>145 #NET Trig_Prim_D<6> LOC = AF4 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<6>146 #NET Trig_Prim_D<7> LOC = AF5 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<7>147 #NET Trig_Prim_D<8> LOC = AD7 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<8>148 #NET Trig_Prim_D<9> LOC = AE3 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<9>139 NET Trig_Prim_D<0> LOC = AB12 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<0> 140 NET Trig_Prim_D<1> LOC = AC12 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<1> 141 NET Trig_Prim_D<2> LOC = AC9 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<2> 142 NET Trig_Prim_D<3> LOC = AB9 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<3> 143 NET Trig_Prim_D<4> LOC = AB7 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<4> 144 NET Trig_Prim_D<5> LOC = AF8 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<5> 145 NET Trig_Prim_D<6> LOC = AF4 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<6> 146 NET Trig_Prim_D<7> LOC = AF5 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<7> 147 NET Trig_Prim_D<8> LOC = AD7 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<8> 148 NET Trig_Prim_D<9> LOC = AE3 | IOSTANDARD=LVCMOS33; # Trig_Prim_3_<9> 149 149 150 150 … … 152 152 ####################################################### 153 153 # on IO-Bank 3 154 #NET ext_Trig<1> LOC = B1 | IOSTANDARD=LVCMOS33; #155 #NET ext_Trig<2> LOC = B2 | IOSTANDARD=LVCMOS33; #156 #NET Veto LOC = E4 | IOSTANDARD=LVCMOS33; #154 NET ext_Trig<1> LOC = B1 | IOSTANDARD=LVCMOS33; # 155 NET ext_Trig<2> LOC = B2 | IOSTANDARD=LVCMOS33; # 156 NET Veto LOC = E4 | IOSTANDARD=LVCMOS33; # 157 157 # NET NIM_In<0> LOC = D3 | IOSTANDARD=LVCMOS33; # 158 158 # NET NIM_In<1> LOC = F4 | IOSTANDARD=LVCMOS33; # … … 260 260 # on IO-Bank 3 261 261 ####################################################### 262 #NET Busy0 LOC = M4 | IOSTANDARD=LVCMOS33 | SLEW = SLOW ; #263 #NET Busy1 LOC = P2 | IOSTANDARD=LVCMOS33 | SLEW = SLOW ; #264 #NET Busy2 LOC = R4 | IOSTANDARD=LVCMOS33 | SLEW = SLOW ; #265 #NET Busy3 LOC = U1 | IOSTANDARD=LVCMOS33 | SLEW = SLOW ; #262 NET Busy0 LOC = M4 | IOSTANDARD=LVCMOS33 | SLEW = SLOW ; # 263 NET Busy1 LOC = P2 | IOSTANDARD=LVCMOS33 | SLEW = SLOW ; # 264 NET Busy2 LOC = R4 | IOSTANDARD=LVCMOS33 | SLEW = SLOW ; # 265 NET Busy3 LOC = U1 | IOSTANDARD=LVCMOS33 | SLEW = SLOW ; # 266 266 267 267 … … 291 291 # NET RES_n LOC = C15 | IOSTANDARD=LVDS_33 | DIFF_TERM="False" ; # RES- IO-Bank 0 292 292 293 #NET TRG_p LOC = B15 | IOSTANDARD=LVDS_33 | DIFF_TERM="False"; # TRG+ Trigger294 #NET TRG_n LOC = A15 | IOSTANDARD=LVDS_33 | DIFF_TERM="False"; # TRG- IO-Bank 0295 296 #NET TIM_Run_p LOC = AF25 | IOSTANDARD=LVDS_33 | DIFF_TERM="False" ; # TIM_Run+ Time Marker297 #NET TIM_Run_n LOC = AE25 | IOSTANDARD=LVDS_33 | DIFF_TERM="False" ; # TIM_Run- on IO-Bank2293 NET TRG_p LOC = B15 | IOSTANDARD=LVDS_33 | DIFF_TERM="False"; # TRG+ Trigger 294 NET TRG_n LOC = A15 | IOSTANDARD=LVDS_33 | DIFF_TERM="False"; # TRG- IO-Bank 0 295 296 NET TIM_Run_p LOC = AF25 | IOSTANDARD=LVDS_33 | DIFF_TERM="False" ; # TIM_Run+ Time Marker 297 NET TIM_Run_n LOC = AE25 | IOSTANDARD=LVDS_33 | DIFF_TERM="False" ; # TIM_Run- on IO-Bank2 298 298 299 299 NET TIM_Sel LOC = AD22 | IOSTANDARD=LVCMOS33; # Time Marker selector IO-Bank 2 -
firmware/FTM/ftm_definitions.vhd
r10328 r10366 29 29 -- kw 03.03.: added FTM_HEADER_LENGTH 30 30 -- 31 -- modified: Quirin Weitzel, March 14 2011 32 -- third merger with library file from dortmund (changes below) 33 -- kw 22.03.: added FTU_ERROR_LENGTH 34 -- kw 30.03.: added CMD_AUTOSEND, PAR_AUTOSEND_EA, PAR_AUTOSEND_DA 35 -- 36 ---kw 11.04.: added SD_ADDR_ftu_prescaling_0 37 -- 31 38 ---------------------------------------------------------------------------------- 32 39 … … 72 79 use ftm_definitions.ftm_array_types.all; 73 80 use IEEE.NUMERIC_STD.ALL; 81 use ieee.math_real.all; 74 82 75 83 package ftm_constants is … … 191 199 -- ping all FTUs 192 200 constant CMD_PING : std_logic_vector := X"0010"; -- ping all FTUs 201 -- turn automatic sending of dd-block and ftu-error-list on or off 202 constant CMD_AUTOSEND : std_logic_vector := X"0020"; 203 constant PAR_AUTOSEND_EA : std_logic_vector := X"0001"; -- enable automatic sending 204 constant PAR_AUTOSEND_DA : std_logic_vector := X"0000"; -- disable automatic sending 193 205 194 206 -- header length of data packages 195 207 constant FTM_HEADER_LENGTH : std_logic_vector (7 DOWNTO 0) := X"0B"; 208 209 -- FTU error message 210 constant FTU_ERROR_LENGTH : std_logic_vector (11 downto 0) := X"01D"; --(number of unsuccessful calls) + (28 * data) = 29 196 211 197 212 -- FTU-list parameters … … 249 264 constant SD_ADDR_coin_win_p : std_logic_vector := X"01D"; 250 265 constant SD_ADDR_coin_win_c : std_logic_vector := X"01E"; 266 constant SD_ADDR_ftu_prescaling_0 : std_logic_vector := X"029"; 251 267 constant SD_ADDR_ftu_active_cr0 : std_logic_vector := X"1B0"; 252 268 constant SD_ADDR_ftu_active_cr1 : std_logic_vector := X"1B1"; … … 264 280 -- !!! to be defined !!! 265 281 constant sd_block_default_array : sd_block_default_array_type := ( 266 X"0000", -- SD_ADDR_general_settings -- general settings 282 --X"0080", -- SD_ADDR_general_settings -- general settings 283 X"0060", -- SD_ADDR_general_settings -- general settings 267 284 X"0000", -- SD_ADDR_led -- on-board status LEDs 268 X"0002", -- SD_ADDR_lp_pt_freq -- light pulser and pedestal trigger frequency 269 X"0003", -- SD_ADDR_lp_pt_ratio... -- ratio between LP1, LP2 and pedestal triggers 285 --X"0400", -- SD_ADDR_lp_pt_freq -- light pulser and pedestal trigger frequency 286 X"0001", -- SD_ADDR_lp_pt_freq -- light pulser and pedestal trigger frequency 287 --X"0001", -- SD_ADDR_lp_pt_ratio... -- ratio between LP1, LP2 and pedestal triggers 288 X"0420", -- SD_ADDR_lp_pt_ratio... -- ratio between LP1, LP2 and pedestal triggers 270 289 X"0004", -- SD_ADDR_lp1_amplitude -- light pulser 1 amplitude 271 290 X"0005", -- SD_ADDR_lp2_amplitude -- light pulser 2 amplitude 272 291 X"0006", -- SD_ADDR_lp1_delay -- light pulser 1 delay 273 292 X"0007", -- SD_ADDR_lp2_delay -- light pulser 2 delay 274 X"0008", -- SD_ADDR_coin_n_p -- majority coincidence n (for physics) 275 X"0009", -- SD_ADDR_coin_n_c -- majority coincidence n (for calibration) 276 X"000A", -- SD_ADDR_trigger_delay -- trigger delay 277 X"000B", -- SD_ADDR_timemarker_delay -- timemarker delay 278 X"000C", -- SD_ADDR_dead_time -- dead time 293 X"0001", -- SD_ADDR_coin_n_p -- majority coincidence n (for physics) 294 X"001E", -- SD_ADDR_coin_n_c -- majority coincidence n (for calibration) 295 X"0000", -- SD_ADDR_trigger_delay -- trigger delay 296 X"0000", -- SD_ADDR_timemarker_delay -- timemarker delay 297 --X"0019", -- SD_ADDR_dead_time -- dead time, 8ns + 4x25ns = 108ns 298 X"0000", -- SD_ADDR_dead_time -- dead time, 8ns + 4x25ns = 108ns 279 299 X"0003", -- SD_ADDR_cc_R0_HI -- clock conditioner R0 bits 31...16 280 300 X"8000", -- SD_ADDR_cc_R0_LO -- clock conditioner R0 bits 15...0 … … 293 313 X"1400", -- SD_ADDR_cc_R15_HI -- clock conditioner R15 bits 31...16 294 314 X"FA0F", -- SD_ADDR_cc_R15_LO -- clock conditioner R15 bits 15...0 295 X"00 1D", -- SD_ADDR_coin_win_p -- majority coincidence window (for physics)296 X"00 1E", -- SD_ADDR_coin_win_c -- majority coincidence window (for calibration)315 X"0001", -- SD_ADDR_coin_win_p -- majority coincidence window (for physics), 8ns + 4x1ns = 12ns 316 X"0001", -- SD_ADDR_coin_win_c -- majority coincidence window (for calibration), 8ns + 4x1ns = 12ns 297 317 X"001F" -- -- Spare 298 318 ); … … 314 334 --default values for active FTU lists 315 335 constant sd_block_default_ftu_active_list : sd_block_default_ftu_active_list_type := ( 316 X"000 1",336 X"0000", 317 337 X"0000", 318 338 X"0000", … … 325 345 326 346 -- Timing counter 327 -- constant tc_width : integer := 48; -- width (number of bits) of timing counter 328 -- constant zero : unsigned (tc_width - 1 downto 0) := (others => '0'); 329 347 -- constant tc_width : integer := 48; -- width (number of bits) of timing counter 348 -- constant zero : unsigned (tc_width - 1 downto 0) := (others => '0'); 349 350 --====================================================================================== 351 -- Constants for calibration and pedestal triggers generation 352 --====================================================================================== 353 constant LOW_SPEED_CLOCK_FREQ : real := 50000000.0; 354 constant LOW_SPEED_CLOCK_PERIOD : real := 1.0/LOW_SPEED_CLOCK_FREQ; 355 constant MS_PERIOD : real := 0.001; 356 constant MAX_MS_COUNTER_WIDTH : integer := integer(ceil(log2(real(MS_PERIOD/LOW_SPEED_CLOCK_PERIOD)))); 357 constant MAX_MS_COUNTER_VAL : integer := integer(MS_PERIOD/LOW_SPEED_CLOCK_PERIOD); 358 --====================================================================================== 359 360 --====================================================================================== 361 -- Constants for trigger and TIM signals width (8ns+value*4ns) 362 --====================================================================================== 363 constant TRIG_SIGNAL_PULSE_WIDTH : integer range 0 to 15 := 10; 364 constant TIM_SIGNAL_PULSE_WIDTH : integer range 0 to 15 := 0; 365 --====================================================================================== 366 330 367 end ftm_constants;
Note:
See TracChangeset
for help on using the changeset viewer.