aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various
diff options
context:
space:
mode:
authorZachary Snow <zach@zachjs.com>2020-12-31 16:14:35 -0700
committerZachary Snow <zach@zachjs.com>2020-12-31 16:17:13 -0700
commit75abd908294c599c9987978175b46196146c9d1d (patch)
treed8aac5e136b6e68ef265c16ca49461527d78df19 /tests/various
parent48d0aeb09483283c46491448304bf04865e176f5 (diff)
downloadyosys-75abd908294c599c9987978175b46196146c9d1d.tar.gz
yosys-75abd908294c599c9987978175b46196146c9d1d.tar.bz2
yosys-75abd908294c599c9987978175b46196146c9d1d.zip
sv: complete support for implied task/function port directions
Diffstat (limited to 'tests/various')
-rw-r--r--tests/various/func_port_implied_dir.sv23
-rw-r--r--tests/various/func_port_implied_dir.ys6
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/various/func_port_implied_dir.sv b/tests/various/func_port_implied_dir.sv
new file mode 100644
index 000000000..0424f1b46
--- /dev/null
+++ b/tests/various/func_port_implied_dir.sv
@@ -0,0 +1,23 @@
+module gate(w, x, y, z);
+ function automatic integer bar(
+ integer a
+ );
+ bar = 2 ** a;
+ endfunction
+ output integer w = bar(4);
+
+ function automatic integer foo(
+ input integer a, /* implicitly input */ integer b,
+ output integer c, /* implicitly output */ integer d
+ );
+ c = 42;
+ d = 51;
+ foo = a + b + 1;
+ endfunction
+ output integer x, y, z;
+ initial x = foo(1, 2, y, z);
+endmodule
+
+module gold(w, x, y, z);
+ output integer w = 16, x = 4, y = 42, z = 51;
+endmodule
diff --git a/tests/various/func_port_implied_dir.ys b/tests/various/func_port_implied_dir.ys
new file mode 100644
index 000000000..b5c22a05b
--- /dev/null
+++ b/tests/various/func_port_implied_dir.ys
@@ -0,0 +1,6 @@
+read_verilog -sv func_port_implied_dir.sv
+hierarchy
+proc
+equiv_make gold gate equiv
+equiv_simple
+equiv_status -assert