In reply to yaten1993:
I do not understand what you are asking. When I run your first example, I see the static lifetime function behavior
# vsim
# run -all
# 0 factorial=1
# 1 factorial=1
# 2 factorial=1
# 3 factorial=1
# 4 factorial=1
# 5 factorial=1
# 6 factorial=1
# 7 factorial=1
# exit
But when I change the function to having an automatic lifetime
function automatic integer factorial (input [31:0] operand);
I see
# vsim
# run -all
# 0 factorial=1
# 1 factorial=1
# 2 factorial=2
# 3 factorial=6
# 4 factorial=24
# 5 factorial=120
# 6 factorial=720
# 7 factorial=5040
# exit