Skip to content

Commit 3afb034

Browse files
committed
Verilog: KNOWNBUG test for case with default
1 parent 22d65c3 commit 3afb034

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

regression/verilog/case/mini-alu.desc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
KNOWNBUG
2+
mini-alu.sv
3+
--module alu --bound 0
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
--
9+
The "default:;" in the assertion block causes an invalid expression to be
10+
generated.

regression/verilog/case/mini-alu.sv

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module alu(input [1:0] op, input [31:0] a, b, output reg [31:0] out);
2+
3+
always_comb case(op)
4+
0: out = a + b;
5+
1: out = a - b;
6+
2: out = a >> b;
7+
3: out = a << b;
8+
endcase;
9+
10+
wire clk;
11+
always @(posedge clk) case(op)
12+
default:;
13+
0: assert(out == a + b);
14+
1: assert(out == a - b);
15+
2: assert(out == a >> b);
16+
3: assert(out == a << b);
17+
endcase;
18+
19+
endmodule

0 commit comments

Comments
 (0)