1 ----------------------------------------------------------------------------------
13 ----------------------------------------------------------------------------------
15 use IEEE.STD_LOGIC_1164.
ALL;
27 P : in mat_var (numactchan-1 downto 0);
30 buf_clk200 : in ;
-- global 200 MHz clock for iodelay calibration
33 ODATA : out arr_4Xword (numactchan-1 downto 0);
-- 96 bit buses
37 --signals parity error on any of the inputs; comes out one tick later than
47 --auto quiet in case of parity error
53 --inhibit signal for writing to the spy memories
71 signal DATA24: arr_word (numactchan-1 downto 0);
-- 24 bit data for
73 signal DELAYED_DATA24 : arr_word (numactchan-1 downto 0);
-- data after delay
79 signal ODATA_sig : arr_4Xword (numactchan-1 downto 0);
-- 96 bit
84 --registered with system
85 --clock for comparison
94 --first half of the data registered on the inverted clock
135 --component vme_outreg
140 -- clk : in std_logic;
141 -- addr_vme : in std_logic_vector (15 downto 0);
142 -- ncs : in std_logic;
143 -- rd_nwr : in std_logic;
144 -- ds : in std_logic;
145 -- data_to_vme : in std_logic_vector (width-1 downto 0);
146 -- read_detect : out std_logic;
147 -- data_vme : out std_logic_vector (15 downto 0));
150 --component vme_outreg_notri is
155 -- clk : in std_logic;
156 -- ncs : in std_logic;
157 -- rd_nwr : in std_logic;
158 -- ds : in std_logic;
159 -- addr_vme : in std_logic_vector (15 downto 0);
160 -- data_vme : out std_logic_vector (15 downto 0);
161 -- bus_drive : out std_logic;
162 -- data_to_vme : in std_logic_vector (width-1 downto 0);
163 -- read_detect : out std_logic);
164 --end component vme_outreg_notri;
216 --component vme_inreg
221 -- clk : in std_logic;
222 -- ncs : in std_logic;
223 -- rd_nwr : in std_logic;
224 -- ds : in std_logic;
225 -- data_from_vme : out std_logic_vector (width-1 downto 0);
226 -- data_to_vme : in std_logic_vector (width-1 downto 0);
227 -- addr_vme : in std_logic_vector (15 downto 0);
228 -- read_detect : out std_logic;
229 -- write_detect : out std_logic;
230 -- data_vme : inout std_logic_vector (15 downto 0));
235 --supplied for sw check
240 --component vme_inreg_async
245 -- ncs : in std_logic;
246 -- rd_nwr : in std_logic;
247 -- ds : in std_logic;
248 -- addr_vme : in std_logic_vector (15 downto 0);
249 -- data_vme : inout std_logic_vector (15 downto 0);
250 -- data_from_vme : out std_logic_vector (width-1 downto 0);
251 -- data_to_vme : in std_logic_vector (width-1 downto 0));
266 --signal ODATA_reg40 : arr_4Xword (numactchan-1 downto 0); -- 96 bit buses
270 signal PDATA : arr_word (numactchan-1 downto 0);
--DDR data
271 signal NDATA : arr_word (numactchan-1 downto 0);
277 signal CLKPAR: (numactchan-1 downto 0);
-- 16 clock
282 signal CLKPARB: (numactchan-1 downto 0);
-- same buffered
311 DATA24:
in arr_word (numactchan
-1 downto 0);
312 CLKPAR:
in (numactchan
- 1 downto 0);
316 del_register:
in del_register_type;
--input from VME holding 5 bit delay
317 --for every data and clkpar signal of
320 --upload of the registers into the
343 PDATA,
NDATA :
in (numbitsinchan
- 1 downto 0);
344 ODATA :
out ((numbitsinchan*
4)
-1 downto 0);
352 --component CMX_input_module_state_FSM
354 -- clk, rst : in std_logic;
355 -- pdata, ndata : in std_logic_vector(numbitsinchan-1 downto 0);
356 -- counter_enable: out std_logic);
359 component DEBOUNCE_10
388 addra :
out (
7 DOWNTO 0);
394 --component CMX_input_module_spy_mem_control_FSM
396 -- ADDR_REG_RW_INPUT_SPY_MEM_X_WORD : integer;
397 -- ADDR_REG_RW_INPUT_SPY_MEM_X_CONTROL : integer;
398 -- ADDR_REG_RO_INPUT_SPY_MEM_X_STATUS : integer);
400 -- clk : in std_logic;
401 -- ncs : in std_logic;
402 -- rd_nwr : in std_logic;
403 -- ds : in std_logic;
404 -- addr_vme : in std_logic_vector (15 downto 0);
405 -- data_vme_in : in std_logic_vector (15 downto 0);
406 -- data_vme_out : out std_logic_vector (15 downto 0);
407 -- bus_drive : out std_logic;
408 -- mode_control : out std_logic_vector(3 downto 0);
409 -- ena : out std_logic;
410 -- wea : out std_logic;
411 -- addra : out std_logic_vector(7 DOWNTO 0);
412 -- mem_select_address : out std_logic_vector(3 downto 0);
413 -- dina : out std_logic_vector(95 DOWNTO 0);
414 -- douta : in std_logic_vector(95 DOWNTO 0);
415 -- port_b_master_inhibit : out std_logic);
420 --signals for the source spy memory controllers
436 --Xilinx IP DPR (BRAM) with port widths configured correctly for the source
437 --side (80 Mbps) memories
438 component blk_mem_A8x96_B9x48
442 wea :
IN (
0 DOWNTO 0);
443 addra :
IN (
7 DOWNTO 0);
444 dina :
IN (
95 DOWNTO 0);
445 douta :
OUT (
95 DOWNTO 0);
448 web :
IN (
0 DOWNTO 0);
449 addrb :
IN (
8 DOWNTO 0);
450 dinb :
IN (
47 DOWNTO 0);
451 doutb :
OUT (
47 DOWNTO 0));
454 --signals for individual source spy memories
462 --these are a function of the mode control word
466 --registered in the source domain to aid timing
484 --these are a function of the mode control word
490 --and these individual again
495 --signal doutb_SPY_SOURCE_individual_r_SOURCE : arr_48(numactchan-1 downto 0);
500 --double registered reset signal in the source clock domain to avoid metastability
508 --signals for the system spy memory controllers
522 component blk_mem_A8x96_B8x96
is
526 wea :
IN (
0 DOWNTO 0);
527 addra :
IN (
7 DOWNTO 0);
528 dina :
IN (
95 DOWNTO 0);
529 douta :
OUT (
95 DOWNTO 0);
532 web :
IN (
0 DOWNTO 0);
533 addrb :
IN (
7 DOWNTO 0);
534 dinb :
IN (
95 DOWNTO 0);
535 doutb :
OUT (
95 DOWNTO 0));
540 --signals for individual system spy memories
548 --these are a function of the mode control word
552 --registered in the system domain to aid timing
562 --these are a function of the mode control word
568 --and these individual again
573 --WTF 20150204 push the mux before the last flip-flop
574 --signal doutb_SPY_SYSTEM_individual_r_SYSTEM : arr_4Xword(numactchan-1 downto 0);
575 --signal doutb_SPY_SYSTEM_individual_r_mSYSTEM : arr_4Xword(numactchan-1 downto 0);
580 --registered locally to aid timing closure
590 --component chipscope_icon_u1_c1 is
592 -- CONTROL0 : inout std_logic_vector(35 downto 0));
593 --end component chipscope_icon_u1_c1;
594 --signal CONTROL0 : std_logic_vector(35 downto 0);
596 --component chipscope_ila_inputmod_systemSPY_logic is
598 -- CONTROL : inout std_logic_vector(35 downto 0);
599 -- CLK : in std_logic;
600 -- DATA : in std_logic_vector(490 downto 0);
601 -- TRIG0 : in std_logic_vector(27 downto 0));
602 --end component chipscope_ila_inputmod_systemSPY_logic;
604 --signal data_ila : std_logic_vector(490 downto 0);
605 --signal trig_ila : std_logic_vector(27 downto 0);
607 -- component chipscope_icon_input_module_u3_c2
609 -- CONTROL0 : inout std_logic_vector(35 downto 0);
610 -- CONTROL1 : inout std_logic_vector(35 downto 0));
613 -- signal CONTROLBUS : arr_36(numactchan-1 downto 0);
616 -- component chipscope_ila_input_module
618 -- CONTROL : inout std_logic_vector(35 downto 0);
619 -- CLK : in std_logic;
620 -- DATA : in std_logic_vector(46 downto 0);
621 -- TRIG0 : in std_logic_vector(2 downto 0));
624 -- signal DATA_chipscope_ila_input_module : arr_47(numactchan-1 downto 0);
625 -- signal TRIG0_chipscope_ila_input_module : arr_3(numactchan-1 downto 0);
627 --error checking signals for the source side spy memories
638 --error checking signals for the system side spy memories
665 signal data_vme_from_below : arr_16(13+ 2*numactchan-1 + 5*numactchan-1 +4*numactchan-1 + 9*numactchan-1 downto 0);
671 attribute keep of enb_SPY_SOURCE_r_SOURCE, web_SPY_SOURCE_r_SOURCE, enb_SPY_SOURCE_split, web_SPY_SOURCE_split, enb_SPY_SOURCE_rr_SOURCE, web_SPY_SOURCE_rr_SOURCE, enb_SPY_SOURCE_r_SYSTEM, web_SPY_SOURCE_r_SYSTEM, enb_SPY_SOURCE_rr_SYSTEM, web_SPY_SOURCE_rr_SYSTEM, port_b_master_inhibit_SPY_SOURCE_split, port_b_master_inhibit_SPY_SOURCE_r_SYSTEM, port_b_master_inhibit_SPY_SOURCE_r_SYSTEM_r_SOURCE, port_b_master_inhibit_SPY_SOURCE_r_SYSTEM_rr_SOURCE,counter_reset_r_SYSTEM,counter_reset_rr_SYSTEM,counter_reset_rr_SYSTEM_r_SOURCE, any_reset_B_synced_r_SOURCE, any_reset_B_synced_rr_SOURCE, ODATA_sig_r_SYSTEM : signal is "TRUE";
676 -- chipscope_icon_input_module_u3_c2_inst: chipscope_icon_input_module_u3_c2
678 -- CONTROL0 => CONTROLBUS(0),
679 -- CONTROL1 => CONTROLBUS(1));
681 -- chipscope_ila_gen : for channel in 0 to numactchan - 1
683 -- chipscope_ila_input_module_inst: chipscope_ila_input_module
685 -- CONTROL => CONTROLBUS(channel),
686 -- CLK => CLKPARB(channel),
687 -- DATA => DATA_chipscope_ila_input_module(channel),
688 -- TRIG0 => TRIG0_chipscope_ila_input_module(channel));
690 -- TRIG0_chipscope_ila_input_module(channel)(0)<=pll_locked;
691 -- TRIG0_chipscope_ila_input_module(channel)(1)<=counter_enable(channel);
692 -- TRIG0_chipscope_ila_input_module(channel)(2)<=PAR_ERROR_sig(channel);
694 -- DATA_chipscope_ila_input_module(channel)(0)<=pll_locked;
695 -- DATA_chipscope_ila_input_module(channel)(1)<=pll_locked_s1(channel);
696 -- DATA_chipscope_ila_input_module(channel)(2)<=counter_enable(channel);
697 -- DATA_chipscope_ila_input_module(channel)(3)<=PAR_ERROR_sig(channel);
698 -- DATA_chipscope_ila_input_module(channel)(4 downto 4)<=std_logic_vector(cyclecounter(channel));
699 -- DATA_chipscope_ila_input_module(channel)(11 downto 5)<=PDATA(channel);
700 -- DATA_chipscope_ila_input_module(channel)(18 downto 12)<=NDATA(channel);
701 -- DATA_chipscope_ila_input_module(channel)(46 downto 19)<=ODATA_sig(channel);
703 -- end generate chipscope_ila_gen;
707 -- O => buf_clk40_sig, -- 1-bit output: Clock buffer output
708 -- I => clk40 -- 1-bit input: Clock buffer input
711 --buf_clk40<=buf_clk40_sig;
713 --connect the 24 data bits of each 25 bit bundle to DATA24
714 --and the clock/parity lines
726 busgen : for channel in 0 to numactchan - 1
728 --DATA24(channel)(23 downto 0) <= P(channel)(24 downto 1);
729 --CLKPAR(channel) <= P(channel)(0);
730 DATA24(channel)(numbitsinchan-1 downto 0) <= P(channel)(numbitsinchan-1 downto 0);
731 CLKPAR(channel) <= P(channel)(numbitsinchan);
737 --implements iodelay modules and calibration circuit
760 --generate regional buffers for clock distribution
761 buf_gen: for channel in 0 to numactchan -1
765 BUFR_DIVIDE =>
"BYPASS",
-- Values: "BYPASS", "1", "2", "3", "4", "5", "6", "7", "8"
766 SIM_DEVICE =>
"VIRTEX6" -- Must be set to "VIRTEX6"
775 end generate buf_gen;
780 --now connect to IDDR
781 iddrgen: for channel in numactchan - 1 downto 0 generate
782 bitgen: for bitnum in 0 to (numbitsinchan-1) generate
786 DDR_CLK_EDGE =>
"OPPOSITE_EDGE",
--"SAME_EDGE_PIPELINED", -- "OPPOSITE_EDGE", "SAME_EDGE"
787 -- or "SAME_EDGE_PIPELINED"
788 INIT_Q1 => '0',
-- Initial value of Q1: '0' or '1'
789 INIT_Q2 => '0',
-- Initial value of Q2: '0' or '1'
790 SRTYPE =>
"SYNC" ) -- Set/Reset type: "SYNC" or "ASYNC"
792 Q1 =>
PDATA(channel
)(bitnum
),
-- 1-bit output for positive edge of clock
793 Q2 =>
NDATA(channel
)(bitnum
),
-- 1-bit output for negative edge of clock
794 C =>
CLKPARB(channel
),
-- 1-bit clock input
795 CE => '1',
-- 1-bit clock enable input
798 S => '0'
-- 1-bit set
801 end generate iddrgen;
804 --now connect to the BUF2X24_AT80_TO_1X96_AT_40
805 --to get a 96 bit wide 40MHz bus of data
806 widebusgen: for channel in numactchan-1 downto 0 generate
819 --PAR_ERROR(channel)<=PAR_ERROR_sig(channel);
826 --WTF 20150204 push the mux before the last flip-flop
829 -- if rising_edge(buf_clk40) then
830 -- doutb_SPY_SYSTEM_individual_r_SYSTEM(channel)<=doutb_SPY_SYSTEM_individual(channel);
837 --WTF 20150204 push the mux before the last flip-flop
843 --WTF 20150204 push the mux before the last flip-flop
844 --doutb_SPY_SYSTEM_individual_r_mSYSTEM(channel)<=doutb_SPY_SYSTEM_individual(channel);
845 --ODATA_first_half_sig_r_mSYSTEM(channel)<=ODATA_first_half_sig(channel);
849 --connect output signals
850 --WTF 20150204 push the mux before the last flip-flop
851 --PAR_ERROR_play(channel)<=PAR_ERROR_sig_r_SYSTEM(channel) when mode_control_SPY_SYSTEM /= CONST_DPR_CONTROL_PLAYBACK else '0';
852 --WTF 20150204 push the mux before the last flip-flop
853 --ODATA(channel)<=ODATA_sig_r_SYSTEM(channel) when mode_control_SPY_SYSTEM /= CONST_DPR_CONTROL_PLAYBACK else doutb_SPY_SYSTEM_individual_r_SYSTEM(channel);
854 --WTF 20150204 push the mux before the last flip-flop
855 --ODATA_first_half(channel)<=ODATA_first_half_sig_r_mSYSTEM(channel) when mode_control_SPY_SYSTEM /= CONST_DPR_CONTROL_PLAYBACK else doutb_SPY_SYSTEM_individual_r_mSYSTEM(channel)(2*numbitsinchan-1 downto 0);
858 end generate widebusgen;
870 --channel mask register
873 ia_vme => ADDR_REG_RW_BACKPLANE_INPUT_CHANNEL_MASK,
890 --generation of event and parity error counters
894 ia_vme => ADDR_REG_RW_COUNTER_RESET ,
920 ia_vme => ADDR_REG_RO_EV_COUNTER,
934 ia_vme => ADDR_REG_RO_EV_COUNTER+2 ,
964 countergen: for channel in numactchan-1 downto 0 generate
968 ia_vme => ADDR_REG_RO_PARITY_ERROR_COUNTER+4*channel,
983 ia_vme => ADDR_REG_RO_PARITY_ERROR_COUNTER+4*channel+2,
1011 --PAR_ERROR_sig_r_SYSTEM(channel)<='0';
1015 --PAR_ERROR_sig_r_SYSTEM(channel)<=PAR_ERROR_sig(channel);
1020 end generate countergen;
1023 --process (buf_clk40)
1025 -- if rising_edge(buf_clk40) then
1026 -- ODATA_reg40<=ODATA_sig;
1030 -- word0gen: for channel in numactchan-1 downto 0 generate
1031 -- --ODATA_WORD0(channel)<=ODATA_reg40(channel)(4*numbitsinchan-1 downto 3*numbitsinchan);
1032 -- ODATA_WORD0(channel)<=ODATA_sig(channel)(4*numbitsinchan-1 downto 3*numbitsinchan);
1033 -- end generate word0gen;
1035 --ODATA<=ODATA_reg40;
1036 --ODATA<=ODATA_sig when mode_control_SPY_SYSTEM /= CONST_DPR_CONTROL_PLAYBACK else doutb_SPY_SYSTEM_individual;
1048 ia_vme => ADDR_REG_RW_INPUT_MOD_RESET ,
1074 ia_vme => ADDR_REG_RO_INPUT_MOD_COUNTER_ENABLE,
1087 gen_Pad_vme_COUNTER_ENABLE: if numactchan<16 generate
1089 end generate gen_Pad_vme_COUNTER_ENABLE;
1091 genCOUNTER: for channel in 0 to numactchan - 1 generate
1093 --CMX_input_module_state_FSM_inst: CMX_input_module_state_FSM
1095 -- clk => CLKPARB(channel),
1096 -- rst => rst_rx_debounced(channel),
1097 -- pdata => PDATA(channel),
1098 -- ndata => NDATA(channel),
1099 -- counter_enable => counter_enable(channel));
1102 --process to sync the pll locked signal to the clk_slow
1115 --pcount: process (buf_clk40, pll_locked)
1117 -- if pll_locked='0' then
1118 -- cyclecounter(channel)<=to_unsigned(1,1);
1121 -- if rising_edge(buf_clk40) then
1122 -- cyclecounter(channel)<=to_unsigned(1,1);
1123 -- elsif falling_edge(buf_clk40) then
1124 -- cyclecounter(channel)<=to_unsigned(0,1);
1125 -- -- if counter_enable(channel)='0' then
1126 -- -- counter_enable(channel)<='1';
1131 --end process pcount;
1136 --this counter will be used for CE to input registers
1140 if rising_edge(CLKPARB(channel)) then
1154 elsif rising_edge(CLKPARB(channel)) then
1162 end generate genCOUNTER;
1166 --spy memory control (for 'SOURCE' memories)
1193 --- --this will generate a 16:1 multiplexer with mem_select_... acting as the
1195 --- douta_SPY_SOURCE<=douta_SPY_SOURCE_individual(to_integer(unsigned(mem_select_address_SPY_SOURCE)));
1198 gen_source_spy: for i_mem_source in 0 to numactchan-1 generate
1200 --process to generate a local registers for the inhibit signal
1206 if rising_edge(CLKPARB(i_mem_source)) then
1213 if rising_edge(CLKPARB(i_mem_source)) then
1233 -- select the control signals based on the value of the mem_select_address_SPY_SOURCE
1235 =(to_unsigned(i_mem_source,4)) else '0';
1238 =(to_unsigned(i_mem_source,4)) else '0';
1240 --this should generate a wide multiplexer with douta_SPY_SOURCE as output
1241 --and the douta_SPY_SOURCE_individual's as inputs
1243 =(to_unsigned(i_mem_source,4)) else (others=>'Z');
1254 ia_vme => ADDR_REG_RW_INPUT_SPY_MEM_SOURCE_START_ADDRESS+2*i_mem_source,
1268 --synchronisation of the start playback signal to the source domain
1274 if rising_edge(CLKPARB(i_mem_source)) then
1282 if rising_edge(CLKPARB(i_mem_source)) then
1283 --synchronisation of the start playback signal to the source domain
1303 --create local registers for the master inhibit to aid timing closure
1328 --this will make an error detection register that in turn will be used to
1329 --generate a latch; also an no-error run length counter is made in this process
1332 if rising_edge(CLKPARB(i_mem_source)) then
1334 if bit_error_latch(i_mem_source)/=x"000000" or (bit_error_counter(i_mem_source))=x"ffffffff" then --bit_error_detect(i_mem_source)/=x"000000000000" or bit_error_counter(i_mem_source)/=to_unsigned(0,32) or std_logic_vector(bit_error_counter(i_mem_source))=x"ffffffff" then
1349 --doutb_SPY_SOURCE_individual_r_SOURCE(i_mem_source)<=doutb_SPY_SOURCE_individual(i_mem_source);
1354 --double register in the source domain
1357 if rising_edge(CLKPARB(i_mem_source)) then
1365 elsif rising_edge(CLKPARB(i_mem_source)) then
1372 --double register to close timing
1389 gen_err_latch_bit: for i_bit in 0 to numbitsinchan-1 generate
1391 --resettable 'latch' (so not really a latch) that is set if there is an error
1395 if rising_edge(CLKPARB(i_mem_source)) then
1406 end generate gen_err_latch_bit;
1408 --assign latches as data to the registers
1416 ia_vme => ADDR_REG_RO_INPUT_SPY_MEM_SOURCE_CHECK_ERROR+
(4*i_mem_source
),
1431 ia_vme => ADDR_REG_RO_INPUT_SPY_MEM_SOURCE_CHECK_ERROR+
(4*i_mem_source
)+2,
1445 ia_vme => ADDR_REG_RO_INPUT_SPY_MEM_SOURCE_NOERROR_COUNTER+
(4*i_mem_source
),
1459 ia_vme => ADDR_REG_RO_INPUT_SPY_MEM_SOURCE_NOERROR_COUNTER+
(4*i_mem_source
)+2,
1472 end generate gen_source_spy;
1474 --port enables - we read when verifying and spying and write only and spying
1475 --playback is not implemented yet from this memory
1484 --spy memory control (for 'SYSYTEM' memories)
1514 ia_vme => ADDR_REG_RW_INPUT_SPY_MEM_SYSTEM_START_ADDRESS,
1529 --- douta_SPY_SYSTEM<=douta_SPY_SYSTEM_individual(to_integer(unsigned(mem_select_address_SPY_SYSTEM)) );
1532 gen_system_spy: for i_mem_system in 0 to numactchan-1 generate
1534 --process to locally register the inhibit signal;
1567 -- select the control signals based on the value of the mem_select_address_SPY_SYSTEM
1569 =(to_unsigned(i_mem_system,4)) else '0';
1572 =(to_unsigned(i_mem_system,4)) else '0';
1574 --this should generate a wide multiplexer with douta_SPY_SYSTEM as output
1575 --and the douta_SPY_SYSTEM_individual's as inputs
1577 =(to_unsigned(i_mem_system,4)) else (others=>'Z');
1580 --data coming in from the 80->40 Mbps deserialiser
1598 --a local register (one copy for each of the memories)to ease timing
1610 --create local registers for the master inhibit to aid timing closure
1634 --this will make an error detection register that in turn will be used to
1635 --generate a latch; also an no-error run length counter is made in this process
1640 if bit_error_latch_system(i_mem_system)/=x"000000" or (bit_error_counter_system(i_mem_system))=x"ffffffff" then --bit_error_detect(i_mem_source)/=x"000000000000" or bit_error_counter(i_mem_source)/=to_unsigned(0,32) or std_logic_vector(bit_error_counter(i_mem_source))=x"ffffffff" then
1661 ODATA(i_mem_system)<=(others=>'0');
1666 --WTF 20150204 push the mux before the last flip-flop
1681 gen_err_latch_bit_system: for i_bit in 0 to numbitsinchan-1 generate
1684 --resettable 'latch' (so not really a latch) that is set if there is an error
1707 end generate gen_err_latch_bit_system;
1709 --assign latches as data to the registers
1717 ia_vme => ADDR_REG_RO_INPUT_SPY_MEM_SYSTEM_CHECK_ERROR+
(4*i_mem_system
),
1732 ia_vme => ADDR_REG_RO_INPUT_SPY_MEM_SYSTEM_CHECK_ERROR+
(4*i_mem_system
)+2,
1746 ia_vme => ADDR_REG_RO_INPUT_SPY_MEM_SYSTEM_NOERROR_COUNTER+
(4*i_mem_system
),
1760 ia_vme => ADDR_REG_RO_INPUT_SPY_MEM_SYSTEM_NOERROR_COUNTER+
(4*i_mem_system
)+2,
1773 end generate gen_system_spy;
1775 --port enables - we enable B port when verifying, spying and playing back. Write
1776 --is enabled only when spying
1785 gen_clock_detect: for channel in 0 to numactchan-1 generate
1791 if rising_edge(CLKPARB(channel)) then
1799 if rising_edge(CLKPARB(channel)) then
1856 ia_vme => ADDR_REG_RO_CLOCK_DETECT_COUNTER+2*channel,
1871 ia_vme => ADDR_REG_RO_CLOCK_DIFF_DETECT_COUNTER+4*channel,
1885 ia_vme => ADDR_REG_RO_CLOCK_DIFF_DETECT_COUNTER+4*channel+2,
1899 ia_vme => ADDR_REG_RO_CLOCK_DIFF_DURATION_COUNTER+4*channel,
1913 ia_vme => ADDR_REG_RO_CLOCK_DIFF_DURATION_COUNTER+4*channel+2,
1928 ia_vme => ADDR_REG_RO_CLOCK_DIFF_RATCHET_UP_COUNTER+4*channel,
1942 ia_vme => ADDR_REG_RO_CLOCK_DIFF_RATCHET_UP_COUNTER+4*channel+2,
1957 ia_vme => ADDR_REG_RO_CLOCK_DIFF_RATCHET_DOWN_COUNTER+4*channel,
1971 ia_vme => ADDR_REG_RO_CLOCK_DIFF_RATCHET_DOWN_COUNTER+4*channel+2,
1984 end generate gen_clock_detect;
1986 --chipscope_icon_u1_c1_inst: entity work.chipscope_icon_u1_c1
1988 -- CONTROL0 => CONTROL0);
1990 --chipscope_ila_inputmod_systemSPY_logic_inst: entity work.chipscope_ila_inputmod_systemSPY_logic
1992 -- CONTROL => CONTROL0,
1993 -- CLK => buf_clk40,
1994 -- DATA => data_ila,
1995 -- TRIG0 => trig_ila);
1998 --data_ila(23 downto 0)<=bit_error_latch_system(5);
1999 --data_ila(119 downto 24)<=bit_error_detect_system(5);
2000 --data_ila(120) <= counter_reset_r_SYSTEM(5);
2001 --data_ila(121) <= counter_reset_rr_SYSTEM(5);
2002 --data_ila(122) <= spy_write_inhibit_r_SYSTEM(5);
2003 --data_ila(123) <= spy_write_inhibit_rr_SYSTEM(5);
2004 --data_ila(124) <= enb_SPY_SYSTEM_individual(5);
2005 --data_ila(125) <= web_SPY_SYSTEM_individual(5)(0);
2006 --data_ila(126) <= enb_SPY_SYSTEM_r_SYSTEM(5);
2007 --data_ila(127) <= web_SPY_SYSTEM_r_SYSTEM(5);
2008 --data_ila(128) <= port_b_master_inhibit_SPY_SYSTEM_r_SYSTEM(5);
2009 --data_ila(129) <= spy_write_inhibit_rr_SYSTEM(5);
2010 --data_ila(130) <= start_playback_rr_SYSTEM(5);
2011 --data_ila(138 downto 131)<=addrb_SPY_SYSTEM_individual(5);
2012 --data_ila(170 downto 139)<=std_logic_vector(bit_error_counter_system(5));
2013 --data_ila(202 downto 171)<=std_logic_vector(bit_error_counter_system_next(5));
2014 --data_ila(298 downto 203)<=doutb_SPY_SYSTEM_individual(5);
2015 --data_ila(394 downto 299)<=ODATA_sig_r_SYSTEM(5);
2016 --data_ila(490 downto 395)<=ODATA_sig_rr_SYSTEM(5);
2019 --trig_ila(7 downto 0)<=bit_error_latch_system(5)(7 downto 0);
2020 --trig_ila(15 downto 8)<=bit_error_detect_system(5)(7 downto 0);
2021 --trig_ila(16) <= counter_reset_r_SYSTEM(5);
2022 --trig_ila(17) <= counter_reset_rr_SYSTEM(5);
2023 --trig_ila(18) <= spy_write_inhibit_r_SYSTEM(5);
2024 --trig_ila(19) <= spy_write_inhibit_rr_SYSTEM(5);
2025 --trig_ila(20) <= enb_SPY_SYSTEM_individual(5);
2026 --trig_ila(21) <= web_SPY_SYSTEM_individual(5)(0);
2027 --trig_ila(22) <= enb_SPY_SYSTEM_r_SYSTEM(5);
2028 --trig_ila(23) <= web_SPY_SYSTEM_r_SYSTEM(5);
2029 --trig_ila(24) <= port_b_master_inhibit_SPY_SYSTEM_r_SYSTEM(5);
2030 --trig_ila(25) <= spy_write_inhibit_rr_SYSTEM(5);
2031 --trig_ila(26) <= start_playback_rr_SYSTEM(5);
2032 --trig_ila(27) <= pll_locked;
out data_vme_outstd_logic_vector (15 downto 0)
ADDR_REG_RW_GENERIC_SPY_MEM_WORDinteger :=0
in data_vme_instd_logic_vector (15 downto 0)
out ODATA_first_halfstd_logic_vector ((numbitsinchan * 2) - 1 downto 0)
in addr_vmestd_logic_vector (15 downto 0)
in addr_vmestd_logic_vector (15 downto 0)
out data_vmestd_logic_vector (15 downto 0)
out data_vme_outstd_logic_vector (15 downto 0)
out stretched_OUTstd_logic
ADDR_REG_RW_GENERIC_SPY_MEM_CONTROLinteger :=0
out IDELAYCTRL_RDYstd_logic_vector (num_IDELAYCTRL - 1 downto 0)
out data_from_vmestd_logic_vector (width - 1 downto 0)
ADDR_REG_RO_GENERIC_SPY_MEM_STATUSinteger :=0
in data_vme_from_belowarr_16
--! inputs from local registers and from
out data_from_vmestd_logic_vector (width - 1 downto 0)
out DELAYED_CLKPARstd_logic_vector (numactchan - 1 downto 0)
out data_vme_outstd_logic_vector (15 downto 0)
in data_vme_instd_logic_vector (15 downto 0)
in REF_CLK_READYstd_logic
out port_b_master_inhibitstd_logic
out addrastd_logic_vector (7 downto 0)
out write_detectstd_logic
num_external_RAMSpositive :=1
in addr_vmestd_logic_vector (15 downto 0)
in CLKPARstd_logic_vector (numactchan - 1 downto 0)
in PDATAstd_logic_vector (numbitsinchan - 1 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)
in upload_delaysstd_logic
out bus_drive_upstd_logic
or of all bus drive requests from below
out mem_select_addressstd_logic_vector (addr_port_width (num_external_RAMS) - 1 downto 0)
in addr_vmestd_logic_vector (15 downto 0)
in DATAstd_logic_vector (numbits - 1 downto 0)
in del_registerdel_register_type
in data_to_vmestd_logic_vector (width - 1 downto 0)
in counter_enablestd_logic
out ODATAstd_logic_vector ((numbitsinchan * 4) - 1 downto 0)
out data_vme_outstd_logic_vector (15 downto 0)
out DELAYED_DATA24arr_word (numactchan - 1 downto 0)
in data_vme_instd_logic_vector (15 downto 0)
in cyclecounterunsigned (0 downto 0)
in DATA24arr_word (numactchan - 1 downto 0)
in data_vme_instd_logic_vector (15 downto 0)
in data_to_vmestd_logic_vector (width - 1 downto 0)
out mode_controlstd_logic_vector (3 downto 0)
in unstretched_INstd_logic
in bus_drive_from_belowstd_logic_vector
in NDATAstd_logic_vector (numbitsinchan - 1 downto 0)