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

Back to eFEX documentation
TauSeedFinder.vhd
Go to the documentation of this file.
1 
12 
13 library IEEE;
14 use IEEE.STD_LOGIC_1164.all;
15 use IEEE.NUMERIC_STD.all;
16 
17 library work;
18 use work.DataTypes.all;
19 
21 entity TauSeedFinder is
22  port (
23  CLK : in std_logic;
24  IN_Central : in DataWord;
25  IN_Central_of : in std_logic;
26 
27  IN_Surrounding : in DataWords(7 downto 0);
28  IN_Surrounding_of : in std_logic_vector(7 downto 0);
29  OUT_IsMax : out std_logic);
30 end TauSeedFinder;
31 
32 architecture Behavioral of TauSeedFinder is
33 
34 signal half1, half2: std_logic;
36 begin
37 
39  process (CLK)
40  variable central : std_logic_vector(IN_Central'high downto 0);
41  variable surrounding0 : std_logic_vector(IN_Central'high downto 0);
42  variable surrounding1 : std_logic_vector(IN_Central'high downto 0);
43  variable surrounding2 : std_logic_vector(IN_Central'high downto 0);
44  variable surrounding3 : std_logic_vector(IN_Central'high downto 0);
45  variable surrounding4 : std_logic_vector(IN_Central'high downto 0);
46  variable surrounding5 : std_logic_vector(IN_Central'high downto 0);
47  variable surrounding6 : std_logic_vector(IN_Central'high downto 0);
48  variable surrounding7 : std_logic_vector(IN_Central'high downto 0);
49 
50  begin
51  if rising_edge(CLK) then
52  central := (others => '1') when IN_Central_of = '1' else IN_Central;
53  surrounding0 := (others => '1') when IN_Surrounding_of(0) = '1' else IN_Surrounding(0);
54  surrounding1 := (others => '1') when IN_Surrounding_of(1) = '1' else IN_Surrounding(1);
55  surrounding2 := (others => '1') when IN_Surrounding_of(2) = '1' else IN_Surrounding(2);
56  surrounding3 := (others => '1') when IN_Surrounding_of(3) = '1' else IN_Surrounding(3);
57  surrounding4 := (others => '1') when IN_Surrounding_of(4) = '1' else IN_Surrounding(4);
58  surrounding5 := (others => '1') when IN_Surrounding_of(5) = '1' else IN_Surrounding(5);
59  surrounding6 := (others => '1') when IN_Surrounding_of(6) = '1' else IN_Surrounding(6);
60  surrounding7 := (others => '1') when IN_Surrounding_of(7) = '1' else IN_Surrounding(7);
61 
62  -- first clock cycle
63  -- Up and right: strictly greater than
64 
65  half1 <= '1' when central > surrounding2 and central > surrounding3 and central > surrounding4 and central > surrounding5 else '0';
66 
67  -- Down and left: not smaller than
68  half2 <= '0' when central < surrounding0 or central < surrounding1 or central < surrounding6 or central < surrounding7 else '1';
69 
70  --second clock cycle
71  OUT_IsMax <= half1 and half2;
72  end if;
73  end process;
74 end Behavioral;
Seed Finder for the tau algorithm.
in IN_Central_of std_logic
Sum of TTs in CCW starting from bottom left corner.
in IN_Central DataWord
Sum of TTs in CCW starting from bottom left corner.