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

Allow blocks with declarations within constant functions

This commit is contained in:
Zachary Snow 2020-07-25 10:16:12 -06:00
parent dafe04d559
commit f69daf4830
3 changed files with 45 additions and 18 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