Skip to content

Commit 2f46d49

Browse files
authored
Merge pull request #1317 from diffblue/function_ports3
Verilog: test for function ports
2 parents 5f8de8c + 6c1efdf commit 2f46d49

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
function_ports3.sv
3+
--module main
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
--
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module main;
2+
3+
function [7:0] identity(input [7:0] value);
4+
identity = value;
5+
endfunction
6+
7+
// function ports are 'assignment-like contexts', 1800-2017 10.8,
8+
// and hence, the signed argument is sign extended
9+
assert final(identity(1'sb1) == 8'hff);
10+
11+
endmodule

0 commit comments

Comments
 (0)