Ignore:
Timestamp:
04/13/11 15:02:49 (10 years ago)
Author:
weitzel
Message:
FTM trigger manager from MCSE added; DCM arrangement changed; changes in FTM ethernet module
File:
1 edited

Legend:

Unmodified
Added
Removed
  • firmware/FTM/ftm_definitions.vhd

    r10328 r10366  
    2929-- kw 03.03.: added FTM_HEADER_LENGTH
    3030--
     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--
    3138----------------------------------------------------------------------------------
    3239
     
    7279use ftm_definitions.ftm_array_types.all;
    7380use IEEE.NUMERIC_STD.ALL;
     81use ieee.math_real.all;
    7482
    7583package ftm_constants is
     
    191199  -- ping all FTUs
    192200  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
    193205
    194206  -- header length of data packages
    195207  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
    196211 
    197212  -- FTU-list parameters
     
    249264  constant SD_ADDR_coin_win_p       : std_logic_vector := X"01D";
    250265  constant SD_ADDR_coin_win_c       : std_logic_vector := X"01E";
     266  constant SD_ADDR_ftu_prescaling_0 : std_logic_vector := X"029";
    251267  constant SD_ADDR_ftu_active_cr0   : std_logic_vector := X"1B0";
    252268  constant SD_ADDR_ftu_active_cr1   : std_logic_vector := X"1B1";
     
    264280  -- !!! to be defined !!!
    265281  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
    267284      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
    270289      X"0004", -- SD_ADDR_lp1_amplitude     -- light pulser 1 amplitude
    271290      X"0005", -- SD_ADDR_lp2_amplitude     -- light pulser 2 amplitude
    272291      X"0006", -- SD_ADDR_lp1_delay         -- light pulser 1 delay
    273292      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
    279299      X"0003", -- SD_ADDR_cc_R0_HI          -- clock conditioner R0 bits 31...16
    280300      X"8000", -- SD_ADDR_cc_R0_LO          -- clock conditioner R0 bits 15...0
     
    293313      X"1400", -- SD_ADDR_cc_R15_HI         -- clock conditioner R15 bits 31...16
    294314      X"FA0F", -- SD_ADDR_cc_R15_LO         -- clock conditioner R15 bits 15...0
    295       X"001D", -- SD_ADDR_coin_win_p        -- majority coincidence window (for physics)
    296       X"001E", -- 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
    297317      X"001F"  --                           -- Spare
    298318  );
     
    314334  --default values for active FTU lists
    315335  constant sd_block_default_ftu_active_list : sd_block_default_ftu_active_list_type := (
    316     X"0001",
     336    X"0000",
    317337    X"0000",
    318338    X"0000",
     
    325345
    326346  -- 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 
    330367end ftm_constants;
Note: See TracChangeset for help on using the changeset viewer.