aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ice40/dffs.v
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ice40/dffs.v')
-rw-r--r--tests/ice40/dffs.v34
1 files changed, 33 insertions, 1 deletions
diff --git a/tests/ice40/dffs.v b/tests/ice40/dffs.v
index d57c8c97c..d97840c43 100644
--- a/tests/ice40/dffs.v
+++ b/tests/ice40/dffs.v
@@ -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