Belle II KLM Scint Firmware  1
klm_scrod_pkg.vhd
1 --*********************************************************************************
2 -- Indiana University
3 -- Center for Exploration of Energy and Matter (CEEM)
4 --
5 -- Project: Belle-II
6 --
7 -- Author: Brandon Kunkler
8 --
9 -- Date: 06/04/2014
10 --
11 --*********************************************************************************
12 -- Description:
13 --
14 -- Package for KLM SCROD high level constants and functions.
15 --
16 --*********************************************************************************
17 library ieee;
18  use ieee.std_logic_1164.all;
19 library work;
20  use work.b2tt_symbols.all;
21 
22 package klm_scrod_pkg is
23  --------------------------------------------------------------------------
24  -- Constant declarations.
25  --------------------------------------------------------------------------
26  constant B2TT_SUBSYSTEM : std_logic_vector (3 downto 0) := TTFEE_KLM;
27  constant B2TT_FWTYPE : integer := 15;
28  constant B2TT_VERSION : integer := 9;
29  constant B2TT_B2TT_VER : integer := 52;
30  constant B2TT_PROTOCOL : integer := 30;
31  constant B2TT_COMPAT : integer := 29; -- for transition to new protocol
32  constant B2TT_DEFADDR : std_logic_vector (19 downto 0) := x"00000";
33  constant B2TT_FLIPCLK : std_logic := '0'; -- no more used
34  constant B2TT_FLIPTRG : std_logic := '0';
35  constant B2TT_FLIPACK : std_logic := '0';
36  constant B2TT_USEFIFO : std_logic := '1';
37  constant B2TT_CLKDIV1 : integer range 1 to 72 := 2;
38  constant B2TT_CLKDIV2 : integer range 1 to 72 := 4;
39  constant B2TT_USEPLL : std_logic := '1';
40  constant B2TT_USEICTRL : std_logic := '1';
41  constant B2TT_NBITTIM : integer range 1 to 32 := 32;
42  constant B2TT_NBITTAG : integer range 4 to 32 := 32;
43  constant B2TT_NBITID : integer range 4 to 32 := 16;
44  constant B2TT_B2LRATE : integer := 4; -- 127 Mbyte / s
45  constant B2TT_USEEXTCLK : std_logic := '0';
46  constant B2TT_USE254IN : std_logic := '0'; -- 254 MHz clock in for DHH
47 
48  type Aurora_Status_t is record
49  gtlock : std_logic;
50  hard_err : std_logic;
51  soft_err : std_logic;
52  frame_err : std_logic;
53  channel_up : std_logic;
54  lane_up : std_logic;
55  warn_cc : std_logic;
56  do_cc : std_logic;
57  end record;
58 
59  type SFP_Status_t is record
60  fault_flag : std_logic;
61  los_flag : std_logic;
62  mod_flag : std_logic;
63  end record;
64 
65 end klm_scrod_pkg;
66 
67 package body klm_scrod_pkg is
68 
69 end klm_scrod_pkg;