signal readout_reset : std_logic := '0';
signal busy_in_adc, busy_in_sys : std_logic_vector(CHANNELS-1 downto 0) := (others => '0');
signal busy_out_adc, busy_out_sys : std_logic_vector(CHANNELS-1 downto 0) := (others => '0');
+
+ type epoch_counter_t is array(CHANNELS - 1 downto 0) of unsigned(23 downto 0);
+ signal epoch_counter : epoch_counter_t;
+
+ --signal trigger_delay : unsigned();
begin
CONF_adc <= CONFIG when rising_edge(CLK_ADC);
busy_out_sys <= busy_out_adc when rising_edge(CLK_SYS);
gen_cfd : for i in 0 to CHANNELS - 1 generate
trigger_gen(i) <= debug_adc(i).Trigger;
+ epoch_counter(i) <= debug_adc(i).EpochCounter when rising_edge(CLK_SYS);
THE_CFD : entity work.adc_processor_cfd_ch
generic map(
READOUT_TX.data_write <= RDO_write_main when rising_edge(CLK_SYS);
READOUT_TX.data <= RDO_data_main when rising_edge(CLK_SYS);
readout_reset <= CONTROL(12) when rising_edge(CLK_SYS);
- statebits <= std_logic_vector(to_unsigned(state_t'pos(state), 8)) when rising_edge(CLK_ADC);
proc_readout : process
variable channelselect : integer range 0 to 3;
end if;
end if;
+ --when TRIG_DLY =>
+
+
when WAIT_BSY =>
busy_in_sys(channelselect) <= '1';
if busy_out_sys(channelselect) = '0' then
when WAIT_RAM =>
busy_in_sys(channelselect) <= '1';
ram_counter(channelselect) <= ram_counter(channelselect) + 1;
+ RDO_data_main <= x"cc" & std_logic_vector(epoch_counter(channelselect));
+ RDO_write_main <= '1';
state <= READOUT;
end if;
end process;
+ statebits <= std_logic_vector(to_unsigned(state_t'pos(state), 8)) when rising_edge(CLK_ADC);
+
PROC_DEBUG_BUFFER : process
variable c : integer range 0 to 3;
begin
DEBUG.InvalidWordCount <= invalid_word_count;
DEBUG.Baseline <= baseline;
DEBUG.LastWord <= input;
+ DEBUG.EpochCounter <= epoch_counter;
-- word checker, needed for ADC phase adjustment
gen_word_checker : for i in 0 to CHANNELS - 1 generate