mirror of https://github.com/YosysHQ/yosys.git
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.
This commit is contained in:
parent
0a72952d5f
commit
acb993b27b
|
@ -1,7 +1,9 @@
|
||||||
module adff( input d, clk, clr, output reg q );
|
module adff( input d, clk, clr, output reg q );
|
||||||
|
`ifndef NO_INIT
|
||||||
initial begin
|
initial begin
|
||||||
q = 0;
|
q = 0;
|
||||||
end
|
end
|
||||||
|
`endif
|
||||||
always @( posedge clk, posedge clr )
|
always @( posedge clk, posedge clr )
|
||||||
if ( clr )
|
if ( clr )
|
||||||
q <= 1'b0;
|
q <= 1'b0;
|
||||||
|
@ -10,9 +12,11 @@ module adff( input d, clk, clr, output reg q );
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
module adffn( input d, clk, clr, output reg q );
|
module adffn( input d, clk, clr, output reg q );
|
||||||
|
`ifndef NO_INIT
|
||||||
initial begin
|
initial begin
|
||||||
q = 0;
|
q = 0;
|
||||||
end
|
end
|
||||||
|
`endif
|
||||||
always @( posedge clk, negedge clr )
|
always @( posedge clk, negedge clr )
|
||||||
if ( !clr )
|
if ( !clr )
|
||||||
q <= 1'b0;
|
q <= 1'b0;
|
||||||
|
@ -21,9 +25,11 @@ module adffn( input d, clk, clr, output reg q );
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
module dffs( input d, clk, pre, clr, output reg q );
|
module dffs( input d, clk, pre, clr, output reg q );
|
||||||
|
`ifndef NO_INIT
|
||||||
initial begin
|
initial begin
|
||||||
q = 0;
|
q = 0;
|
||||||
end
|
end
|
||||||
|
`endif
|
||||||
always @( posedge clk )
|
always @( posedge clk )
|
||||||
if ( pre )
|
if ( pre )
|
||||||
q <= 1'b1;
|
q <= 1'b1;
|
||||||
|
@ -32,9 +38,11 @@ module dffs( input d, clk, pre, clr, output reg q );
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
module ndffnr( input d, clk, pre, clr, output reg q );
|
module ndffnr( input d, clk, pre, clr, output reg q );
|
||||||
|
`ifndef NO_INIT
|
||||||
initial begin
|
initial begin
|
||||||
q = 0;
|
q = 0;
|
||||||
end
|
end
|
||||||
|
`endif
|
||||||
always @( negedge clk )
|
always @( negedge clk )
|
||||||
if ( !clr )
|
if ( !clr )
|
||||||
q <= 1'b0;
|
q <= 1'b0;
|
||||||
|
|
|
@ -4,9 +4,11 @@ module dff ( input d, clk, output reg q );
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
module dffe( input d, clk, en, output reg q );
|
module dffe( input d, clk, en, output reg q );
|
||||||
|
`ifndef NO_INIT
|
||||||
initial begin
|
initial begin
|
||||||
q = 0;
|
q = 0;
|
||||||
end
|
end
|
||||||
|
`endif
|
||||||
always @( posedge clk )
|
always @( posedge clk )
|
||||||
if ( en )
|
if ( en )
|
||||||
q <= d;
|
q <= d;
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
module top(out, clk, in);
|
module top(out, clk, in);
|
||||||
output [7:0] out;
|
output [7:0] out;
|
||||||
input signed clk, in;
|
input signed clk, in;
|
||||||
reg signed [7:0] out = 0;
|
reg signed [7:0] out;
|
||||||
|
|
||||||
|
`ifndef NO_INIT
|
||||||
|
initial begin
|
||||||
|
out = 0;
|
||||||
|
end
|
||||||
|
`endif
|
||||||
|
|
||||||
always @(posedge clk)
|
always @(posedge clk)
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
read_verilog ../common/adffs.v
|
read_verilog -D NO_INIT ../common/adffs.v
|
||||||
design -save read
|
design -save read
|
||||||
|
|
||||||
hierarchy -top adff
|
hierarchy -top adff
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
read_verilog ../common/dffs.v
|
read_verilog -D NO_INIT ../common/dffs.v
|
||||||
design -save read
|
design -save read
|
||||||
|
|
||||||
hierarchy -top dff
|
hierarchy -top dff
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
read_verilog ../common/shifter.v
|
read_verilog -D NO_INIT ../common/shifter.v
|
||||||
hierarchy -top top
|
hierarchy -top top
|
||||||
proc
|
proc
|
||||||
flatten
|
flatten
|
||||||
|
|
Loading…
Reference in New Issue