6 use IEEE.STD_LOGIC_1164.
ALL;
7 use IEEE.NUMERIC_STD.
ALL;
25 ncs : in ;
--vme ports
34 --running; modes can be
35 --CONST_DPR_CONTROL_SPY,
36 --CONST_DPR_CONTROL_PLAYBACK,
37 --CONST_DPR_CONTROL_VERIFY
40 --will be interpreted by
43 --determine the data flow
45 --memory steering ports
55 --this should be used to inhibit enb web when memory is being written to or
56 --read from vme on port a, high->inhibit, low->mode_control operation
59 end CMX_input_module_spy_mem_control_FSM;
65 --released, no reads or writes from vme
66 s_inhibit_init, --after r/w request we
68 --inhibit for 2 cycles
69 --so it can be propagated to
71 s_wait_for_vme_write, -- write has been
72 -- requested, FSM waits
73 -- for data writes from VME
74 s_writing_ram, --all data words have been
75 --written to VME, uploading to RAM
76 s_reading_ram, --read has been requested,
78 s_wait_for_vme_read --data has been read from
79 --RAM and presented to VME,
80 --waiting for SW to read it
170 --component vme_outreg
175 -- clk : in std_logic;
176 -- ncs : in std_logic;
177 -- rd_nwr : in std_logic;
178 -- ds : in std_logic;
179 -- addr_vme : in std_logic_vector (15 downto 0);
180 -- data_vme : out std_logic_vector (15 downto 0);
181 -- data_to_vme : in std_logic_vector (width-1 downto 0);
182 -- read_detect : out std_logic);
185 --component vme_inreg
190 -- clk : in std_logic;
191 -- ncs : in std_logic;
192 -- rd_nwr : in std_logic;
193 -- ds : in std_logic;
194 -- addr_vme : in std_logic_vector (15 downto 0);
195 -- data_vme : inout std_logic_vector (15 downto 0);
196 -- data_from_vme : out std_logic_vector (width-1 downto 0);
197 -- data_to_vme : in std_logic_vector (width-1 downto 0);
198 -- read_detect : out std_logic;
199 -- write_detect : out std_logic);
202 --six sets of signals for the data registers
208 --control register signals
215 --signal read_detect_REG_RO_INPUT_SPY_MEM_X_STATUS : std_logic;
218 --the status register
221 --memory that will be
222 --written to (upper 4
223 --bits) and the address
237 --component chipscope_icon_u2_c1
239 -- CONTROL0 : inout std_logic_vector(35 downto 0));
242 --signal CONTROL0 : std_logic_vector(35 downto 0);
244 --component chipscope_ila_CMX_input_module_spy_mem_control_FSM
246 -- CONTROL : inout std_logic_vector(35 downto 0);
247 -- CLK : in std_logic;
248 -- DATA : in std_logic_vector(260 downto 0);
249 -- TRIG0 : in std_logic_vector(15 downto 0));
253 --signal DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM : std_logic_vector(260 downto 0);
254 --signal TRIG0_chipscope_ila_CMX_input_module_spy_mem_control_FSM : std_logic_vector(15 downto 0);
260 --instantiate VME registers
276 vme_data_word_reg_gen: for word_i in 0 to 5 generate
280 ia_vme => ADDR_REG_RW_INPUT_SPY_MEM_X_WORD+
(2*word_i
),
297 --connect the output from RAM to VME for reading by SW
300 end generate vme_data_word_reg_gen;
333 --read_detect => read_detect_REG_RO_INPUT_SPY_MEM_X_STATUS);
336 --klm edit out --we always write/read in the same order
337 --global_addr_counter_next<=global_addr_counter+1;
339 --interpretation of portions of VME registers and connection to output ports
348 --for the control register data to read is simply the data written
351 --data to/from vme is connected to data from/to RAM
355 --data_to_vme... was constructed in the generate loop above
357 --update state on clock edge
360 if rising_edge(clk) then
361 --if state_next=s_writing_ram or (state_next=s_wait_for_vme_read and state_reg=s_reading_ram) then
362 -- if global_addr_counter=to_unsigned(256*numactchan,13) then
363 -- global_addr_counter<=to_unsigned(0,13);
365 -- global_addr_counter<=global_addr_counter_next;
368 -- global_addr_counter<=global_addr_counter;--to_unsigned(0,13);
385 --addra<=(others=>'0');
386 --global_addr_counter<=(others=>'0');
399 when s_inhibit_init =>
407 when s_wait_for_vme_write =>
419 when s_writing_ram =>
429 when s_reading_ram =>
435 when s_wait_for_vme_read =>
456 -- process (state_reg)
458 -- counter_enable<='0';
460 -- when s_counter_running =>
461 -- counter_enable<='1';
462 -- when s_counter_stopped =>
463 -- counter_enable<='0';
464 -- when others => null;
470 --chipscope_ila_CMX_input_module_spy_mem_control_FSM_inst: chipscope_ila_CMX_input_module_spy_mem_control_FSM
472 -- CONTROL => CONTROL0,
474 -- DATA => DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM,
475 -- TRIG0 => TRIG0_chipscope_ila_CMX_input_module_spy_mem_control_FSM);
478 --chipscope_icon_u2_c1_inst: chipscope_icon_u2_c1
480 -- CONTROL0 => CONTROL0);
482 --TRIG0_chipscope_ila_CMX_input_module_spy_mem_control_FSM(0)<=op_request;
483 --TRIG0_chipscope_ila_CMX_input_module_spy_mem_control_FSM(1)<=rw_request;
484 --TRIG0_chipscope_ila_CMX_input_module_spy_mem_control_FSM(2)<=write_detect_REG_RW_INPUT_SPY_MEM_X_CONTROL;
485 --TRIG0_chipscope_ila_CMX_input_module_spy_mem_control_FSM(8 downto 3)<=read_detect_REG_RW_INPUT_SPY_MEM_X_WORD;
486 --TRIG0_chipscope_ila_CMX_input_module_spy_mem_control_FSM(14 downto 9)<=write_detect_REG_RW_INPUT_SPY_MEM_X_WORD;
487 --TRIG0_chipscope_ila_CMX_input_module_spy_mem_control_FSM(15)<=ds;
490 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(0)<=op_request;
491 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(1)<=rw_request;
492 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(2)<=write_detect_REG_RW_INPUT_SPY_MEM_X_CONTROL;
493 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(8 downto 3)<=read_detect_REG_RW_INPUT_SPY_MEM_X_WORD;
494 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(14 downto 9)<=write_detect_REG_RW_INPUT_SPY_MEM_X_WORD;
495 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(27 downto 15)<=std_logic_vector(global_addr_counter);
496 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(31 downto 28)<=status_summary;
497 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(32)<=ena_sig;
498 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(33)<=wea_sig;
499 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(129 downto 34)<=douta;
500 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(225 downto 130)<=dina_sig;
501 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(226)<=ds;
502 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(227)<=rd_nwr;
503 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(243 downto 228)<=addr_vme;
504 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(259 downto 244)<=data_vme;
505 --DATA_chipscope_ila_CMX_input_module_spy_mem_control_FSM(260)<=port_b_master_inhibit_sig;
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 data_from_vmestd_logic_vector (width - 1 downto 0)
in data_vme_from_belowarr_16
--! inputs from local registers and from
out data_from_vmestd_logic_vector (width - 1 downto 0)
out data_vmestd_logic_vector (15 downto 0)
in data_vme_instd_logic_vector (15 downto 0)
out write_detectstd_logic
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 data_to_vmestd_logic_vector (width - 1 downto 0)
out bus_drive_upstd_logic
or of all bus drive requests from below
in addr_vmestd_logic_vector (15 downto 0)
in data_to_vmestd_logic_vector (width - 1 downto 0)
out data_vme_outstd_logic_vector (15 downto 0)
in addr_vmestd_logic_vector (15 downto 0)
in data_vme_instd_logic_vector (15 downto 0)
in data_to_vmestd_logic_vector (width - 1 downto 0)
in bus_drive_from_belowstd_logic_vector