1 ------------------------------------------------------------------------------- 2 -- File : SynchronizerVector.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2013-07-10 5 -- Last update: 2016-09-13 6 ------------------------------------------------------------------------------- 7 -- Description: Wrapper for multiple SynchronizerVector modules 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 32 BYPASS_SYNC_G : := false;
-- Bypass Synchronizer module for synchronous data configuration 36 clk : in sl;
-- clock to be SYNC'd to 40 end SynchronizerVector;
46 function FillVectorArray (INPUT :
slv)
48 variable retVar : RegArray := (others => (others => '0'));
51 retVar := (others => (others => '0'));
53 for i in WIDTH_G-1 downto 0 loop 60 end function FillVectorArray;
62 constant INIT_C : RegArray := FillVectorArray(INIT_G);
64 signal crossDomainSyncReg : RegArray := INIT_C;
65 signal rin : RegArray;
67 ------------------------------- 68 -- XST/Synplify Attributes 69 ------------------------------- 71 -- ASYNC_REG require for Vivado but breaks ISE/XST synthesis 72 attribute ASYNC_REG : ;
73 attribute ASYNC_REG of crossDomainSyncReg : signal is "TRUE";
75 -- Synplify Pro: disable shift-register LUT (SRL) extraction 76 attribute syn_srlstyle : ;
77 attribute syn_srlstyle of crossDomainSyncReg : signal is "registers";
79 -- These attributes will stop timing errors being reported on the target flip-flop during back annotated SDF simulation. 81 attribute MSGON of crossDomainSyncReg : signal is "FALSE";
83 -- These attributes will stop XST translating the desired flip-flops into an 84 -- SRL based shift register. 85 attribute shreg_extract : ;
86 attribute shreg_extract of crossDomainSyncReg : signal is "no";
88 -- Don't let register balancing move logic between the register chain 89 attribute register_balancing : ;
90 attribute register_balancing of crossDomainSyncReg : signal is "no";
92 ------------------------------- 94 ------------------------------- 95 attribute altera_attribute : ;
96 attribute altera_attribute of crossDomainSyncReg : signal is "-name AUTO_SHIFT_REGISTER_RECOGNITION OFF";
100 assert (STAGES_G >= 2) report "STAGES_G must be >= 2" severity failure;
104 comb :
process (crossDomainSyncReg,
dataIn,
rst)
is 106 for i in WIDTH_G-1 downto 0 loop 118 seq :
process (
clk,
rst)
is 120 if (rising_edge(clk)) then 121 crossDomainSyncReg <= rin after TPD_G;
124 crossDomainSyncReg <= INIT_C after TPD_G;
127 end generate ASYNC_RST;
130 seq :
process (
clk)
is 132 if (rising_edge(clk)) then 134 crossDomainSyncReg <= INIT_C after TPD_G;
136 crossDomainSyncReg <= rin after TPD_G;
140 end generate SYNC_RST;
152 end architecture rtl;
BYPASS_SYNC_Gboolean := false
RST_ASYNC_Gboolean := false
in dataInslv( WIDTH_G- 1 downto 0)
out dataOutslv( WIDTH_G- 1 downto 0)
in rstsl :=not RST_POLARITY_G