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

Back to eFEX documentation
SIPO_TOPO_TOBs_unit.vhd
Go to the documentation of this file.
1 
9 
10 
11 library IEEE;
12 use IEEE.STD_LOGIC_1164.ALL;
13 
14 library TOB_rdout_lib;
15 use TOB_rdout_lib.TOB_rdout_ip_pkg.ALL;
16 use TOB_rdout_lib.data_type_pkg.all;
17 
18 library Infrastructure_lib;
19 
22  Port (
24  clk_in_280M : in STD_LOGIC;
26  TOBs_in : in STD_LOGIC_VECTOR (31 downto 0);
28  TOBs_sync_in : in STD_LOGIC;
30  TOB_valid_flg_in : in STD_LOGIC;
32  ALGO_TOB_BCN_in : in std_logic_vector(6 downto 0);
34  TOPO_TOB_out : out STD_LOGIC_VECTOR (191 downto 0);
36  TOPO_TOB_sync_out : out STD_LOGIC;
38  TOPO_TOB_valid_out : out STD_LOGIC_VECTOR (5 downto 0);
40  ALGO_TOB_BCN_out : out std_logic_vector(6 downto 0)
41  );
43 
45 architecture Behavioral of SIPO_TOPO_TOBs_unit is
46 
47  signal reg_1_tmp : std_logic_vector(31 downto 0); -- 32b sorted TOB
48  signal reg_2_tmp : std_logic_vector(31 downto 0);
49  signal reg_3_tmp : std_logic_vector(31 downto 0);
50  signal reg_4_tmp : std_logic_vector(31 downto 0);
51  signal reg_5_tmp : std_logic_vector(31 downto 0);
52  signal reg_6_tmp : std_logic_vector(31 downto 0);
53 
54  signal sync_1_tmp : std_logic;
55  signal sync_2_tmp : std_logic;
56  signal sync_3_tmp : std_logic;
57  signal sync_4_tmp : std_logic;
58  signal sync_5_tmp : std_logic;
59  signal sync_6_tmp : std_logic;
60 
61  signal wr_1_tmp : std_logic;
62  signal wr_2_tmp : std_logic;
63  signal wr_3_tmp : std_logic;
64  signal wr_4_tmp : std_logic;
65  signal wr_5_tmp : std_logic;
66  signal wr_6_tmp : std_logic;
67 
68 begin
69 
70 -- This module delays the BCN to match the delay of the TOBs Data through this block.
71 
72 U3_TOB_BCN_Delay : entity Infrastructure_lib.GeneralDelay
73  generic map (
74  delay => 5, --generates delay of 5 + 1 clocks
75  size => 7)
76  port map (
77  clk => clk_in_280M,
78  data_in => ALGO_TOB_BCN_in,
79  data_out => ALGO_TOB_BCN_out);
80 
81 U1_proc : process (clk_in_280M)
82  begin
83  if(clk_in_280M'event and clk_in_280M = '1') then
84 -- sync_7_tmp <= TOBs_sync_in; -- register input sync data
85  sync_6_tmp <= TOBs_sync_in;
86  sync_5_tmp <= sync_6_tmp;
87  sync_4_tmp <= sync_5_tmp;
88  sync_3_tmp <= sync_4_tmp;
89  sync_2_tmp <= sync_3_tmp;
90  sync_1_tmp <= sync_2_tmp;
91 
92 -- reg_7_tmp <= TOBs_in ; -- register input data
93  reg_6_tmp <= TOBs_in;
94  reg_5_tmp <= reg_6_tmp;
95  reg_4_tmp <= reg_5_tmp;
96  reg_3_tmp <= reg_4_tmp;
97  reg_2_tmp <= reg_3_tmp;
98  reg_1_tmp <= reg_2_tmp;
99 
100 -- wr_7_tmp <= TOB_valid_flg_in ; -- register input data valid
101  wr_6_tmp <= TOB_valid_flg_in;
102  wr_5_tmp <= wr_6_tmp;
103  wr_4_tmp <= wr_5_tmp;
104  wr_3_tmp <= wr_4_tmp;
105  wr_2_tmp <= wr_3_tmp;
106  wr_1_tmp <= wr_2_tmp;
107 
108 -- link_err_4b_out <= link_err_4b_in;
109 
110  end if;
111  end process U1_proc;
112 
113  -- need only 6 TOBs, ignore 7th TOB value
114  TOPO_TOB_out <= reg_6_tmp & reg_5_tmp & reg_4_tmp & reg_3_tmp & reg_2_tmp & reg_1_tmp;
115  TOPO_TOB_valid_out <= wr_6_tmp & wr_5_tmp & wr_4_tmp & wr_3_tmp & wr_2_tmp & wr_1_tmp;
116  TOPO_TOB_sync_out <= sync_1_tmp;
117 
118 --U1_ila_TOB_sorting : ila_ipbus_fabric_rd_wr
119 --PORT MAP (
120 -- clk => clk_in_280M ,
121 -- probe0(31 downto 0) => TOBs_in , -- 36b
122 -- probe0(35 downto 32) => (others => '0' ) , -- 36b
123 -- probe1 => (others => '0' ) , -- 36b
124 -- probe2(0) => TOBs_sync_in , -- 1b
125 -- probe3(0) => TOB_valid_flg_in, -- 1b
126 -- probe4 => (others => '0' ), -- 1b
127 -- probe5(31 downto 0) => reg_6_tmp, --36b
128 -- probe5(35 downto 32) => (others => '0' ), --36b
129 -- probe6(5 downto 0) => TOPO_TOB_valid_out, -- 36b
130 -- probe6(35 downto 6) => (others => '0' ), -- 36b
131 -- probe7 => (others => '0' ), -- 1b
132 -- probe8 => (others => '0' ) , -- 1b
133 -- probe9(0) => TOPO_TOB_sync_out -- 1b
134 --);
135 
136 end Behavioral;
Shift register for data delay.
SIPO Sorting TOBs for process FPGA.
SIPO Sorting TOBs for process FPGA.
in TOBs_sync_in STD_LOGIC
TOB synch signal - indicating the start of the 7 TOB data words.
in TOBs_in STD_LOGIC_VECTOR( 31 downto 0)
32b sorted TOB in - 7 x 32b words in series
out ALGO_TOB_BCN_out std_logic_vector( 6 downto 0)
sorted TOB BCN with delay to match the delay on the TOBs through this block
out TOPO_TOB_valid_out STD_LOGIC_VECTOR( 5 downto 0)
6b sorted TOBs valid (ignore 7th TOB)
out TOPO_TOB_out STD_LOGIC_VECTOR( 191 downto 0)
6 * 32b sorted TOBs = 192b (ignore 7th TOB)
out TOPO_TOB_sync_out STD_LOGIC
1b sorted TOBs synch signal output
in TOB_valid_flg_in STD_LOGIC
1b valid signal - 7 x 1b valid in series
in clk_in_280M STD_LOGIC
280Mhz input signal
in ALGO_TOB_BCN_in std_logic_vector( 6 downto 0)
sorted TOB BCN with delay through ALGO/sorting block