aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various/const_func_block_var.v
diff options
context:
space:
mode:
Diffstat (limited to 'tests/various/const_func_block_var.v')
-rw-r--r--tests/various/const_func_block_var.v23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/various/const_func_block_var.v b/tests/various/const_func_block_var.v
new file mode 100644
index 000000000..98e83aa5b
--- /dev/null
+++ b/tests/various/const_func_block_var.v
@@ -0,0 +1,23 @@
+module top(out);
+ function integer operation;
+ input integer num;
+ begin
+ operation = 0;
+ begin : op_i
+ integer i;
+ for (i = 0; i < 2; i = i + 1)
+ begin : op_j
+ integer j;
+ for (j = i; j < i * 2; j = j + 1)
+ num = num + 1;
+ end
+ num = num * 2;
+ end
+ operation = num;
+ end
+ endfunction
+
+ localparam res = operation(4);
+ output wire [31:0] out;
+ assign out = res;
+endmodule