aboutsummaryrefslogtreecommitdiffstats
path: root/tests/verilog
diff options
context:
space:
mode:
authorZachary Snow <zach@zachjs.com>2021-03-11 11:49:15 -0500
committerZachary Snow <zach@zachjs.com>2021-03-11 12:36:51 -0500
commitcb9f3b6abfbc769589e5e5ceb2497955a155065c (patch)
tree6307b773dd556c05a8171fbb80999763e9b3c1ab /tests/verilog
parent83fc5cc28b60367a8cd16fb3d7eddb26db304513 (diff)
downloadyosys-cb9f3b6abfbc769589e5e5ceb2497955a155065c.tar.gz
yosys-cb9f3b6abfbc769589e5e5ceb2497955a155065c.tar.bz2
yosys-cb9f3b6abfbc769589e5e5ceb2497955a155065c.zip
verilog: disallow overriding global parameters
It was previously possible to override global parameters on a per-instance basis. This could be dangerous when using positional parameter bindings, hiding oversupplied parameters.
Diffstat (limited to 'tests/verilog')
-rw-r--r--tests/verilog/global_parameter.ys16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/verilog/global_parameter.ys b/tests/verilog/global_parameter.ys
new file mode 100644
index 000000000..a7a3cddc7
--- /dev/null
+++ b/tests/verilog/global_parameter.ys
@@ -0,0 +1,16 @@
+read_verilog -sv <<EOF
+parameter P = 1;
+module example(
+ output integer out
+);
+ assign out = P;
+endmodule
+module top(
+ output integer out
+);
+ example #(2) e1(out);
+endmodule
+EOF
+
+logger -expect error "Can't find object for defparam" 1
+hierarchy