13 use IEEE.STD_LOGIC_1164.
all;
14 use IEEE.NUMERIC_STD.
all;
23 EG_ALGO_VERSION : std_logic_vector(1 downto 0) := "00";
24 TAU_ALGO_VERSION : std_logic_vector(1 downto 0) := "00"
26 port (CLK200 : in std_logic;
28 IN_Load : in std_logic;
29 IN_Data : in TriggerTowerMatrix;
32 OUT_ParameterRAMaddress : out std_logic_vector(2 downto 0);
50 IN_ParDeadMat_b1 : in AlgoParameter;
51 IN_ParDeadMat_b2 : in AlgoParameter;
52 IN_ParDeadMat_b3 : in AlgoParameter;
59 IN_tau_ParFrac : in AlgoParameters(2 downto 0);
61 IN_tau_Control : in AlgoRegister;
70 OUT_tau_Status : out AlgoRegister;
75 IN_glob_Control : in AlgoRegister := (others => '0');
76 OUT_glob_Status : out AlgoRegister;
79 OUT_TOB_Start : out std_logic;
80 OUT_TOB_Counter : out std_logic_vector(2 downto 0);
83 OUT_eg_TOB : out TriggerObjects_eg(OUTPUT_TOBS-1 downto 0);
86 OUT_tau_TOB : out TriggerObjects_tau(OUTPUT_TOBS-1 downto 0));
93 signal OutEgTOB : TriggerObjects_eg(OUTPUT_TOBS-1 downto 0);
95 signal OutTauTOB : TriggerObjects_tau(OUTPUT_TOBS-1 downto 0);
98 signal SR_InData : TriggerTowerMatrix;
99 signal SR_Load : std_logic;
100 signal SR_LeftRight, SR_Edge : std_logic;
101 signal SR_OutData : TriggerTowers(29 downto 0);
105 signal eg_ParWs : AlgoParameters(2 downto 0);
106 signal eg_ParReta : AlgoParameters(2 downto 0);
107 signal eg_ParHadron : AlgoParameters(2 downto 0);
108 signal eg_Control : AlgoRegister;
109 signal eg_Status : AlgoRegister;
111 signal eg_Data : TriggerTowersArray(7 downto 0)(8 downto 0);
112 signal eg_TOB : TriggerObjects_eg(7 downto 0);
115 signal tau_ParJet : AlgoParameters(2 downto 0);
116 signal tau_ParFrac : AlgoParameters(2 downto 0);
118 signal tau_Control : AlgoRegister;
119 signal tau_Status : AlgoRegister;
121 signal tau_Data : TriggerTowersArray(7 downto 0)(8 downto 0);
122 signal tau_TOB : TriggerObjects_tau(7 downto 0);
124 signal RAMCounter : std_logic_vector(2 downto 0) := (others => '0');
125 signal InputCounter : std_logic_vector(2 downto 0) := (others => '0');
126 signal OutputCounter : std_logic_vector(2 downto 0) := (others => '0');
127 signal OutputValid : std_logic;
130 attribute keep : string ;
131 attribute max_fanout : integer;
132 attribute keep of OutputValid : signal is "true" ;
133 attribute max_fanout of OutputValid : signal is 80;
137 OUT_tau_Status <= x"a0007a00";
138 OUT_glob_Status <= x"a0008100";
142 eg_ParReta <= IN_eg_ParReta;
146 tau_parFrac <= IN_tau_ParFrac;
148 tau_Control <= IN_tau_Control;
156 COUNTERS :
process (clk200)
158 if rising_edge(clk200) then
159 if IN_Load = '1' then
161 InputCounter <= "001";
163 OutputCounter <= "011";
166 if InputCounter = "100" then
167 InputCounter <= "000";
169 InputCounter <= std_logic_vector(unsigned(InputCounter) + 1);
172 if RAMCounter = "100" then
175 RAMCounter <= std_logic_vector(unsigned(RAMCounter) + 1);
178 if OutputCounter = "100" then
179 OutputCounter <= "000";
181 OutputCounter <= std_logic_vector(unsigned(OutputCounter) + 1);
187 OUTPUT_SIGNALS_PROCESS :
process (clk200)
189 if rising_edge(clk200) then
190 if OutputCounter = "100" then
191 OUT_TOB_Start <= '1';
193 OUT_TOB_Start <= '0';
197 if OutputCounter = "011" and SR_Edge = '0' then
206 OUT_TOB_Counter <= OutputCounter;
207 OUT_ParameterRAMaddress <= RAMCounter;
209 SR_InData <= IN_Data;
222 ALGO_GENERATION : for i in 0 to 7 generate
224 eg_Data(i) <= (6 => SR_OutData(i+02), 7 => SR_OutData(i+12), 8 => SR_OutData(i+22),
225 3 => SR_OutData(i+01), 4 => SR_OutData(i+11), 5 => SR_OutData(i+21),
226 0 => SR_OutData(i+00), 1 => SR_OutData(i+10), 2 => SR_OutData(i+20));
230 EG_ALGO_VERSION => EG_ALGO_VERSION
)
233 IN_ParWs => eg_ParWs,
234 IN_ParReta => eg_ParReta,
235 IN_ParHadron => eg_ParHadron,
238 IN_Cond_threshold => IN_eg_cond_threshold,
241 IN_ParDeadMat_b1 => IN_ParDeadMat_b1,
242 IN_ParDeadMat_b2 => IN_ParDeadMat_b2,
243 IN_ParDeadMat_b3 => IN_ParDeadMat_b3,
245 IN_Data => eg_Data
(i
),
246 OUT_TOB => eg_TOB
(i
));
249 tau_Data(i) <= (6 => SR_OutData(i+02), 7 => SR_OutData(i+12), 8 => SR_OutData(i+22),
250 3 => SR_OutData(i+01), 4 => SR_OutData(i+11), 5 => SR_OutData(i+21),
251 0 => SR_OutData(i+00), 1 => SR_OutData(i+10), 2 => SR_OutData(i+20));
254 TAU_ALGO: if TAU_ALGO_VERSION = "01" or TAU_ALGO_VERSION = "10" generate
257 TAU_ALGO_VERSION => TAU_ALGO_VERSION
)
260 IN_ParBDT => tau_ParJet,
261 IN_ParFrac => tau_ParFrac,
264 IN_Max_cond_E_threshold => IN_tau_cond_threshold,
265 IN_Data => tau_Data
(i
),
266 OUT_TOB => tau_TOB
(i
));
271 IN_ParJet => tau_ParJet,
272 IN_ParFrac => tau_ParFrac,
274 IN_Cond_threshold => IN_tau_cond_threshold,
275 IN_Data => tau_Data
(i
),
276 OUT_TOB => tau_TOB
(i
));
278 end generate ALGO_GENERATION;
282 EG_OUT_FOR : for i in 0 to OUT_eg_TOB'high generate
283 OUT_eg_TOB(i).Position <= eg_TOB(i).Position;
284 OUT_eg_TOB(i).Core <= eg_TOB(i).Core when OutputValid = '1' else invalidate_core(eg_TOB(i).Core);
287 TAU_OUT_FOR : for i in 0 to OUT_tau_TOB'high generate
288 OUT_tau_TOB(i).Position <= tau_TOB(i).position;
289 OUT_tau_TOB(i).Core <= tau_TOB(i).Core when OutputValid = '1' else invalidate_core(tau_TOB(i).Core);
Core of the electromagnetic algorithm.
in IN_ParDeadMat_b0 AlgoParameter
enable bit mask for material correction
Core of the electromagnetic algorithm.
Core of the electromagnetic algorithm.
External data-types and functions.
Algorithm input-data shift register.
in CLK200 std_logic
200 MHz clock
in IN_Edge std_logic
Signal indicating if eFEX is on edge position.
in IN_Load std_logic
In load signal, synch with data arrival.
in IN_LeftRight std_logic
Signal indicating if eFEX module position.
in IN_Data TriggerTowerMatrix
All TT input data defined in DataTypes.vhd.
out OUT_Data TriggerTowers( 3* INPUT_ROWS- 1 downto 0)
Output data to be fed to algorithm logic (3 columns)
Top feature-extracting algorithm module.
Top feature-extracting algorithm module.
in IN_tau_Cond_threshold DataWord
Energy threshold for Jet and Frac condition;.
in IN_eg_ParREta AlgoParameters( 2 downto 0)
Thresholds for specific condition taken from parameter RAM.
in IN_eg_Cond_threshold DataWord
Energy threshold for Reta, Wstot and Had conditions;.
in IN_tau_ParJet AlgoParameters( 2 downto 0)
Thresholds for specific condition taken from parameter RAM.
in IN_eg_ParHadron AlgoParameters( 2 downto 0)
Thresholds for specific condition taken from parameter RAM.
in IN_ParDeadMat_b0 AlgoParameter
enable bit mask for dead material correction
in IN_eg_Control AlgoRegister
Control register for eg algorithm.
in IN_tau_BDT_min_energy_threshold DataWord
Min. energy threshold for tau BDT condition;.
in IN_eg_Energy_threshold DataWord
Energy threshold for TOB production;.
in IN_glob_Position AlgoRegister :=( others => '0')
out OUT_eg_Status AlgoRegister
Status register for eg algorithm.
in IN_eg_ParWs AlgoParameters( 2 downto 0)
Thresholds for specific condition taken from parameter RAM.
in IN_tau_Energy_threshold DataWord