yosys/tests/arch/common/adffs.v

48 lines
768 B
Coq
Raw Normal View History

2019-09-03 03:53:37 -05:00
module adff
( input d, clk, clr, output reg q );
initial begin
q = 0;
end
always @( posedge clk, posedge clr )
if ( clr )
q <= 1'b0;
else
q <= d;
endmodule
module adffn
( input d, clk, clr, output reg q );
initial begin
q = 0;
end
always @( posedge clk, negedge clr )
if ( !clr )
q <= 1'b0;
else
q <= d;
endmodule
module dffs
2019-09-03 03:53:37 -05:00
( input d, clk, pre, clr, output reg q );
initial begin
q = 0;
end
always @( posedge clk )
if ( pre )
2019-09-03 03:53:37 -05:00
q <= 1'b1;
else
q <= d;
endmodule
module ndffnr
2019-09-03 03:53:37 -05:00
( input d, clk, pre, clr, output reg q );
initial begin
q = 0;
end
always @( negedge clk )
2019-09-03 03:53:37 -05:00
if ( !clr )
q <= 1'b0;
else
q <= d;
endmodule