8 use ieee.std_logic_1164.
all;
9 use ieee.numeric_std.
all;
24 MISS_E_THR : in arr_ctr_31bit(num_thresholds-1 downto 0);
26 SUM_ET_THR : in arr_ctr_15bit(num_thresholds-1 downto 0);
28 XS_T2_A2 : in arr_ctr_31bit(num_thresholds-1 downto 0);
34 XS_B2 : in arr_ctr_15bit(num_thresholds-1 downto 0);
40 force : in T_SL;
-- force
46 addr_vme : in (15 downto 0);
47 data_vme_in : in (15 downto 0);
48 data_vme_out : out (15 downto 0);
51 end system_summing_module;
57 signal ov_all : (5 downto 0) := (others => '0');
69 signal TE_res_local : (max_bits_TE-1-1 downto 0);
--the partial sums
108 signal EX_total : (max_bits_ExEy downto 0);
--one bit over, will be trimmed...
114 signal EX_res_total : (max_bits_ExEy downto 0);
--one bit over, will be trimmed...
148 signal EX2 : (max_bits_ExEy*2 -1 downto 0);
149 signal EY2 : (max_bits_ExEy*2 -1 downto 0);
151 signal EX2_res : (max_bits_ExEy*2 -1 downto 0);
152 signal EY2_res : (max_bits_ExEy*2 -1 downto 0);
164 --the missing energy squared
165 signal XE2 : (max_bits_XE2-1 downto 0);
168 signal s_XE2 : (max_bits_XE2 downto 0);
170 signal T2_A2_B2 : arr_ctr_46bit(num_thresholds-1 downto 0);
171 signal T4_A4 : arr_ctr_62bit(num_thresholds-1 downto 0);
172 signal T4_A4_B2 : arr_ctr_77bit(num_thresholds-1 downto 0);
180 signal T2_A2_TE : arr_ctr_47bit(num_thresholds-1 downto 0);
191 --criterion signal missing ET
192 signal c_XE : (num_thresholds-1 downto 0);
195 --register to align with TE and XS
196 signal c_XE_r : (num_thresholds-1 downto 0);
201 --delayed parity error flag to sync with the logic
211 --criterion for sum ET
212 signal c_TE : (num_thresholds-1 downto 0);
215 --register to align with missing ET and XS
216 signal c_TE_r : (num_thresholds-1 downto 0);
227 --criterion signals for missing energy significance
228 signal c_XS_0 : (num_thresholds-1 downto 0);
229 signal c_XS_1 : (num_thresholds-1 downto 0);
230 signal c_XS_2 : (num_thresholds-1 downto 0);
231 signal c_XS_3 : (num_thresholds-1 downto 0);
255 constant gnd32: (31 downto 0):=x"00000000";
256 constant ones32: (31 downto 0):=x"FFFFFFFF";
275 --energy_crate_delayed <= ENERGY_CRATE;
277 --register the remote data in the system domain
280 if rising_edge(CLK) then
286 --decipher the remote and local quantities and overflows
315 if rising_edge(CLK) then
324 --remote make 15 bits after addition
352 --truncate to maximum number of bits
354 --if top bits (from msb downto max_bits-2 are all '0' or all '1' then there
355 --is no overflow; not that to signal an overflow
366 --restricted range EX EY truncation and overflow
376 --combine overflows; note that we need to use the registered local and remote
377 --overflows to keep the total overflow consistent in time
393 --to preserve the interfaces we 're-cipher' the quantities
412 gen_XS_criteria: for i_thr in 0 to num_thresholds-1 generate
414 --multiplication of the two register values
415 --no real timing requirements here
420 --leading '0' is for a '+' sign, trailing "00" is a multiplication by 4
421 --(syntax error when I try & "00" don't know why)
424 --first leading 0 is to convert to '+'ve signed, next '0' is to
425 --accommodate XE2 subtraction
432 if rising_edge(CLK) then
436 --this is the LHS of the comparison for criterion c4
439 --resize the result of the multiplication by 1 bit to accomodate
440 --subsequent addition
459 --register LHS so it is matched with RHS latency
481 --register LHS so it is matched with RHS latency
497 --register LHS so it is matched with RHS latency
545 end generate gen_XS_criteria;
548 gen_TE_criteria: for i_thr in 0 to num_thresholds-1 generate
551 if rising_edge(CLK) then
586 end generate gen_TE_criteria;
588 gen_XE_criteria: for i_thr in 0 to num_thresholds-1 generate
591 if rising_edge(CLK) then
620 end generate gen_XE_criteria;
625 --process that performs the sequence of common calculations
628 if rising_edge(CLK) then
681 end system_summing_module;
unsigned (max_bits_XE2 - 1 downto 0) XE2
unsigned (max_bits_TE - 1 downto 0) TE_total
signed (max_bits_ExEy - 1 downto 0) EX_res_total_trunc
arr_ctr_92bit (num_thresholds - 1 downto 0) us_T4_A4_B2_TE
std_logic_vector (num_thresholds - 1 downto 0) c_XE
signed (max_bits_ExEy - 1 downto 0) EY_res_total_trunc
arr_sig_95bit (num_thresholds - 1 downto 0) X4_T4_A4_B2_TE_r
std_logic_vector (num_thresholds - 1 downto 0) c_XE_r
in addr_vmestd_logic_vector (15 downto 0)
signed (max_bits_ExEy - 1 downto 0) EX_local
unsigned (max_bits_ExEy - 1 downto 0) EY_total_abs
std_logic_vector (ENERGY_CRATE' range ) energy_crate_delayed
arr_sig_95bit (num_thresholds - 1 downto 0) X4_T4_A4_B2_TE
std_logic par_err_cbl_l_rrrrr
unsigned (max_bits_ExEy - 1 downto 0) EY_res_total_abs
std_logic_vector (7 downto 0) res_sumet_map
unsigned (max_bits_ExEy - 1 downto 0) EX_res_total_abs
signed (max_bits_ExEy - 1 downto 0) EY_remote
arr_ctr_46bit (num_thresholds - 1 downto 0) T2_A2_B2
signed (max_bits_ExEy - 1 downto 0) EX_res_remote
arr_sig_98bit (num_thresholds - 1 downto 0) T2_A2_TE_PLUS_T2_A2_B2_MINUS_XE2_ALL2
std_logic_vector (num_thresholds - 1 downto 0) c_XE_res
signed (max_bits_ExEy - 1 downto 0) EY_res_remote
std_logic ov_EY_res_local
std_logic_vector (7 downto 0) sumet_map
signed (max_bits_ExEy - 1 downto 0) EX_total_trunc
in MISS_E_RES_THRarr_ctr_31bit (num_thresholds - 1 downto 0)
out sums_all_outarr_ctr_15bit (5 downto 0)
std_logic_vector (num_thresholds - 1 downto 0) c_XS_3_r
unsigned (max_bits_TE - 1 downto 0) TE_res_total
in T_MISS_E_MAXarr_ctr_31bit (num_thresholds - 1 downto 0)
unsigned (max_bits_ExEy * 2 - 1 downto 0) EX2)
std_logic_vector (num_thresholds - 1 downto 0) c_XS_3_rrrr
arr_sig_95bit (num_thresholds - 1 downto 0) X4_T4_A4_B2_TE_rr
std_logic_vector (num_thresholds - 1 downto 0) c_XS_1
std_logic_vector (num_thresholds - 1 downto 0) c_XS_2_rrrr
std_logic_vector (num_thresholds - 1 downto 0) c_TE_rr
arr_ctr_62bit (num_thresholds - 1 downto 0) T4_A4
std_logic_vector (num_thresholds - 1 downto 0) c_XS_4A
std_logic ov_EY_res_remote_r
signed (max_bits_ExEy - 1 downto 0) EX_res_local
unsigned (max_bits_TE - 1 downto 0) TE_local
std_logic_vector (num_thresholds - 1 downto 0) c_XS_1_r
std_logic_vector (num_thresholds - 1 downto 0) c_XS_3
signed (max_bits_ExEy - 1 downto 0) EY_res_local
std_logic ov_EX_res_remote
std_logic_vector (num_thresholds - 1 downto 0) c_XS_2_r
unsigned (max_bits_ExEy - 1 downto 0) EX_total_abs
in SUM_ET_RES_THRarr_ctr_15bit (num_thresholds - 1 downto 0)
unsigned (max_bits_TE - 1 downto 0) TE_remote
unsigned (max_bits_ExEy * 2 - 1 downto 0) EY2)
out data_vme_outstd_logic_vector (15 downto 0)
std_logic_vector (num_thresholds - 1 downto 0) c_TE_res_rrr
std_logic_vector (5 downto 0) :=( others =>'0' ) ov_all
std_logic_vector (num_thresholds - 1 downto 0) c_TE_res_rrrr
std_logic_vector (7 downto 0) miss_map
ADDR_REG_RW_PIPELINE_DELAY_LENGTHinteger :=0
signed (max_bits_ExEy downto 0) EY_res_total
std_logic par_err_cbl_l_rr
in T_SUM_E_MAXarr_ctr_15bit (num_thresholds - 1 downto 0)
std_logic ov_TE_res_remote_r
arr_sig_95bit (num_thresholds - 1 downto 0) X4_T4_A4_B2_TE_rrr
std_logic_vector (num_thresholds - 1 downto 0) c_TE_rrrr
unsigned (max_bits_TE - 1 - 1 downto 0) TE_res_local
in XS_T2_A2arr_ctr_31bit (num_thresholds - 1 downto 0)
unsigned (max_bits_ExEy * 2 - 1 downto 0) EX2_res)
std_logic_vector (num_thresholds - 1 downto 0) c_XS_4A_r
out CTP_CABLE_1std_logic_vector (23 downto 0)
signed (max_bits_ExEy downto 0) EX_total
in ENERGY_CRATEstd_logic_vector (26 * 4 - 1 downto 0)
std_logic_vector (0 downto 0) bus_drive_local
in T_MISS_E_MINarr_ctr_31bit (num_thresholds - 1 downto 0)
std_logic_vector (num_thresholds - 1 downto 0) c_XS_2_rr
out ov_all_outstd_logic_vector (5 downto 0)
std_logic ov_EY_res_local_r
std_logic_vector (num_thresholds - 1 downto 0) c_XS_3_rr
std_logic_vector (num_thresholds - 1 downto 0) c_TE
unsigned (max_bits_TE - 1 - 1 downto 0) TE_res_remote
std_logic_vector (15 * 6 + 6 - 1 downto 0) energy_remote_l)
in SUM_ET_THRarr_ctr_15bit (num_thresholds - 1 downto 0)
std_logic ov_TE_res_remote
std_logic ov_TE_res_local_r
std_logic_vector (num_thresholds - 1 downto 0) c_TE_res_r
signed (max_bits_ExEy - 1 downto 0) EY_local
unsigned (max_bits_ExEy * 2 - 1 downto 0) EY2_res)
std_logic_vector (num_thresholds - 1 downto 0) c_TE_r
in XS_B2arr_ctr_15bit (num_thresholds - 1 downto 0)
signed (max_bits_ExEy downto 0) EY_total
std_logic_vector (num_thresholds - 1 downto 0) c_XE_res_r
arr_sig_49bit (num_thresholds - 1 downto 0) T2_A2_TE_PLUS_T2_A2_B2_MINUS_XE2
std_logic_vector (num_thresholds - 1 downto 0) c_TE_rrr
std_logic_vector (num_thresholds - 1 downto 0) c_XS_3_rrr
std_logic par_err_cbl_l_rrrr
signed (max_bits_XE2 downto 0) s_XE2
std_logic_vector (num_thresholds - 1 downto 0) c_XS_0_r
std_logic ov_TE_res_local
signed (max_bits_ExEy downto 0) EX_res_total
std_logic_vector (num_thresholds - 1 downto 0) c_TE_res_rr
std_logic_vector (num_thresholds - 1 downto 0) c_XS_2_rrr
signed (max_bits_ExEy - 1 downto 0) EY_total_trunc
std_logic_vector (num_thresholds - 1 downto 0) c_XS_2
arr_sig_49bit (num_thresholds - 1 downto 0) T2_A2_TE_PLUS_T2_A2_B2
arr_16 (0 downto 0) data_vme_out_local
std_logic_vector (31 downto 0) :=x"FFFFFFFF" ones32
std_logic_vector (num_thresholds - 1 downto 0) c_XS_1_rr
arr_ctr_77bit (num_thresholds - 1 downto 0) T4_A4_B2
in MISS_E_THRarr_ctr_31bit (num_thresholds - 1 downto 0)
in T_SUM_E_MINarr_ctr_15bit (num_thresholds - 1 downto 0)
std_logic_vector (15 * 6 + 6 - 1 downto 0) energy_crate_delayed_l)
unsigned (max_bits_XE2 - 1 downto 0) XE2_res
arr_ctr_47bit (num_thresholds - 1 downto 0) T2_A2_TE
std_logic par_err_cbl_l_r
std_logic_vector (num_thresholds - 1 downto 0) c_XE_res_rr
std_logic par_err_cbl_l_rrr
std_logic_vector (num_thresholds - 1 downto 0) c_XE_rr
std_logic ov_EX_res_local_r
in data_vme_instd_logic_vector (15 downto 0)
std_logic_vector (7 downto 0) xs_map
signed (max_bits_ExEy - 1 downto 0) EX_remote
in ENERGY_REMOTEstd_logic_vector (26 * 4 - 1 downto 0)
std_logic par_err_cbl_l_0
std_logic ov_EX_res_local
std_logic_vector (num_thresholds - 1 downto 0) c_XS_0_rr
std_logic ov_EX_res_remote_r
std_logic_vector (num_thresholds - 1 downto 0) c_XS_0
std_logic_vector (num_thresholds - 1 downto 0) c_TE_res
std_logic_vector (7 downto 0) res_miss_map
out CTP_CABLE_0std_logic_vector (23 downto 0)
std_logic_vector (31 downto 0) :=x"00000000" gnd32
std_logic ov_EY_res_remote
std_logic_vector (num_thresholds - 1 downto 0) c_XS_4B
arr_ctr_47bit (num_thresholds - 1 downto 0) us_T2_A2_TE_PLUS_T2_A2_B2