From: Andreas Neiser Date: Fri, 20 Feb 2015 16:38:11 +0000 (+0100) Subject: Maybe works X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=ed2d642b94b6beb15a97d0f71b561853359d9e33;p=trb3.git Maybe works --- 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;