3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-10-27 17:59:26 +00:00

Move $dffe to dffs.{v,ys}

This commit is contained in:
Eddie Hung 2019-08-22 12:20:18 -07:00
parent c5754d9e8b
commit 9e537a76b5
4 changed files with 41 additions and 18 deletions

View file

@ -1,5 +1,37 @@
module top
module dff
( input d, clk, output reg q );
always @( posedge clk )
q <= d;
endmodule
module dffe
( input d, clk, en, output reg q );
initial begin
q = 0;
end
always @( posedge clk )
if ( en )
q <= d;
endmodule
module top (
input clk,
input en,
input a,
output b,b1,
);
dff u_dff (
.clk (clk ),
.d (a ),
.q (b )
);
dffe u_ndffe (
.clk (clk ),
.en (en),
.d (a ),
.q (b1 )
);
endmodule