diff options
author | Claire Wolf <claire@symbioticeda.com> | 2020-08-18 17:27:51 +0200 |
---|---|---|
committer | Claire Wolf <claire@symbioticeda.com> | 2020-08-18 17:29:49 +0200 |
commit | 7f767bf2b77e53b63dac5e4e6875a04ccb9b2044 (patch) | |
tree | 2d50d69dd84853b6d16cd97a3a01d38e6c3d4c78 /tests | |
parent | 5ee9349647cd2a77befb47c8c338a2afe9c2d0a8 (diff) | |
parent | f69daf4830b2c101cc0380a18bf5c86692888f12 (diff) | |
download | yosys-7f767bf2b77e53b63dac5e4e6875a04ccb9b2044.tar.gz yosys-7f767bf2b77e53b63dac5e4e6875a04ccb9b2044.tar.bz2 yosys-7f767bf2b77e53b63dac5e4e6875a04ccb9b2044.zip |
Merge branch 'const-func-block-var' of https://github.com/zachjs/yosys into zachjs-const-func-block-var
Signed-off-by: Claire Wolf <claire@symbioticeda.com>
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 |