From ed2d642b94b6beb15a97d0f71b561853359d9e33 Mon Sep 17 00:00:00 2001 From: Andreas Neiser Date: Fri, 20 Feb 2015 17:38:11 +0100 Subject: [PATCH] Maybe works --- ADC/source/adc_processor_cfd.vhd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ADC/source/adc_processor_cfd.vhd b/ADC/source/adc_processor_cfd.vhd index 764827d..71396b2 100644 --- a/ADC/source/adc_processor_cfd.vhd +++ b/ADC/source/adc_processor_cfd.vhd @@ -125,12 +125,9 @@ begin state <= RELEASE_DIRECT; elsif READOUT_RX.valid_timing_trg = '1' then state <= CFD_READOUT; - channelselect := 0; -- if there's already new data present, -- start moving the counter already now - if ram_data_sys(channelselect) /= x"00000000" then - ram_counter(channelselect) <= ram_counter(channelselect) + 1; - end if; + ram_counter(channelselect) <= ram_counter(channelselect) + 1; end if; when RELEASE_DIRECT => @@ -159,6 +156,9 @@ begin when CFD_READOUT => if ram_data_sys(channelselect) = x"00000000" then + -- for old channel, decrease count since we found the end + ram_counter(channelselect) <= ram_counter(channelselect) - 1; + -- go to next channel or finish readout if channelselect = 3 then state <= RELEASE_DIRECT; channelselect := 0; -- 2.43.0