Created
September 4, 2019 18:17
-
-
Save yupferris/e6f51df3915480c763f35518a6f387b9 to your computer and use it in GitHub Desktop.
Back to basics...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note that the asynchronous reset input, reset_n, should be unconstrained, eg: | |
// set_false_path -from [get_ports {reset_n}] -to [get_clocks {*}] | |
`default_nettype none | |
module reset_synchronizer( | |
input reset_n, | |
input clk, | |
output reset_n_sync); | |
logic ff1, ff2; | |
always_ff @(posedge clk or negedge reset_n) begin | |
if (~reset_n) begin | |
{ ff1, ff2 } <= 2'b0; | |
end | |
else begin | |
{ ff2, ff1 } <= { ff1, 1'b1 }; | |
end | |
end | |
assign reset_n_sync = ff2; | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment