异步复位的问题:
可能不满足建立时间的要求,给电路引入毛刺。
解决:
寄存器打两拍,作为新的复位信号。
module asyn_rstn_syn_re(
input clk ,
input rstn ,
output reg rstn_out
);
reg rstn_1;
always @(posedge clk or negedge rstn)begin
if(!rstn)begin
rstn_1 <= 1'b0;
rstn_out <= 1'b0;
end
else begin
rstn_1 <= rstn;
rstn_out <= rstn_1;
end
end
endmodule