11 use IEEE.STD_LOGIC_1164.
all;
12 use IEEE.NUMERIC_STD.
all;
19 generic(ENCODING_MODE : integer);
20 port (CLK200 : in std_logic;
21 IN_Load : in std_logic;
23 IN_Position : in AlgoRegister;
24 IN_BCN : in std_logic_vector(11 downto 0);
26 IN_threshold_l0 : in AlgoWords(INPUT_COLUMNS-1 downto 0);
27 IN_threshold_l1 : in AlgoWords(INPUT_COLUMNS-1 downto 0);
28 IN_threshold_l2 : in AlgoWords(INPUT_COLUMNS-1 downto 0);
29 IN_threshold_l3 : in AlgoWords(INPUT_COLUMNS-1 downto 0);
30 IN_threshold_had_lar : in AlgoWords(INPUT_COLUMNS-1 downto 0);
31 IN_threshold_had_tile : in AlgoWords(INPUT_COLUMNS-1 downto 0);
33 OUT_Load : out std_logic;
34 OUT_BCN_200 : out std_logic_vector(11 downto 0);
35 OUT_Data : out TriggerTowerMatrix
42 signal OutData : TriggerTowerMatrix;
43 signal Load_i, Load_d : std_logic;
44 signal BCN_i, BCN_d, BCN_200 : std_logic_vector(11 downto 0);
46 signal had_position : std_logic_vector(2 downto 0);
47 signal is_tile : std_logic_vector(INPUT_ROWS*INPUT_COLUMNS-1 downto 0);
50 signal hadronic_threshold : array_std_logic_vector(INPUT_ROWS*INPUT_COLUMNS-1 downto 0)(INPUT_DATA_WIDTH-1 downto 0);
54 attribute keep : string;
55 attribute max_fanout : integer;
56 attribute keep of OUT_Load : signal is "true";
57 attribute max_fanout of OUT_Load : signal is 50;
64 had_position <= IN_Position(HADRONIC_POSITION_BIT_END downto HADRONIC_POSITION_BIT_START);
69 column_for : for i in 0 to INPUT_COLUMNS - 1 generate
70 row_for : for j in 0 to INPUT_ROWS - 1 generate
72 layer0_for : for k in 0 to LAYER0-1 generate
74 generic map (ENCODING_MODE => ENCODING_MODE
)
78 IN_threshold => IN_threshold_l0
(i
),
80 IN_Data => InData
(i
)(j
).Layer0
(k
),
81 OUT_Data => OutData
(i
)(j
).Layer0
(k
));
82 end generate layer0_for;
84 layer1_for : for k in 0 to LAYER1-1 generate
86 generic map (ENCODING_MODE => ENCODING_MODE
)
90 IN_threshold => IN_threshold_l1
(i
),
92 IN_Data => InData
(i
)(j
).Layer1
(k
),
93 OUT_Data => OutData
(i
)(j
).Layer1
(k
));
94 end generate layer1_for;
96 layer2_for : for k in 0 to LAYER2-1 generate
98 generic map (ENCODING_MODE => ENCODING_MODE
)
102 IN_threshold => IN_threshold_l2
(i
),
104 IN_Data => InData
(i
)(j
).Layer2
(k
),
105 OUT_Data => OutData
(i
)(j
).Layer2
(k
));
106 end generate layer2_for;
108 layer3_for : for k in 0 to LAYER3-1 generate
110 generic map (ENCODING_MODE => ENCODING_MODE
)
114 IN_threshold => IN_threshold_l3
(i
),
116 IN_Data => InData
(i
)(j
).Layer3
(k
),
117 OUT_Data => OutData
(i
)(j
).Layer3
(k
));
118 end generate layer3_for;
120 LAR_OR_TILE_IF : if i = 0 or i = 1 generate
122 is_tile(i*INPUT_ROWS+j) <= '0' when had_position = "001" or had_position = "011" or had_position = "100" else '1';
123 hadronic_threshold(i*INPUT_ROWS+j) <= IN_threshold_had_lar(i) when had_position = "001" or had_position = "011" or had_position = "100"
124 else IN_threshold_had_tile(i);
126 elsif i = 4 or i = 5 generate
128 is_tile(i*INPUT_ROWS+j) <= '0' when had_position = "010" or had_position = "011" or had_position = "100" else '1';
130 hadronic_threshold(i*INPUT_ROWS+j) <= IN_threshold_had_lar(i) when had_position = "010" or had_position = "011" or had_position = "100"
131 else IN_threshold_had_tile(i);
135 is_tile(i*INPUT_ROWS+j) <= '0' when had_position = "011" or had_position = "100" else '1';
137 hadronic_threshold(i*INPUT_ROWS+j) <= IN_threshold_had_lar(i) when had_position = "011" or had_position = "100"
138 else IN_threshold_had_tile(i);
144 generic map (ENCODING_MODE => ENCODING_MODE
)
147 is_hadronic => is_tile
(i*INPUT_ROWS+j
),
148 IN_threshold => hadronic_threshold
(i*INPUT_ROWS+j
),
150 IN_Data => InData
(i
)(j
).Hadron
(0),
151 OUT_Data => OutData
(i
)(j
).Hadron
(0));
153 end generate row_for;
154 end generate column_for;
160 if rising_edge(CLK200) then
168 if rising_edge(CLK200) then
178 OUT_BCN_200 <= BCN_d;
External data-types and functions.
array(natural range <> ) of AlgoWord AlgoWords
External arra of AlgoWord.
( INPUT_COLUMNS- 1 downto 0) AlgoColumn AlgoInput
Algorithm INPUT port.