Add util_sync_reset helper module

This helper module can be used to make sure that a reset signal is de-asserted
synchronously to a clock signal. This is e.g. required by the AXI spec.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
main
Lars-Peter Clausen 2014-03-24 22:41:00 +01:00
parent ef960a29c7
commit d0e26899a4
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,23 @@
module util_sync_reset (
input async_resetn,
input clk,
output sync_resetn
);
// Keep it asserted for three clock cycles
reg [2:0] reset = 3'b111;
assign sync_resetn = reset[2];
always @(posedge clk or negedge async_resetn) begin
if (async_resetn == 1'b0) begin
reset <= 3'b111;
end else begin
reset <= {reset[1:0], 1'b0};
end
end
endmodule

View File

@ -0,0 +1,13 @@
# ip
source ../scripts/adi_env.tcl
source $ad_hdl_dir/library/scripts/adi_ip.tcl
adi_ip_create util_sync_reset
adi_ip_files util_sync_reset [list \
"util_sync_reset.v" ]
adi_ip_properties_lite util_sync_reset
ipx::save_core [ipx::current_core]