From 5edf61c40a597f415f22dad990682451eaad39c4 Mon Sep 17 00:00:00 2001 From: Rejeesh Kutty Date: Thu, 13 Aug 2015 12:58:52 -0400 Subject: [PATCH] ad_rst:- allow preset to be synchronized as reset --- library/common/ad_rst.v | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/library/common/ad_rst.v b/library/common/ad_rst.v index 6da76b6c5..a268f3d27 100644 --- a/library/common/ad_rst.v +++ b/library/common/ad_rst.v @@ -34,8 +34,6 @@ // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // *************************************************************************** // *************************************************************************** -// *************************************************************************** -// *************************************************************************** `timescale 1ns/100ps @@ -55,19 +53,16 @@ module ad_rst ( // internal registers - reg rst_p = 'd0; + reg ad_rst_sync_m1 = 'd1; + reg ad_rst_sync = 'd1; reg rst = 'd0; // simple reset gen - always @(posedge clk or posedge preset) begin - if (preset == 1'b1) begin - rst_p <= 1'd1; - rst <= 1'd1; - end else begin - rst_p <= 1'b0; - rst <= rst_p; - end + always @(posedge clk) begin + ad_rst_sync_m1 <= preset; + ad_rst_sync <= ad_rst_sync_m1; + rst <= ad_rst_sync; end endmodule