VHDL进程分配不起作用

时间:2015-10-20 07:29:06

标签: process vhdl variable-assignment

我确实剪下了以下VHDL代码:

signal state_last_pushbutton                    : std_logic;    

process (clk_clk)
begin
    if rising_edge(clk_clk) then
        userleds_external_connection_export(0) <= '0';
    else
        userleds_external_connection_export(0) <= '1';
    end if;

    state_last_pushbutton <= pushbuttons_external_connection_export(0); 

end process;

问题:

为什么信号 state_last_pushbutton 永远不会获得 pushbuttons_external_connection_export(0)的值?在模拟中,它的价值始终是&#39; U&#39;

由于

1 个答案:

答案 0 :(得分:0)

看起来你正在尝试编写一个时钟进程,在这种情况下你应该写这样的东西:

signal state_last_pushbutton : std_logic;    

process (clk_clk)
begin
    if rising_edge(clk_clk) then
      state_last_pushbutton <= pushbuttons_external_connection_export(0); 
    end if;
end process;

这将在时钟的每个上升沿将state_last_pushbutton更新为存储在寄存器或信号pushbuttons_external_connection_export(0)中的值。

您是否检查过pushbuttons_external_connection_export(0)实际设置为某个已知值,以及您的时钟是否正常运行?