if rising_edge(CLK) then
if RESET = '1' then
lvl1_data_counter <= (others => '0');
- elsif LVL1_START_fsm_currentstate = SAVE_ADD_DATA_3 then
+ elsif LVL1_START_fsm_currentstate = SAVE_ADD_DATA_2 then
lvl1_data_counter <= words_in_event - 3 - HOW_MANY_ADD_DATA;
elsif LVL1_START_fsm_currentstate = SAVE_ADD_DATA_4 and lvl1_data_counter > 0 then
lvl1_data_counter <= lvl1_data_counter - 1;
end if;
end if;
end process COUNT_WORDS_IN_EVENT;
- TRIGGER_COUNTER_PROC : process (CLK, RESET)
+ TRIGGER_COUNTER_PROC : process (CLK, RESET, LVL1_START_fsm_currentstate)
begin
if rising_edge(CLK) then
if RESET = '1' then
trigger_counter <= (others => '1');
- elsif trigger_with_gen_pulse = '1' then
+ elsif LVL1_START_fsm_currentstate = SEND_LVL1_TRIGG_1 then
trigger_counter <= trigger_counter + 1;
else
trigger_counter <= trigger_counter;