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

Back to eFEX documentation
LittleSeedFinder.vhd
Go to the documentation of this file.
1 
7 
8 library IEEE;
9 use IEEE.STD_LOGIC_1164.all;
10 use IEEE.NUMERIC_STD.all;
11 
12 library work;
13 use work.DataTypes.all;
14 
17  port (
18  CLK : in std_logic;
19  IN_Data : in DataWords(3 downto 0);
20  IN_DataUp : in DataWords(3 downto 0);
21  IN_DataDown : in DataWords(3 downto 0);
22  OUT_UpNotDown : out std_logic; --1 => up, 0 => down
23  OUT_Seed : out std_logic_vector(1 downto 0)
24  );
25 
27 
28 architecture Behavioral of LittleSeedFinder is
29 
30  signal Seed : std_logic_vector(1 downto 0);
31  signal UpOrDown : std_logic_vector(3 downto 0);
32 
34 begin
35 
36  process (CLK)
37  begin
38  if rising_edge(CLK) then
39  -- first clock cycle
40  if (IN_Data(0) > IN_Data(1)) and (IN_Data(0) > IN_Data(2)) and (IN_Data(0) > IN_Data(3)) then
41  Seed <= "00";
42  elsif (IN_Data(1) > IN_Data(2)) and (IN_Data(1) > IN_Data(3)) then
43  Seed <= "01";
44  elsif (IN_Data(2) > IN_Data(3)) and (not (IN_Data(2) < IN_Data(0))) then
45  Seed <= "10";
46  else
47  Seed <= "11";
48  end if;
49 
50  UpOrDown(0) <= '0' when IN_DataDown(0) > IN_DataUp(0) else '1';
51  UpOrDown(1) <= '0' when IN_DataDown(1) > IN_DataUp(1) else '1';
52  UpOrDown(2) <= '0' when IN_DataDown(2) > IN_DataUp(2) else '1';
53  UpOrDown(3) <= '0' when IN_DataDown(3) > IN_DataUp(3) else '1';
54 
55  -- second clock cycle
56  OUT_UpNotDown <= UpOrDown(to_integer(unsigned(Seed)));
57  OUT_Seed <= Seed;
58  end if;
59  end process;
60 
61 end Behavioral;
Little Seed Finder for the tau algorithm.