3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 00:55:32 +00:00

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>
This commit is contained in:
Claire Wolf 2020-08-18 17:27:51 +02:00
commit 7f767bf2b7
3 changed files with 53 additions and 26 deletions

View file

@ -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

View file

@ -0,0 +1 @@
read_verilog const_func_block_var.v