data/full_repos/permissive/169574047/task_and_func/task_and_func.srcs/sources_1/new/func_auto_factorial.v
'utf-8' codec can't decode byte 0xd3 in position 484: invalid continuation byte
1: b'%Warning-STMTDLY: data/full_repos/permissive/169574047/task_and_func/task_and_func.srcs/sources_1/new/func_auto_factorial.v:46: Unsupported: Ignoring delay on this delayed statement.\n    #5 $finish;\n    ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Error: data/full_repos/permissive/169574047/task_and_func/task_and_func.srcs/sources_1/new/func_auto_factorial.v:31: Found definition of \'factorial\' as a VAR but expected a task/function\n        factorial = factorial(oper-1) * oper;    \n                    ^~~~~~~~~\n%Error: Exiting due to 1 error(s), 1 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module func_auto_factorial;


function automatic integer factorial;
input [31:0] oper;
integer i;
begin
    if(oper >= 2)
        factorial = factorial(oper-1) * oper;
    else
        factorial = 1;
end
endfunction


integer result;
initial
begin
    result = factorial(4);
    $display("Factorial of 4 is %0d", result);
end

initial
    #5 $finish;

endmodule
module func_auto_factorial;



function automatic integer factorial;
input [31:0] oper;
integer i;
begin
    if(oper >= 2)
        factorial = factorial(oper-1) * oper;
    else
        factorial = 1;
end
endfunction


integer result;
initial
begin
    result = factorial(4);
    $display("Factorial of 4 is %0d", result);
end

initial
    #5 $finish;

endmodule