7 use IEEE.STD_LOGIC_UNSIGNED.
ALL;
8 use ieee.std_logic_1164.
all;
9 use ieee.numeric_std.
all;
18 LOCAL_CABLE_OUT :
out (
26*4 -1
downto 0);
22 force : in T_SL;
-- force
27 addr_vme : in (15 downto 0);
28 data_vme_in : in (15 downto 0);
29 data_vme_out : out (15 downto 0);
31 --data org 3 - OV res tyx, 3 - OV tyx, 3*15 E res tyx, 3*15 E tyx,
33 end crate_summing_module;
42 signal e_ov : (5 downto 0) := (others => '0');
56 -- data_in_l --should be organized on the input of the component (tyyxxtyyxx)
57 -- 0 - sum ex u; 1 - sum ex l, 2 - sum ey u, 3 - sum ey l, 4 - sum et,
58 -- 5 - res sum ex u; 6 - res sum ex l, 7 - res sum ey u, 8 - res sum ey l, 9- res sum et,
59 -- quad_rest - selects if the given input is restricter or upper/lower quadrant
60 -- (see cmx_sumet_pkg.vhd)
72 ia_vme => ADDR_REG_RW_SUMET_MASK,
89 ia_vme => ADDR_REG_RW_MISSET_MASK ,
104 RESHUFLLE_DATA: for i in 0 to 15 generate --i iterates over module
115 end generate RESHUFLLE_DATA;
117 GENERATE_ALL_SUMS : for j in 0 to 9 generate --j iterates over energy type as
119 GENERATE_E_ADDERS : for i in 0 to 7 generate --i iterates over modules
123 sum_e(j)(i) <= quad_rest(data_in_l(i*2+1)(j), BACKPLANE_MAP(i*2+1),
127 + quad_rest(data_in_l(i*2)(j) , BACKPLANE_MAP(i*2),
133 ADDER_STAGE_1: if i < 4 generate
138 end generate ADDER_STAGE_1;
140 ADDER_STAGE_2: if i < 2 generate
145 end generate ADDER_STAGE_2;
147 ADDER_STAGE_3: if i < 1 generate
152 end generate ADDER_STAGE_3;
154 end generate GENERATE_E_ADDERS;
155 end generate GENERATE_ALL_SUMS;
157 -- 0 -> Ex; 1 -> Ey; 2 -> ET; 3,4,5 as above but restricted
160 if rising_edge(CLK) then
169 -- parity error delay
175 GENERATE_OV : for i in 0 to 5 generate
176 generate_ov_signed: if i /=2 and i/=5 generate
179 -- if rising_edge(CLK) then
193 end process CHECK_E_OV_EXEY;
194 end generate generate_ov_signed;
195 generate_ov_sumET: if i=2 or i=5 generate
198 -- if rising_edge(CLK) then
206 --fifteen bits are assigned but the msb will be truncated anyway by the
207 --crate_cable_out function below
211 end process CHECK_E_OV_TE;
212 end generate generate_ov_sumET;
214 end generate GENERATE_OV;
219 LOCAL_CABLE_OUT <= crate_cable_out(energy_out);
222 end crate_summing_module;
arr_16 (1 downto 0) data_vme_out_local
in BACKPLANE_DATA_INenergy_array
std_logic_vector (15 downto 0) data_from_vme_REG_RW_SUMET_MASK
in addr_vmestd_logic_vector (15 downto 0)
std_logic_vector (15 downto 0) data_from_vme_REG_RW_MISSET_MASK
array (0 to 15 ) of unsigned (19 downto 0) total_sum_array
out data_from_vmestd_logic_vector (width - 1 downto 0)
array (0 to 15 ) of sum_array sum_array_array
total_sum_array total_sums
in data_vme_from_belowarr_16
--! inputs from local registers and from
std_logic_vector (1 downto 0) bus_drive_local
in data_vme_instd_logic_vector (15 downto 0)
CALC_SUM_E_0data_in_l,sum_e
out BCID_delayedstd_logic_vector (11 downto 0)
std_logic_vector (5 downto 0) :=( others =>'0' ) e_ov
std_logic_vector (15 downto 0) data_to_vme_REG_RW_MISSET_MASK
std_logic_vector (15 downto 0) data_to_vme_REG_RW_SUMET_MASK
std_logic_vector (95 downto 0) energy_out
in data_to_vmestd_logic_vector (width - 1 downto 0)
out data_vme_upstd_logic_vector (15 downto 0)
--! connect this to
array (0 to 15 ) of unsigned (19 downto 0) sum_array
sum_array_array :=( others =>( others =>( others =>'0' ) ) ) data_in_l
out bus_drive_upstd_logic
or of all bus drive requests from below
out data_vme_outstd_logic_vector (15 downto 0)
in BCID_instd_logic_vector (11 downto 0)
in bus_drive_from_belowstd_logic_vector