如果VHDL调用无限递归函数,在设计中会发生什么?例如。如果我写一些随机代码,例如:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity recursion is
port ( num : in std_logic_vector(15 downto 0);
exor_out : out std_logic_vector(1 downto 0)
);
end recursion;
architecture Behavioral of recursion is
function exor( num : std_logic_vector ) return std_logic_vector is
variable numf : std_logic_vector(num'length-1 downto 0):=(others => '0');
variable exorf : std_logic_vector((num'length/2)-1 downto 0):=(others => '0');
begin
numf := num;
exorf := exor(numf(num'length-1 downto num'length/2)) xor exor(numf((num'length/2)-1 downto 0));
return exorf;
end exor;
begin
exor_out <= exor(num);
end Behavioral;