| 1 |
library ieee ; |
| 2 |
use ieee.std_logic_1164.all ; |
| 3 |
|
| 4 |
entity reset_synchronizer is |
| 5 |
generic ( |
| 6 |
INPUT_LEVEL : std_logic := '1' ; |
| 7 |
OUTPUT_LEVEL : std_logic := '1' |
| 8 |
) ; |
| 9 |
port ( |
| 10 |
clock : in std_logic ; |
| 11 |
async : in std_logic ; |
| 12 |
sync : out std_logic |
| 13 |
) ; |
| 14 |
end entity ; |
| 15 |
|
| 16 |
architecture arch of reset_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 {*reset_synchronizer:*|*}] """; |
| 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, async ) |
| 33 |
begin |
| 34 |
if( async = INPUT_LEVEL ) then |
| 35 |
sync <= OUTPUT_LEVEL ; |
| 36 |
reg0 <= OUTPUT_LEVEL ; |
| 37 |
reg1 <= OUTPUT_LEVEL ; |
| 38 |
elsif( rising_edge( clock ) ) then |
| 39 |
sync <= reg1 ; |
| 40 |
reg1 <= reg0 ; |
| 41 |
reg0 <= not OUTPUT_LEVEL ; |
| 42 |
end if ; |
| 43 |
end process ; |
| 44 |
|
| 45 |
end architecture ; |
| 46 |
|