20 USE ieee.std_logic_1164.
all;
21 USE ieee.numeric_std.
all;
34 clk : in T_SL;
-- clock
35 thresholds : in arr_16(max_cps*16*4-1 downto 0);
-- thresholds
36 datai : in arr_4Xword(max_cps-1 downto 0);
-- input data
37 din_cbl : in T_SLV150;
-- remote input (multiplicty)
41 dout_lcl : out T_SLV48;
-- local multiplicity
43 dout : out T_SLV62;
-- global output data (multiplicity), including parity
44 dout_ro : out T_SL;
-- global overflow
45 dout_cbla_mux0 : out (33 downto 0);
-- cable output data (multiplicity), including parity
46 dout_cbla_mux1 : out (33 downto 0);
-- cable output data (multiplicity), including parity
55 -- parity error and force handling
56 par_err : in T_SLV2;
-- parity error (input module - 0, RTM - 1)
57 force : in T_SL;
-- force
69 -- Internal signal declarations
94 -- Component Declarations
97 clk :
in T_SL;
-- clock
98 thresholds :
in arr_16(max_cps*
16*
4-1 downto 0);
-- thresholds
99 datai :
in arr_4Xword(max_cps
-1 downto 0);
-- input data
100 dout_lcl :
out T_SLV48;
-- local output (multiplicity), excluding parity
103 force :
in T_SL;
-- force
104 disable_overflow_mask :
in (
15 downto 0)
108 signal disable_overflow_mask : (15 downto 0);
115 clk :
in T_SL;
-- clock
116 din_cbl :
in T_SLV150;
-- remote input (multiplicity)
120 din_lcl :
in T_SLV48;
-- local input (multiplicity), excluding parity
122 dout :
out T_SLV62;
-- global output (mutliplicity) to CTP
123 dout_ro :
out T_SL;
-- global overflow
125 force :
in T_SL;
-- force
130 addr_vme :
in (
15 downto 0);
131 data_vme_in :
in (
15 downto 0);
132 data_vme_out :
out (
15 downto 0);
153 end component vme_local_switch;
158 flavor : T_SLV2 := "
00";
-- JET/CPM
164 reset :
in ;
-- reset
168 end component adder_counter;
182 end component vme_outreg_notri_async;
198 end component vme_inreg_notri_async;
200 signal data_from_vme_REG_RW_DISABLE_OVERFLOW_MASK : (15 downto 0);
201 signal data_to_vme_REG_RW_DISABLE_OVERFLOW_MASK : (15 downto 0);
222 disable_overflow_mask => disable_overflow_mask
268 din => dout_lcl_ro_int & internal_dout
(54 downto 31),
282 -- ------------------------------------------------------------------------------------
283 -- MULT LOCAL COUNTERS - SYSTEM
284 -- ------------------------------------------------------------------------------------
286 gen_mult_counters_system: if gen_system = '1' generate
289 mult_2x16_general: for i in 0 to thresholds_num-1 generate
297 end generate mult_2x16_general;
299 mult_2x16_remote: for i in 0 to (3*thresholds_num)-1 generate
304 end generate mult_2x16_remote;
328 VME_CNT_MULT_LOCAL_COUNTER_i: for i in 0 to (2*thresholds_num)-1 generate
332 ia_vme => ADDR_REG_RO_MULT_LOCAL_COUNTER+
(2*i
),
344 end generate VME_CNT_MULT_LOCAL_COUNTER_i;
346 -- ------------------------------------------------------------------------------------
347 -- MULT REMOTE COUNTERS
348 -- ------------------------------------------------------------------------------------
370 VME_CNT_MULT_REMOTE_COUNTER_i: for i in 0 to (3*2*thresholds_num)-1 generate
374 ia_vme => ADDR_REG_RO_MULT_REMOTE_COUNTER+
(2*i
),
386 end generate VME_CNT_MULT_REMOTE_COUNTER_i;
389 -- ------------------------------------------------------------------------------------
390 -- MULT TOTAL COUNTERS
391 -- ------------------------------------------------------------------------------------
393 -- The parity excluded.
417 VME_CNT_MULT_TOTAL_COUNTER_i: for i in 0 to (2*thresholds_num)-1 generate
421 ia_vme => ADDR_REG_RO_MULT_TOTAL_COUNTER+
(2*i
),
433 end generate VME_CNT_MULT_TOTAL_COUNTER_i;
436 end generate gen_mult_counters_system;
440 -- ------------------------------------------------------------------------------------
441 -- MULT LOCAL COUNTERS - CRATE
442 -- ------------------------------------------------------------------------------------
444 gen_mult_counters_crate: if gen_system = '0' generate
446 mult_2x16: for i in 0 to thresholds_num-1 generate
451 end generate mult_2x16;
471 VME_CNT_MULT_LOCAL_COUNTER_i: for i in 0 to (2*thresholds_num)-1 generate
475 ia_vme => ADDR_REG_RO_MULT_LOCAL_COUNTER+
(2*i
),
487 end generate VME_CNT_MULT_LOCAL_COUNTER_i;
490 end generate gen_mult_counters_crate;
496 ia_vme => ADDR_REG_RW_DISABLE_OVERFLOW_MASK,
507 data_to_vme => data_to_vme_REG_RW_DISABLE_OVERFLOW_MASK
);
509 data_to_vme_REG_RW_DISABLE_OVERFLOW_MASK<=data_from_vme_REG_RW_DISABLE_OVERFLOW_MASK;
510 disable_overflow_mask<=data_from_vme_REG_RW_DISABLE_OVERFLOW_MASK;
thresholds_numinteger :=25
cnt_mult_arr_2x16 ((2 * thresholds_num) - 1 downto 0) cnt_mult_total_2x16)
in addr_vmestd_logic_vector (15 downto 0)
out data_vmestd_logic_vector (15 downto 0)
std_logic parity_cbla_mux1
out dout_cbla_mux0std_logic_vector (33 downto 0)
cnt_mult_arr (thresholds_num - 1 downto 0) cnt_mult_local
out dout_lclstd_logic_vector (59 downto 0)
arr_16 (12 * thresholds_num + 1 downto 0) data_vme_out_local)
out data_from_vmestd_logic_vector (width - 1 downto 0)
T_SLV48 internal_dout_cnt
cnt_mult_arr_2x16 ((3 * 2 * thresholds_num) - 1 downto 0) cnt_mult_remote_2x16)
in data_vme_from_belowarr_16
--! inputs from local registers and from
cnt_mult_arr ((3 * thresholds_num) - 1 downto 0) cnt_mult_remote)
in data_vme_instd_logic_vector (15 downto 0)
in datastd_logic_vector (width - 1 downto 0)
gen_systemstd_logic :='1'
out data_vme_outstd_logic_vector (15 downto 0)
out dout_cbla_mux1std_logic_vector (33 downto 0)
in data_to_vmestd_logic_vector (width - 1 downto 0)
out data_vme_upstd_logic_vector (15 downto 0)
--! connect this to
in addr_vmestd_logic_vector (15 downto 0)
cnt_mult_arr_2x16 ((2 * thresholds_num) - 1 downto 0) cnt_mult_local_2x16)
ADDR_REG_RW_PIPELINE_DELAY_LENGTHinteger :=0
out bus_drive_upstd_logic
or of all bus drive requests from below
std_logic_vector (33 downto 0) cbla_mux1
gen_systemstd_logic :='1'
std_logic parity_cbla_mux0
std_logic_vector (12 * thresholds_num + 1 downto 0) bus_drive_local)
out cnt_arrcnt_mult_arr (thresholds_num - 1 downto 0)
in dataiarr_4Xword (max_jems - 1 downto 0)
out data_vme_outstd_logic_vector (15 downto 0)
in dataiarr_4Xword (max_jems - 1 downto 0)
cnt_mult_arr (thresholds_num - 1 downto 0) cnt_mult_total
in dinstd_logic_vector (width - 1 downto 0)
in thresholdsarr_16 (max_jems * 25 * 4 - 1 downto 0)
std_logic_vector (33 downto 0) cbla_mux0
in data_vme_instd_logic_vector (15 downto 0)
in data_to_vmestd_logic_vector (width - 1 downto 0)
in thresholdsarr_16 (max_jems * 25 * 4 - 1 downto 0)
in addr_vmestd_logic_vector (15 downto 0)
in bus_drive_from_belowstd_logic_vector
ADDR_REG_RW_PIPELINE_DELAY_LENGTHinteger :=0