Skip to content

Commit ef9a06d

Browse files
authored
Merge pull request #1322 from diffblue/unconnected_ports1
Verilog: KNOWNBUG test for unconnected module input ports
2 parents 94a3c3d + a595916 commit ef9a06d

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
unconnected_ports1.v
3+
--bound 0
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
--
8+
This fails an assertion.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module my_module(input [31:0] x, y, z = 5);
2+
3+
endmodule
4+
5+
module main();
6+
7+
my_module m1(.x(1), .y(), .z());
8+
9+
// 1800-2017 23.3.3.2 says
10+
// "If left unconnected, the port shall have the default
11+
// initial value corresponding to the data type."
12+
// This is 'x for logic types.
13+
// However, Icarus Verilog, VCS, Questa, Xcelium use 'z.
14+
15+
initial assert (m1.x == 1);
16+
initial assert (m1.y === 'z);
17+
initial assert (m1.z == 5);
18+
19+
my_module m2(/* blank */, 1, /* blank */);
20+
21+
initial assert (m2.x === 'z);
22+
initial assert (m2.y == 1);
23+
initial assert (m2.z == 5);
24+
25+
endmodule

0 commit comments

Comments
 (0)