11 use ieee.std_logic_1164.
all;
12 use ieee.std_logic_unsigned.
all;
13 use ieee.std_logic_arith.
all;
15 use UNISIM.VCOMPONENTS.
all;
43 tx_in :
in (
19 downto 0);
-- Input data
45 TxCntl :
in ;
-- CAV* pin (always disabled on CMM)
46 tx_out :
out (
23 downto 0);
-- Output data --it will be modified.
54 -- constant definitions
65 -- Circular 120 MHz readout buffers
68 type circbuf is array (0 to 8) of (7 downto 0);
73 signal byte_pos : (5 downto 0) := (others => '0');
75 -- G-link emulator signal
158 end process;
-- capture buffer
168 readout_rst <= '1';
-- reset signal synchronous with the 40 MHz clock
178 end process;
-- reset_buffer_timing
182 variable phase : := 2;
190 elsif (phase = 8) then
197 word_sel <= "10";
-- write to word 2 while reading from word 0
198 elsif (phase > 5) then
199 word_sel <= "01";
-- write to word 1 while reading from word 2
201 word_sel <= "00";
-- write to word 0 while reading from word 1
209 end if;
-- clock 120 MHz
211 end process;
-- readout_buffer
in tx_instd_logic_vector (19 downto 0)
Glink_Encoder daq_encoderdaq_encoder
reset_buffer_timingCLK_40MHz
std_logic_vector (23 downto 0) daq_encoded
std_logic :='0' readout_rst
std_logic_vector (1 downto 0) :="00" word_sel
Glink_Encoder roi_encoderroi_encoder
std_logic_vector (23 downto 0) roi_encoded
out ROI_BYTEstd_logic_vector (7 downto 0)
in ROI_INstd_logic_vector (19 downto 0)
out daq_byte_outstd_logic_vector (1 downto 0)
out TDisparity_Qstd_logic_vector (5 downto 0)
out readout_rst_outstd_logic
out byte_pos_outstd_logic_vector (5 downto 0)
out word_sel_outstd_logic_vector (1 downto 0)
in DAQ_INstd_logic_vector (19 downto 0)
array (0 to 8 ) of std_logic_vector (7 downto 0) circbuf
out DAQ_ENCODED_DIAGstd_logic_vector (23 downto 0)
out DAQ_BYTEstd_logic_vector (7 downto 0)
std_logic_vector (5 downto 0) :=( others =>'0' ) byte_pos
out tx_outstd_logic_vector (23 downto 0)