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:
parent
dafe04d559
commit
f69daf4830
3 changed files with 45 additions and 18 deletions
23
tests/various/const_func_block_var.v
Normal file
23
tests/various/const_func_block_var.v
Normal 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
|
1
tests/various/const_func_block_var.ys
Normal file
1
tests/various/const_func_block_var.ys
Normal file
|
@ -0,0 +1 @@
|
|||
read_verilog const_func_block_var.v
|
Loading…
Add table
Add a link
Reference in a new issue