aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various
diff options
context:
space:
mode:
authorclairexen <claire@symbioticeda.com>2020-09-01 17:31:48 +0200
committerGitHub <noreply@github.com>2020-09-01 17:31:48 +0200
commita10893072b328cdaa00bcd92c1a302494585c60b (patch)
tree49be56ed1e1189dfa0a2652b1ae0bfbfda715023 /tests/various
parentc1a6097376488282c0106ec34e3bde2884c9db2d (diff)
parent74abc3bbfde7477994a0a88f93a69fad5a2a8f23 (diff)
downloadyosys-a10893072b328cdaa00bcd92c1a302494585c60b.tar.gz
yosys-a10893072b328cdaa00bcd92c1a302494585c60b.tar.bz2
yosys-a10893072b328cdaa00bcd92c1a302494585c60b.zip
Merge pull request #2352 from zachjs/const-func-localparam
Allow localparams in constant functions
Diffstat (limited to 'tests/various')
-rw-r--r--tests/various/const_func_block_var.v9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/various/const_func_block_var.v b/tests/various/const_func_block_var.v
index 98e83aa5b..cb60844ab 100644
--- a/tests/various/const_func_block_var.v
+++ b/tests/various/const_func_block_var.v
@@ -1,15 +1,18 @@
module top(out);
function integer operation;
input integer num;
+ localparam incr = 1;
+ localparam mult = 1;
begin
operation = 0;
begin : op_i
integer i;
- for (i = 0; i < 2; i = i + 1)
+ for (i = 0; i * mult < 2; i = i + incr)
begin : op_j
integer j;
- for (j = i; j < i * 2; j = j + 1)
- num = num + 1;
+ localparam other_mult = 2;
+ for (j = i; j < i * other_mult; j = j + incr)
+ num = num + incr;
end
num = num * 2;
end