eFEX firmware  1.7.3
ATLAS l1-calo - electron and tau feature extraction firmware for eFEX boards

Back to eFEX documentation
fibremap_block.vhd
Go to the documentation of this file.
1 
9 
10 library IEEE;
11 use IEEE.STD_LOGIC_1164.all;
12 use IEEE.NUMERIC_STD.all;
13 library algolib;
14 use algolib.AlgoDataTypes.all;
15 use work.synch_type.all;
16 use work.EfexDataFormats.all;
17 library TOB_rdout_lib;
18 use TOB_rdout_lib.TOB_rdout_ip_pkg.all;
19 use TOB_rdout_lib.data_type_pkg.all;
20 
22 entity fibremap_block is
23  generic(FPGA_NUMBER : integer);
24 
25  port(
27  eFEXPosition_in : in std_logic_vector(31 downto 0);
29  MGT_data_in : in mgt_data_out;
31  RAW_data_out : out RAW_data_227_type;
33  DataToAlg_out : out Algoinput
34  );
35 end fibremap_block;
36 
38 architecture struct of fibremap_block is
39 
40  -- The following are 3-dimensional arrays that hold the data from the MGTs,
41  -- organised into eta and phi space, but still grouped into fibres.
42  signal EmSyncIn : FibreAllEm;
43  signal EmSyncOut : FibreAllEm;
44  signal HadSyncIn : FibreAllHad;
45  signal HadSyncOut : FibreAllHad;
46  signal SpareSyncIn : FibreAllSpare;
47  signal SpareSyncOut : FibreAllSpare;
48 
49  signal fpga_number_sig : integer;
50 
51  ----------------------------------------------------------------------------------------------------
52 begin
53  fpga_number_sig <= FPGA_NUMBER;
54 
55  -- Organise data from MGTs using this procedure:
56  FibreArrayBuilder(
57  fpga_number_sig,
58  -- Inputs:
60  -- Outputs:
61  EmSyncIn,
62  HadSyncIn,
63  SpareSyncIn
64  );
65 
66  RAW_data_out <= to_raw_data(EmSyncIn, HadSyncIn);
67 
68  -- Em data:
69  gen_Em_eta : for x in 0 to NUM_FIB_Em_ETA - 1 generate
70  gen_Em_phi : for y in 0 to NUM_FIB_Em_PHI - 1 generate
71  Emsync : entity work.RegSyncLogic
72  port map(DataIn => EmSyncIn(x)(y), DataOut => EmSyncOut(x)(y));
73  end generate gen_Em_phi;
74  end generate gen_Em_eta;
75 
76  -- Had data:
77  gen_Had_eta : for x in 0 to NUM_FIB_Had_ETA - 1 generate
78  gen_Had_phi : for y in 0 to NUM_FIB_Had_PHI - 1 generate
79  Hadsync : entity work.RegSyncLogic
80  port map(DataIn => HadSyncIn(x)(y), DataOut => HadSyncOut(x)(y));
81  end generate gen_Had_phi;
82  end generate gen_Had_eta;
83 
84  -- Spare data:
85  gen_spare : for x in 0 to NUM_FIB_SPARE - 1 generate
86  sparesync : entity work.RegSyncLogic
87  port map(DataIn => SpareSyncIn(x), DataOut => SpareSyncOut(x));
88  end generate gen_spare;
89 
90  -- Re-map output of sync logic into format expected by algorithm logic:
91  DataToAlg_out <= AlgoTowerBuilder(EmSyncOut, HadSyncOut, SpareSyncOut, eFEXPosition_in);
92 
93 end struct;
External data-types and functions.
eFEX data-types and functions
regsynch logic
in DataIn std_logic_vector( 227 downto 0)
data in
out DataOut std_logic_vector( 227 downto 0)
data out
eFEX Fibre mapping module
eFEX Fibre mapping module
out DataToAlg_out Algoinput
output to algorithm block
in MGT_data_in mgt_data_out
data in from MGT
in eFEXPosition_in std_logic_vector( 31 downto 0)
Geographical position of eFEX module for dynamic mapping.
out RAW_data_out RAW_data_227_type
datata out to readout block