1 ------------------------------------------------------------------------------- 2 -- File : SynchronizerOneShot.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-02-06 5 -- Last update: 2016-11-04 6 ------------------------------------------------------------------------------- 7 -- Description: One-Shot Pulser that has to cross clock domains 8 ------------------------------------------------------------------------------- 9 -- This file is part of 'SLAC Firmware Standard Library'. 10 -- It is subject to the license terms in the LICENSE.txt file found in the 11 -- top-level directory of this distribution and at: 12 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 13 -- No part of 'SLAC Firmware Standard Library', including this file, 14 -- may be copied, modified, propagated, or distributed except according to 15 -- the terms contained in the LICENSE.txt file. 16 ------------------------------------------------------------------------------- 19 use ieee.std_logic_1164.
all;
24 --! @ingroup base_sync 27 TPD_G : := 1 ns;
-- Simulation FF output delay 30 BYPASS_SYNC_G : := false;
-- Bypass RstSync module for synchronous data configuration 31 RELEASE_DELAY_G : positive := 3;
-- Delay between deassertion of async and sync resets 34 PULSE_WIDTH_G : positive := 1);
-- one-shot pulse width duration (units of clk cycles) 36 clk : in sl;
-- Clock to be SYNC'd to 40 end SynchronizerOneShot;
48 type RegType is record 54 constant REG_INIT_C : RegType := ( 59 signal r : RegType := REG_INIT_C;
65 -- attribute dont_touch : string; 66 -- attribute dont_touch of r : signal is "true"; 70 RstSync_Inst :
entity work.
RstSync 100 comb :
process (edgeDet, r,
rst)
is 101 variable v : RegType;
103 -- Latch the current value 108 ---------------------------------------------------------------------- 112 -- Check for edge detection 117 ---------------------------------------------------------------------- 128 -- Increment the counter 131 ---------------------------------------------------------------------- 139 -- Register the variable for next clock cycle 147 seq :
process (
clk)
is 149 if rising_edge(clk) then 150 r <= rin after TPD_G;
156 end architecture rtl;
PULSE_WIDTH_Gpositive := 1
RST_ASYNC_Gboolean := false
RELEASE_DELAY_Gpositive := 3
BYPASS_SYNC_Gboolean := false
RST_ASYNC_Gboolean := false
in rstsl :=not RST_POLARITY_G
RELEASE_DELAY_Ginteger range 3 to positive'high:= 3
BYPASS_SYNC_Gboolean := false
BYPASS_SYNC_Gboolean := false