diff options
author | Zachary Snow <zach@zachjs.com> | 2020-08-20 20:09:54 -0400 |
---|---|---|
committer | Zachary Snow <zach@zachjs.com> | 2020-08-20 20:10:24 -0400 |
commit | 74abc3bbfde7477994a0a88f93a69fad5a2a8f23 (patch) | |
tree | 9c6057995690f11df6adaebd2bca348ff94a521f /tests/various | |
parent | 082cbcb4c7c4fa6984f86f8edb2e1d16e8ad3a41 (diff) | |
download | yosys-74abc3bbfde7477994a0a88f93a69fad5a2a8f23.tar.gz yosys-74abc3bbfde7477994a0a88f93a69fad5a2a8f23.tar.bz2 yosys-74abc3bbfde7477994a0a88f93a69fad5a2a8f23.zip |
Allow localparams in constant functions
Diffstat (limited to 'tests/various')
-rw-r--r-- | tests/various/const_func_block_var.v | 9 |
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 |