1 ------------------------------------------------------------------------------- 2 -- File : Synchronizer.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2013-05-13 5 -- Last update: 2016-09-13 6 ------------------------------------------------------------------------------- 7 -- Description: A simple multi Flip FLop synchronization module. 8 -- Sets attributes to keep synthesis for mucking with FF chain. 9 ------------------------------------------------------------------------------- 10 -- This file is part of 'SLAC Firmware Standard Library'. 11 -- It is subject to the license terms in the LICENSE.txt file found in the 12 -- top-level directory of this distribution and at: 13 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 14 -- No part of 'SLAC Firmware Standard Library', including this file, 15 -- may be copied, modified, propagated, or distributed except according to 16 -- the terms contained in the LICENSE.txt file. 17 ------------------------------------------------------------------------------- 20 use ieee.std_logic_1164.
all;
25 --! @ingroup base_sync 33 BYPASS_SYNC_G : := false;
-- Bypass Synchronizer module for synchronous data configuration 36 clk : in sl;
-- clock to be SYNC'd to 46 signal crossDomainSyncReg : slv(STAGES_G-1 downto 0) := INIT_C;
49 ------------------------------- 50 -- XST/Synplify Attributes 51 ------------------------------- 53 -- ASYNC_REG require for Vivado but breaks ISE/XST synthesis 54 attribute ASYNC_REG : ;
55 attribute ASYNC_REG of crossDomainSyncReg : signal is "TRUE";
57 -- Synplify Pro: disable shift-register LUT (SRL) extraction 58 attribute syn_srlstyle : ;
59 attribute syn_srlstyle of crossDomainSyncReg : signal is "registers";
61 -- These attributes will stop timing errors being reported on the target flip-flop during back annotated SDF simulation. 63 attribute MSGON of crossDomainSyncReg : signal is "FALSE";
65 -- These attributes will stop XST translating the desired flip-flops into an 66 -- SRL based shift register. 67 attribute shreg_extract : ;
68 attribute shreg_extract of crossDomainSyncReg : signal is "no";
70 -- Don't let register balancing move logic between the register chain 71 attribute register_balancing : ;
72 attribute register_balancing of crossDomainSyncReg : signal is "no";
74 ------------------------------- 76 ------------------------------- 77 attribute altera_attribute : ;
78 attribute altera_attribute of crossDomainSyncReg : signal is "-name AUTO_SHIFT_REGISTER_RECOGNITION OFF";
82 assert (STAGES_G >= 2) report "STAGES_G must be >= 2" severity failure;
86 comb :
process (crossDomainSyncReg,
dataIn,
rst)
is 99 seq :
process (
clk,
rst)
is 101 if (rising_edge(clk)) then 102 crossDomainSyncReg <= rin after TPD_G;
105 crossDomainSyncReg <= INIT_C after TPD_G;
108 end generate ASYNC_RST;
111 seq :
process (
clk)
is 113 if (rising_edge(clk)) then 115 crossDomainSyncReg <= INIT_C after TPD_G;
117 crossDomainSyncReg <= rin after TPD_G;
121 end generate SYNC_RST;
131 end architecture rtl;
in rstsl :=not RST_POLARITY_G
BYPASS_SYNC_Gboolean := false
RST_ASYNC_Gboolean := false