From: Jan Michel Date: Thu, 14 Jun 2018 14:54:20 +0000 (+0200) Subject: change asynchronous detection of reference time edges X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=114b9a5d7e0be6fec58716b280d4ae92d27df570;p=trbnet.git change asynchronous detection of reference time edges --- diff --git a/special/handler_lvl1.vhd b/special/handler_lvl1.vhd index 5deb004..e4d8bef 100644 --- a/special/handler_lvl1.vhd +++ b/special/handler_lvl1.vhd @@ -143,8 +143,9 @@ signal wrong_polarity : std_logic; signal tmg_edge_ctr : unsigned(15 downto 0); signal tmg_edge_found_i : std_logic; -signal sr0 : std_logic; -signal tmg_edge_async : std_logic; +-- signal sr0 : std_logic; +-- signal tmg_edge_async : std_logic; +signal tmg_reg, tmg_stretch,tmg_reg_last : std_logic; signal buf_STATUS_OUT : std_logic_vector(63 downto 0); signal waiting_for_first : std_logic; @@ -273,29 +274,37 @@ end process MULTIPLE_TRG_FND_PROC; -- Tmg Trigger spike detect ------------------------------------------------------------------------------- - process (tmg_edge_found_i, LVL1_TIMING_TRG_IN) - begin - if ( tmg_edge_found_i = '1') then - tmg_edge_async <= '0'; - elsif rising_edge(LVL1_TIMING_TRG_IN) then - tmg_edge_async <= '1'; - end if; +-- process (tmg_edge_found_i, LVL1_TIMING_TRG_IN) +-- begin +-- if ( tmg_edge_found_i = '1') then +-- tmg_edge_async <= '0'; +-- elsif rising_edge(LVL1_TIMING_TRG_IN) then +-- tmg_edge_async <= '1'; +-- end if; +-- end process; +-- +-- -- Asynchrones Merker-FF eintakten +-- process +-- begin +-- wait until rising_edge(CLOCK); +-- if(tmg_edge_found_i = '1') then +-- sr0 <= '0'; +-- tmg_edge_found_i <= '0'; +-- else +-- sr0 <= tmg_edge_async; +-- tmg_edge_found_i <= sr0; +-- end if; +-- end process; + + tmg_stretch <= (LVL1_TIMING_TRG_IN or tmg_stretch) and not tmg_reg; + process begin + wait until rising_edge(CLOCK); + tmg_reg <= LVL1_TIMING_TRG_IN or tmg_stretch; + tmg_reg_last <= tmg_reg; + tmg_edge_found_i <= tmg_reg and not tmg_reg_last; end process; - -- Asynchrones Merker-FF eintakten - process - begin - wait until rising_edge(CLOCK); - if(tmg_edge_found_i = '1') then - sr0 <= '0'; - tmg_edge_found_i <= '0'; - else - sr0 <= tmg_edge_async; - tmg_edge_found_i <= sr0; - end if; - end process; - - + --------------------------------------------------------------------------- -- Timeout counter for LVL1 ---------------------------------------------------------------------------