Recursive Functions Example (VHDL) - Recursive Functions Example (VHDL) - 2022.2 English - UG901

Vivado Design Suite User Guide: Synthesis (UG901)

Document ID
UG901
Release Date
2022-11-16
Version
2022.2 English

Vivado synthesis supports recursive functions. This coding example models an n! function.

function my_func(x : integer) return integer is begin

if R > 1 then

return (R*my_func(R-1));

else

return R;

end if;

end function my_func;