reset_sync.v 476 B

1234567891011121314151617181920
  1. `timescale 1ns/1ps
  2. // Asynchronous assert, synchronous deassert reset conditioner.
  3. // External KEY_1 is active-low.
  4. module reset_sync(
  5. input wire clk,
  6. input wire reset_n_ext,
  7. output wire reset_n
  8. );
  9. reg [1:0] sync_ff;
  10. always @(posedge clk or negedge reset_n_ext) begin
  11. if (!reset_n_ext)
  12. sync_ff <= 2'b00;
  13. else
  14. sync_ff <= {sync_ff[0], 1'b1};
  15. end
  16. assign reset_n = sync_ff[1];
  17. endmodule