2020-07-25 11:16:12 -05:00
|
|
|
module top(out);
|
|
|
|
function integer operation;
|
|
|
|
input integer num;
|
2020-08-20 19:09:54 -05:00
|
|
|
localparam incr = 1;
|
|
|
|
localparam mult = 1;
|
2020-07-25 11:16:12 -05:00
|
|
|
begin
|
|
|
|
operation = 0;
|
|
|
|
begin : op_i
|
|
|
|
integer i;
|
2020-08-20 19:09:54 -05:00
|
|
|
for (i = 0; i * mult < 2; i = i + incr)
|
2020-07-25 11:16:12 -05:00
|
|
|
begin : op_j
|
|
|
|
integer j;
|
2020-08-20 19:09:54 -05:00
|
|
|
localparam other_mult = 2;
|
|
|
|
for (j = i; j < i * other_mult; j = j + incr)
|
|
|
|
num = num + incr;
|
2020-07-25 11:16:12 -05:00
|
|
|
end
|
|
|
|
num = num * 2;
|
|
|
|
end
|
|
|
|
operation = num;
|
|
|
|
end
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
localparam res = operation(4);
|
|
|
|
output wire [31:0] out;
|
|
|
|
assign out = res;
|
|
|
|
endmodule
|