signal eos_ctr : std_logic_vector(3 downto 0);
signal fee_dataready, fee_dataready_q, fee_dataready_qq, fee_dataready_qqq, fee_dataready_qqqq, fee_dataready_qqqqq : std_logic;
- signal temp_data_store : std_logic_vector(6 * 16 - 1 downto 0) := (others => '0');
+ signal temp_data_store : std_logic_vector(8 * 16 - 1 downto 0) := (others => '0');
signal local_read, local_read_q, local_read_qq, local_read_qqq, local_read_qqqq, local_read_qqqqq, local_read_qqqqqq, local_read_qqqqqqq, local_read_qqqqqqqq, local_read_qqqqqqqqq : std_logic := '0';
+ signal fee_t_type : std_logic_vector(3 downto 0);
+
begin
--*********
end if;
end process;
+
+ process(CLK_IPU)
+ begin
+ if rising_edge(CLK_IPU) then
+ if (save_current_state = IDLE) then
+ fee_t_type <= x"0";
+ elsif (save_current_state = PRE_SAVE_DATA and size_check_ctr = 1 and FEE_DATAREADY_IN = '1') then
+ fee_t_type <= FEE_DATA_IN(11 downto 8);
+ else
+ fee_t_type <= fee_t_type;
+ end if;
+ end if;
+ end process;
process(CLK_IPU)
begin
if rising_edge(CLK_IPU) then
if (save_current_state = SAVE_EVT_ADDR) then
- temp_data_store(15 downto 0) <= x"ab" & CTS_READOUT_TYPE_IN & CTS_INFORMATION_IN(3 downto 0);
+ -- middle place is for the trigger type, extracted from FEE stream or from the CTS_READOUT_TYPE_IN
+ temp_data_store(15 downto 0) <= x"ab" & x"0" & CTS_INFORMATION_IN(3 downto 0);
elsif (save_current_state = PRE_SAVE_DATA and FEE_DATAREADY_IN = '1') then
temp_data_store( (size_check_ctr + 2) * 16 - 1 downto (size_check_ctr + 1) * 16) <= FEE_DATA_IN;
else
temp_data_store <= temp_data_store;
end if;
+
+ temp_data_store(7 downto 4) <= fee_t_type;
end if;
end process;