summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-11-18 16:10:50 +0100
committerClifford Wolf <clifford@clifford.at>2013-11-18 16:10:50 +0100
commit2a25e3bca351ad85b328ed808f4efdcf45f6b02c (patch)
treebe06d46f5807c6deb0be8e17f47d694f29c3c937 /tests
parentde031841500ca7ef50daa4bb28c534f8b05dd6ee (diff)
Fixed parsing of default cases when not last case
Diffstat (limited to 'tests')
-rw-r--r--tests/simple/muxtree.v22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/simple/muxtree.v b/tests/simple/muxtree.v
index 6996206c..c5060eae 100644
--- a/tests/simple/muxtree.v
+++ b/tests/simple/muxtree.v
@@ -48,3 +48,25 @@ always @(state or TxValid_i)
end
endmodule
+
+
+// test case inspired by softusb_navre code:
+// default not as last case
+
+module default_cases(a, y);
+
+input [2:0] a;
+output reg [3:0] y;
+
+always @* begin
+ case (a)
+ 3'b000, 3'b111: y <= 0;
+ default: y <= 4;
+ 3'b001: y <= 1;
+ 3'b010: y <= 2;
+ 3'b100: y <= 3;
+ endcase
+end
+
+endmodule
+