yosys/tests/arch/common/dffs.v

16 lines
285 B
Verilog
Raw Normal View History

2019-10-18 05:50:24 -05:00
module dff ( input d, clk, output reg q );
always @( posedge clk )
q <= d;
endmodule
2019-10-18 05:50:24 -05:00
module dffe( input d, clk, en, output reg q );
`ifndef NO_INIT
initial begin
2019-10-18 05:50:24 -05:00
q = 0;
end
`endif
2019-10-18 05:50:24 -05:00
always @( posedge clk )
if ( en )
q <= d;
endmodule