From 4f4537986305a1e2e75c4e1000d356c292ed6f7e Mon Sep 17 00:00:00 2001 From: Megan Wachs Date: Mon, 21 Aug 2017 14:33:19 -0700 Subject: [PATCH] async_reset_reg: Squash X's the same as for reset reg --- vsrc/AsyncResetReg.v | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/vsrc/AsyncResetReg.v b/vsrc/AsyncResetReg.v index 37fb0402..4158734f 100644 --- a/vsrc/AsyncResetReg.v +++ b/vsrc/AsyncResetReg.v @@ -24,6 +24,19 @@ * */ +`ifdef RANDOMIZE_GARBAGE_ASSIGN +`define RANDOMIZE +`endif +`ifdef RANDOMIZE_INVALID_ASSIGN +`define RANDOMIZE +`endif +`ifdef RANDOMIZE_REG_INIT +`define RANDOMIZE +`endif +`ifdef RANDOMIZE_MEM_INIT +`define RANDOMIZE +`endif + module AsyncResetReg ( input d, output reg q, @@ -32,6 +45,20 @@ module AsyncResetReg ( input clk, input rst); +`ifdef RANDOMIZE + integer initvar; + reg [31:0] _RAND; + initial begin + `ifndef verilator + #0.002 begin end + `endif + `ifdef RANDOMIZE_REG_INIT + _RAND = {1{$random}}; + q = _RAND[0]; + `endif + end +`endif // `ifdef RANDOMIZE + always @(posedge clk or posedge rst) begin if (rst) begin