Skip to content

Commit 8bbc75e

Browse files
authored
Merge pull request #749 from diffblue/nets-implicit
Verilog: add tests for implicit nets
2 parents 5f67dc6 + 84373de commit 8bbc75e

File tree

10 files changed

+89
-0
lines changed

10 files changed

+89
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
implicit1.sv
3+
--bound 0
4+
^file .* line 4: implicit wire main\.O$
5+
^file .* line 4: implicit wire main\.A$
6+
^file .* line 4: implicit wire main\.B$
7+
^EXIT=0$
8+
^SIGNAL=0$
9+
--
10+
^warning: ignoring

regression/verilog/nets/implicit1.sv

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module main;
2+
3+
// implicit nets are allowed in the port connection list of a module
4+
and (O, A, B);
5+
6+
always assert final (O == (A && B));
7+
8+
endmodule
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
KNOWNBUG
2+
implicit2.sv
3+
--bound 0
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
--
9+
The width of the implicit net is set incorrectly.

regression/verilog/nets/implicit2.sv

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module main;
2+
3+
// implicit nets are allowed in the port connection list of a module
4+
and [3:0] (O, A, B);
5+
6+
always assert final (O == (A & B));
7+
always assert final ($bits(O) == 4);
8+
9+
endmodule
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
implicit3.sv
3+
--bound 0
4+
^file .* line 6: implicit wire main\.O$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring

regression/verilog/nets/implicit3.sv

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module main;
2+
3+
wire A, B;
4+
5+
// implicit nets are allowed on the LHS of a continuous assignment
6+
assign O = A & B;
7+
8+
always assert final (O == (A && B));
9+
10+
endmodule
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
KNOWNBUG
2+
implicit4.sv
3+
--bound 0
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
--
9+
The width of the implicit net is set incorrectly.

regression/verilog/nets/implicit4.sv

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module main;
2+
3+
wire [3:0] A, B;
4+
5+
// implicit nets are allowed on the LHS of a continuous assignment
6+
assign O = A & B;
7+
8+
always assert final (O == (A & B));
9+
always assert final ($bits(O) == 4);
10+
11+
endmodule
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
KNOWNBUG
2+
implicit5.sv
3+
--bound 0
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
--
9+
This case should be errored.

regression/verilog/nets/implicit5.sv

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module main;
2+
3+
// implicit nets are not allowed on the RHS of a continuous assignment
4+
assign O = A & B;
5+
6+
endmodule

0 commit comments

Comments
 (0)