1
0
mirror of synced 2026-01-23 02:58:29 +00:00
Patrick Urban acb993b27b 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.
2021-11-13 21:53:25 +01:00

16 lines
285 B
Verilog

module dff ( input d, clk, output reg q );
always @( posedge clk )
q <= d;
endmodule
module dffe( input d, clk, en, output reg q );
`ifndef NO_INIT
initial begin
q = 0;
end
`endif
always @( posedge clk )
if ( en )
q <= d;
endmodule