projects
/
yosys.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge branch 'const-func-block-var' of https://github.com/zachjs/yosys into zachjs...
[yosys.git]
/
tests
/
various
/
const_func_block_var.v
1
module top(out);
2
function integer operation;
3
input integer num;
4
begin
5
operation = 0;
6
begin : op_i
7
integer i;
8
for (i = 0; i < 2; i = i + 1)
9
begin : op_j
10
integer j;
11
for (j = i; j < i * 2; j = j + 1)
12
num = num + 1;
13
end
14
num = num * 2;
15
end
16
operation = num;
17
end
18
endfunction
19
20
localparam res = operation(4);
21
output wire [31:0] out;
22
assign out = res;
23
endmodule