summaryrefslogtreecommitdiff
path: root/tests/simple/dff_different_styles.v
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-01-05 11:13:26 +0100
committerClifford Wolf <clifford@clifford.at>2013-01-05 11:13:26 +0100
commit7764d0ba1dcf064ae487ee985c43083a0909e7f4 (patch)
tree18c05b8729df381af71b707748ce1d605e0df764 /tests/simple/dff_different_styles.v
initial import
Diffstat (limited to 'tests/simple/dff_different_styles.v')
-rw-r--r--tests/simple/dff_different_styles.v52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/simple/dff_different_styles.v b/tests/simple/dff_different_styles.v
new file mode 100644
index 00000000..23d89b5d
--- /dev/null
+++ b/tests/simple/dff_different_styles.v
@@ -0,0 +1,52 @@
+
+module dff(clk, d, q);
+input clk, d;
+output reg q;
+always @(posedge clk)
+ q <= d;
+endmodule
+
+module dffa(clk, arst, d, q);
+input clk, arst, d;
+output reg q;
+always @(posedge clk or posedge arst) begin
+ if (arst)
+ q <= 1;
+ else
+ q <= d;
+end
+endmodule
+
+module dffa1(clk, arst, d, q);
+input clk, arst, d;
+output reg q;
+always @(posedge clk or negedge arst) begin
+ if (~arst)
+ q <= 0;
+ else
+ q <= d;
+end
+endmodule
+
+module dffa2(clk, arst, d, q);
+input clk, arst, d;
+output reg q;
+always @(posedge clk or negedge arst) begin
+ if (!arst)
+ q <= 0;
+ else
+ q <= d;
+end
+endmodule
+
+module dffa3(clk, arst, d, q);
+input clk, arst, d;
+output reg q;
+always @(posedge clk or negedge arst) begin
+ if (~(!arst))
+ q <= d;
+ else
+ q <= 1;
+end
+endmodule
+