------------------------------------------------------------------------------- -- Title : Package: GTU Signal Types -- Project : Prototype implementation of the GTU of the Alice TRD Experiment ------------------------------------------------------------------------------- -- File : gtu_types.vhd -- Author : Jan de Cuveland -- Company : -- Last update: 2004/04/27 -- Platform : ------------------------------------------------------------------------------- -- This is a prototype implementation of the Global Tracking Unit (GTU) -- of the Alice TRD detector. ------------------------------------------------------------------------------- -- Description: ------------------------------------------------------------------------------- -- Revisions : -- Date Version Author Description -- 2003/02/04 1.0 cuveland Created ------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; ------------------------------------------------------------------------------- package gtu_types is -- *** BEGIN: Definition of link data word *** -- PID Signature constant pid_width : integer := 8; constant pid_offset : integer := 24; -- Z Position (padrow number) constant zpos_width : integer := 4; constant zpos_offset : integer := 20; -- Deflection length constant deflen_width : integer := 7; constant deflen_offset : integer := 13; constant deflen_resolution : real := 140.0E-6; -- [m] -- Y Position constant ypos_width : integer := 13; constant ypos_offset : integer := 0; constant ypos_resolution : real := 160.0E-6; -- [m] -- end markers constant link_end_word : std_logic_vector(15 downto 0) := "0001000000000000"; constant link_end_mask : std_logic_vector(15 downto 0) := "0001111111000000"; -- *** END: Definition of link data word *** -- *** BEGIN: May be changed *** constant proj_ypos_bit_decrease : integer := 3; constant approx_ypos_bit_decrease : integer := 3; -- Projected Y position window [m] constant proj_ypos_window_real : real := 0.011625; -- Deflection angle window [rad] constant deflang_window_real : real := 0.05; -- *** END: May be changed *** -- detector geometry type real_t6 is array (0 to 5) of real; constant radius : real_t6 := (2.988, 3.114, 3.240, 3.366, 3.492, 3.618); -- [m] constant rmid : real := 3.333; -- [m] constant thickness : real := 0.03; -- [m] constant addr_width : integer := 6; constant idx_width : integer := 3; constant proj_ypos_width : integer := ypos_width - proj_ypos_bit_decrease; constant proj_ypos_resolution : real := ypos_resolution * real(2 ** proj_ypos_bit_decrease); constant deflang_width : integer := deflen_width; constant deflang_resolution : real := deflen_resolution / thickness; constant proj_ypos_window : signed(proj_ypos_width-1 downto 0) := conv_signed(integer(proj_ypos_window_real / proj_ypos_resolution), proj_ypos_width); -- e.g. 9 constant deflang_window : signed(deflang_width-1 downto 0) := conv_signed(integer(deflang_window_real / deflang_resolution), deflang_width); -- e.g. 11 constant approx_ypos_width : integer := proj_ypos_width - approx_ypos_bit_decrease; constant pt_width : integer := 16; -- fixed point "9.7" [GeV] -- internal end marker constant proj_ypos_end : signed(proj_ypos_width-1 downto 0) := "0111111111"; function is_end_word (signal word : std_logic_vector) return boolean; end gtu_types; package body gtu_types is function is_end_word ( signal word : std_logic_vector) return boolean is begin return (word(15 downto 0) and link_end_mask) = (link_end_word and link_end_mask); end is_end_word; end gtu_types;