如果VHDL调用无限递归函数会怎样?

时间:2018-08-07 08:50:41

标签: vhdl

如果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;

0 个答案:

没有答案
相关问题