Skip to content

Instantly share code, notes, and snippets.

@yupferris
Created September 4, 2019 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yupferris/e6f51df3915480c763f35518a6f387b9 to your computer and use it in GitHub Desktop.
Save yupferris/e6f51df3915480c763f35518a6f387b9 to your computer and use it in GitHub Desktop.
Back to basics...
// 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