diff options
author | Claire Wolf <claire@symbioticeda.com> | 2020-08-18 17:32:00 +0200 |
---|---|---|
committer | Claire Wolf <claire@symbioticeda.com> | 2020-08-18 17:32:00 +0200 |
commit | fce5f02a9d0ee4eff9d5622dbba18f9ab4a344b4 (patch) | |
tree | 2d50d69dd84853b6d16cd97a3a01d38e6c3d4c78 /tests | |
parent | 5ee9349647cd2a77befb47c8c338a2afe9c2d0a8 (diff) | |
parent | 7f767bf2b77e53b63dac5e4e6875a04ccb9b2044 (diff) | |
download | yosys-fce5f02a9d0ee4eff9d5622dbba18f9ab4a344b4.tar.gz yosys-fce5f02a9d0ee4eff9d5622dbba18f9ab4a344b4.tar.bz2 yosys-fce5f02a9d0ee4eff9d5622dbba18f9ab4a344b4.zip |
Merge branch 'zachjs-const-func-block-var'
Diffstat (limited to 'tests')
-rw-r--r-- | tests/various/const_func_block_var.v | 23 | ||||
-rw-r--r-- | tests/various/const_func_block_var.ys | 1 |
2 files changed, 24 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 diff --git a/tests/various/const_func_block_var.ys b/tests/various/const_func_block_var.ys new file mode 100644 index 000000000..7c2e85c64 --- /dev/null +++ b/tests/various/const_func_block_var.ys @@ -0,0 +1 @@ +read_verilog const_func_block_var.v |