Belle II KLM Scint Firmware  1
conc_intfc_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 -- Package for Belle-II KLM SCROD Data Concentrator interface.
14 --
15 --*********************************************************************************
16 library ieee;
17  use ieee.std_logic_1164.all;
18  use ieee.numeric_std.all;
19 -- use ieee.std_logic_arith.all;
20 -- use ieee.std_logic_unsigned.all;
21  use ieee.math_real.all;
22 
23 
24 package conc_intfc_pkg is
25 
26  --------------------------------------------------------------------------
27  -- Constant declarations.
28  --------------------------------------------------------------------------
29  -- define number of TARGET channels used for TDC/trigger processing
30  constant ASIC_NUM_CHAN : integer range 1 to 15 := 15;
31  -- define number of config + status registers
32  constant NUM_SCROD_REGS : integer := 72;
33  -- define number of control registers
34  constant NUM_CTRL_REGS : integer := 2;
35  -- default axis bit value - defines the axis to be used by coincidence find
36  constant AXIS_BIT_VAL : std_logic := '0';
37  -- packet type counter width - sets time spent writing trigger data
38  constant PKTTP_CTRW : integer := 7;
39  constant TGPKT_CTRW : integer := 6;
40  constant STSPKT_CTRW : integer := INTEGER(CEIL(LOG2(REAL(NUM_SCROD_REGS))));
41 
42  constant TRG_SOF_VAL : std_logic_vector(15 downto 0) := X"FE11";
43  constant TRG_EOF_VAL : std_logic_vector(15 downto 0) := X"EFAA";
44  constant DAQ_SOF_VAL : std_logic_vector(15 downto 0) := X"FE88";
45  constant DAQ_EOF_VAL : std_logic_vector(15 downto 0) := X"EF55";
46  constant STS_SOF_VAL : std_logic_vector(15 downto 0) := X"FE66";
47  constant STS_EOF_VAL : std_logic_vector(15 downto 0) := X"EF99";
48 
49 -- constant intc : integer := INTEGER(CEIL(LOG2(REAL(SC_NUM_SCR))));
50 -- constant intc : integer := (2**(SC_SCR_BITS+1));
51 
52  --------------------------------------------------------------------------
53  -- Type declarations.
54  --------------------------------------------------------------------------
55  type stat_reg_type is array (0 to NUM_SCROD_REGS-1) of std_logic_vector(15 downto 0);
56  type ctrl_reg_type is array (0 to NUM_CTRL_REGS-1) of std_logic_vector(15 downto 0);
57 
58  type trigasic_bram_wr_data_type is array (1 to 10) of std_logic_vector(4 downto 0); -- trigger bits from
59 
60  type trigasic_bram_asic_rd_data_type is array (3 downto 0) of std_logic_vector(4 downto 0);
61  type trigasic_bram_rd_data_type is array (1 to 10) of trigasic_bram_asic_rd_data_type;
62 
63  --------------------------------------------------------------------------
64  -- Function declarations.
65  --------------------------------------------------------------------------
66 
67 
68 end conc_intfc_pkg;
69 
70 --------------------------------------------------------------------------
71 -- Package body
72 --------------------------------------------------------------------------
73 package body conc_intfc_pkg is
74 
75 
76 end conc_intfc_pkg;
77 
78