1
0

Merge pull request #965 from freechipsproject/quash_x

async_reset_reg: Squash X's the same as for synchronous reg
This commit is contained in:
Megan Wachs 2017-08-21 16:48:25 -07:00 committed by GitHub
commit 6e689f55ed

View File

@ -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 ( module AsyncResetReg (
input d, input d,
output reg q, output reg q,
@ -32,6 +45,20 @@ module AsyncResetReg (
input clk, input clk,
input rst); 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 always @(posedge clk or posedge rst) begin
if (rst) begin if (rst) begin
@ -41,6 +68,5 @@ module AsyncResetReg (
end end
end end
endmodule // AsyncResetReg endmodule // AsyncResetReg