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

Back to eFEX documentation
TOB_synch.vhd
Go to the documentation of this file.
1 
8 
9 library IEEE;
10 use IEEE.STD_LOGIC_1164.all;
11 use IEEE.NUMERIC_STD.all;
12 
13 library work;
14 use work.DataTypes.all;
15 use work.AlgoDataTypes.all;
16 
18 entity TOB_synch is
19  port (
20  CLK : in std_logic;
21  IN_Offset0 : in std_logic_vector(5 downto 0);
22  IN_Offset1 : in std_logic_vector(5 downto 0);
23  IN_Offset2 : in std_logic_vector(5 downto 0);
24  IN_Offset3 : in std_logic_vector(5 downto 0);
25 
26  IN_BCN : in std_logic_vector(11 downto 0);
27  OUT_BCN : out std_logic_vector(11 downto 0);
28 
29  IN_Enable0 : in std_logic;
30  IN_Enable1 : in std_logic;
31  IN_Enable2 : in std_logic;
32  IN_Enable3 : in std_logic;
33 
34  IN_Start : in std_logic;
35  OUT_Start : out std_logic;
36 
37  IN_Data : in AlgoTriggerObjects(3 downto 0);
38  OUT_Data : out AlgoTriggerObjects(3 downto 0));
39 end TOB_synch;
40 
42 architecture Behavioral of TOB_synch is
43 
44  type array_of_trigger_objects is array(63 downto 0) of AlgoTriggerObjects(3 downto 0);
45  signal DelayedData : array_of_trigger_objects;
46  signal DelayedStart : std_logic_vector(63 downto 0);
47 
48  type BCN_t is array(63 downto 0) of std_logic_vector(11 downto 0);
49  signal DelayedBCN : BCN_t := (others => (others => '0'));
50 
51 
52 
53 begin
54 
55  DelayedData(0)(0) <= IN_Data(0) when IN_Enable0 = '1' else ZERO_ALGO_TRIGGER_OBJECT;
56  DelayedData(0)(1) <= IN_Data(1) when IN_Enable1 = '1' else ZERO_ALGO_TRIGGER_OBJECT;
57  DelayedData(0)(2) <= IN_Data(2) when IN_Enable2 = '1' else ZERO_ALGO_TRIGGER_OBJECT;
58  DelayedData(0)(3) <= IN_Data(3) when IN_Enable3 = '1' else ZERO_ALGO_TRIGGER_OBJECT;
59 
60  DelayedBCN(0) <= IN_BCN;
61 
62  DelayedStart(0) <= IN_Start;
63 
64  dalay_proc : process (CLK)
65  begin
66  if rising_edge(CLK) then
67  DelayedData(DelayedData'high-1 downto 1) <= DelayedData(DelayedData'high-2 downto 0);
68  DelayedStart(DelayedStart'high-1 downto 1) <= DelayedStart(DelayedStart'high-2 downto 0);
69  DelayedBCN(DelayedBCN'high-1 downto 1) <= DelayedBCN(DelayedBCN'high-2 downto 0);
70  end if;
71 
72  end process;
73 
74 
75  OUT_Data <= (DelayedData(to_integer(unsigned(IN_Offset3)))(3), DelayedData(to_integer(unsigned(IN_Offset2)))(2), DelayedData(to_integer(unsigned(IN_Offset1)))(1), DelayedData(to_integer(unsigned(IN_Offset0)))(0));
76  OUT_Start <= DelayedStart(to_integer(unsigned(IN_Offset0)));
77  OUT_BCN <= DelayedBCN(to_integer(unsigned(IN_Offset0)));
78 
79 end Behavioral;
External data-types and functions.
array(natural range <> ) of AlgoTriggerObject AlgoTriggerObjects
Algorithm OUTPUT port.
TOB synchronisation module.
Definition: TOB_synch.vhd:42
TOB synchronisation module.
Definition: TOB_synch.vhd:18