我正在编写一个小的VHDL进程块,如果尚未设置,我想为变量赋值。输入首先没有任何价值,所以我想知道如果new_ace
仍未初始化或未知,是否有可能将'0'
设置为ace
的内容。
entity rules is
port(
ace : in std_logic := '0'; --Tried setting 0 as default
ace_out : out std_logic
);
end rules;
architecture behavior of gA6_rules is
begin
cards: process(ace)
variable new_ace : std_logic := '0'; --Tried setting 0 as default
begin
if ace = 'U' or ace = 'X' then --Tried checking for unitialized
new_ace := '0';
else
new_ace := ace;
end if;
ace_out <= new_ace; --Next input will be this output
end process;
end behavior;
问题在于,当我模拟我的设计时,它表明ace_out
仍未定义,即使我尝试使用:= '0'
设置它,或者我使用if
语句。 / p>