aboutsummaryrefslogtreecommitdiffstats
path: root/tests/arch/common/adffs.v
diff options
context:
space:
mode:
authorPatrick Urban <patrick.urban@web.de>2021-09-24 21:50:26 +0200
committerMarcelina Koƛcielnicka <mwk@0x04.net>2021-11-13 21:53:25 +0100
commitacb993b27b7027112bf10796efbf2886815f8630 (patch)
tree6dbc12ce01fc730770eedfbff7131374b299b5cc /tests/arch/common/adffs.v
parent0a72952d5f259a23f9d1122d936d3d4d60ce224d (diff)
downloadyosys-acb993b27b7027112bf10796efbf2886815f8630.tar.gz
yosys-acb993b27b7027112bf10796efbf2886815f8630.tar.bz2
yosys-acb993b27b7027112bf10796efbf2886815f8630.zip
Allow initial blocks to be disabled during tests
Wrap initial blocks with a NO_INIT so that tests for archs without register initialization feature don't fail.
Diffstat (limited to 'tests/arch/common/adffs.v')
-rw-r--r--tests/arch/common/adffs.v8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/arch/common/adffs.v b/tests/arch/common/adffs.v
index 576bd81a6..966e7c2b8 100644
--- a/tests/arch/common/adffs.v
+++ b/tests/arch/common/adffs.v
@@ -1,7 +1,9 @@
module adff( input d, clk, clr, output reg q );
+`ifndef NO_INIT
initial begin
q = 0;
end
+`endif
always @( posedge clk, posedge clr )
if ( clr )
q <= 1'b0;
@@ -10,9 +12,11 @@ module adff( input d, clk, clr, output reg q );
endmodule
module adffn( input d, clk, clr, output reg q );
+`ifndef NO_INIT
initial begin
q = 0;
end
+`endif
always @( posedge clk, negedge clr )
if ( !clr )
q <= 1'b0;
@@ -21,9 +25,11 @@ module adffn( input d, clk, clr, output reg q );
endmodule
module dffs( input d, clk, pre, clr, output reg q );
+`ifndef NO_INIT
initial begin
q = 0;
end
+`endif
always @( posedge clk )
if ( pre )
q <= 1'b1;
@@ -32,9 +38,11 @@ module dffs( input d, clk, pre, clr, output reg q );
endmodule
module ndffnr( input d, clk, pre, clr, output reg q );
+`ifndef NO_INIT
initial begin
q = 0;
end
+`endif
always @( negedge clk )
if ( !clr )
q <= 1'b0;