FPGA复位信号(高有效)
异步复位同步释放处理方法如下(可作为模块直接调用):
`timescale 1ns/1ps
module async_rst_sync
(
input wire I_dest_clk , // Destination clock
input wire I_aync_rst , // Asynchronous reset signal
output reg O_dest_rst // Synchronized reset signal
);
//***************************************************************************
// Register declarations
//***************************************************************************
reg R_rst_meta; // After sampling the async rst, this has
// a high probability of being metastable.
// The second sampling (O_dest_rst) has
// a much lower probability of being
// metastable
//***************************************************************************
// Code
//***************************************************************************
always @(posedge I_dest_clk) begin
if(I_aync_rst) begin
R_rst_meta <= 1'b1;
O_dest_rst <= 1'b1;
end
else begin
R_rst_meta <= 1'b0;
O_dest_rst <= R_rst_meta;
end
end
endmodule