Commit 4eaf8f24 authored by Dimitris Lampridis's avatar Dimitris Lampridis

hdl: prevent FSM from going through the pre-trigger state, if there are no…

hdl: prevent FSM from going through the pre-trigger state, if there are no pre-trigger samples to be acquired. Fixes the error in the samples counter register when pre_trigger samples was zero.
parent f8384514
......@@ -1212,8 +1212,12 @@ begin
when IDLE =>
if acq_start = '1' and acq_config_ok = '1' then
if unsigned(pre_trig_value) = to_unsigned(0, pre_trig_value'length) then
acq_fsm_current_state <= WAIT_TRIG;
else
acq_fsm_current_state <= PRE_TRIG;
end if;
end if;
when PRE_TRIG =>
if acq_stop = '1' then
......@@ -1249,10 +1253,14 @@ begin
else
if shots_done = '1' then
acq_fsm_current_state <= IDLE;
else
if unsigned(pre_trig_value) = to_unsigned(0, pre_trig_value'length) then
acq_fsm_current_state <= WAIT_TRIG;
else
acq_fsm_current_state <= PRE_TRIG;
end if;
end if;
end if;
when others =>
acq_fsm_current_state <= IDLE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment