Debian Codegraph @

hdl/fpga/ip/nuand/synthesis/synchronizer.vhd

raw
1 library ieee ;
2 use ieee.std_logic_1164.all ;
3
4 entity synchronizer is
5 generic (
6 RESET_LEVEL : std_logic := '1'
7 ) ;
8 port (
9 reset : in std_logic ;
10 clock : in std_logic ;
11 async : in std_logic ;
12 sync : out std_logic := RESET_LEVEL
13 ) ;
14 end entity ;
15
16 architecture arch of synchronizer is
17
18 attribute ALTERA_ATTRIBUTE : string;
19 attribute PRESERVE : boolean;
20
21 signal reg0, reg1 : std_logic;
22
23 attribute ALTERA_ATTRIBUTE of arch : architecture is "-name SDC_STATEMENT ""set_false_path -to [get_registers {*synchronizer:*|reg0}] """;
24 attribute ALTERA_ATTRIBUTE of reg0 : signal is "-name SYNCHRONIZER_IDENTIFICATION ""FORCED IF ASYNCHRONOUS""";
25 attribute ALTERA_ATTRIBUTE of reg1 : signal is "-name SYNCHRONIZER_IDENTIFICATION ""FORCED IF ASYNCHRONOUS""";
26 attribute PRESERVE of reg0 : signal is TRUE;
27 attribute PRESERVE of reg1 : signal is TRUE;
28 attribute PRESERVE of sync : signal is TRUE;
29
30 begin
31
32 synchronize : process( clock, reset )
33 begin
34 if( reset = '1' ) then
35 sync <= RESET_LEVEL ;
36 reg0 <= RESET_LEVEL ;
37 reg1 <= RESET_LEVEL ;
38 elsif( rising_edge( clock ) ) then
39 sync <= reg1 ;
40 reg1 <= reg0 ;
41 reg0 <= async ;
42 end if ;
43 end process ;
44
45 end architecture ;
46