Error handling VHDL错误,即使我生成了一个位文件
我用VHDL编写了这个程序,所有的语法都很好,我也试着仔细检查了所有的端口映射,但是我得到了一些警告,导致程序无法运行,甚至很难生成位文件。。这里有谁能帮忙吗Error handling VHDL错误,即使我生成了一个位文件,error-handling,vhdl,Error Handling,Vhdl,我用VHDL编写了这个程序,所有的语法都很好,我也试着仔细检查了所有的端口映射,但是我得到了一些警告,导致程序无法运行,甚至很难生成位文件。。这里有谁能帮忙吗 library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity topMain is port( clk : in std_logic; alarm : in std_logic_vector (1 downto 0);
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity topMain is
port( clk : in std_logic;
alarm : in std_logic_vector (1 downto 0);
d_open : in std_logic_vector (1 downto 0);
d_closed : in std_logic_vector(1 downto 0);
d_out : out std_logic_vector (1 downto 0));
end topMain;
architecture Behavioral of topMain is
type state_type is (S0,S1,S3);
signal NS, Current_State : state_type;
begin
process (clk, alarm)
begin
if alarm ="11" then
Current_State <= S3; --
elsif rising_edge (clk) then
Current_State <= NS; -- state change
end if;
end process;
--------------------------------
process(Current_State,d_open, d_closed, clk)
begin
case Current_State is
----
when S3 => d_out <= "11";
if (d_open = "10") then
NS <= S3;
elsif (d_closed = "01") then
NS <= S3;
elsif (d_closed = "00") then
NS <= S3;
end if;
----
when S0 => d_out <= "10"; -- open door
if ( d_open = "10" ) then
NS <= S0;
elsif (d_closed= "01") then
NS <= S1;
elsif (d_closed = "10") then
NS <= S0;
else
NS <= S0;
end if;
when S1 => d_out <= "01"; -- open door
if ( d_closed = "01" ) then
NS <= S1;
elsif (d_open <= "10") then
NS <= S0;
elsif (d_open <= "01") then
NS <= S1;
else
NS <= S1;
end if;
end case;
end process;
end Behavioral;
IEEE库;
使用IEEE.STD_LOGIC_1164.ALL;
实体topMain是
端口(时钟:在标准逻辑中;
报警:标准逻辑向量(1到0);
d_打开:在标准逻辑向量中(1到0);
d_闭合:在标准逻辑向量中(1到0);
d_out:out标准逻辑向量(1到0);
端盖;
topMain的架构是
类型状态_类型为(S0、S1、S3);
信号NS,当前状态:状态类型;
开始
过程(时钟、警报)
开始
如果报警=“11”,则
当前状态组合过程的所有分支中未分配NS
信号
进程(当前状态、d\U打开、d\U关闭、clk)
,将推断锁存;另见和
守则:
when S3 => d_out <= "11";
if (d_open = "10") then
ns <= S3;
elsif (d_closed = "01") then
ns <= S3;
elsif (d_closed = "00") then
ns <= S3;
end if;
我没有看到过程灵敏度列表中缺少任何信号,但clk
是
在上一个过程中包括但不需要,因为此过程实现了组合设计。您收到的警告具体是什么?你说“不行”是什么意思?你试过运行模拟吗?如果你想让我们帮助你,你就必须帮助我们。我已经补充了我目前为止在这个问题上得到的所有警告。……嘿,莫顿,我是奥格斯费尔·德克,希尔特·西克特:)。。Hvor præcis tilføjer jeg当其他人到科登时?@abmy:是的,我也是丹麦人,但是为了其他人,让我们保持英语的转换;-)我已经纠正了我以前的回答,因为它不正确。导致锁存的原因不是当其他人=>
时缺少,而是当S3=>
时的if
中缺少else
。请看上面更新的答案。我回家后会试试的。谢谢
...
else
ns <= S0; -- TBD[S0 is only example; use correct value]
end if;