vhdl - 尝试编译 VHDL 代码时,“架构”内发生错误
问题描述
我正在尝试为具有 3 个状态的状态机编写代码(+第四个初始状态,在它离开后到达,即在第二个时钟脉冲中)。状态机的输出连接到三个 LED,如果方向为真,则 LED 应按此顺序点亮 100>010>001(循环),如果方向为,则 LED 应按此顺序点亮 001>010> 100。当机器第一次启动时,哪个 LED 亮起并不重要,在我的情况下,我选择无 (000)。问题是,当我尝试编译代码时,我得到以下相当神秘的(至少对于像我这样的初学者)错误消息:
Error occurred within 'ARCHITECTURE' at line 14, column 28 in IC.vhd.
代码中标记了第 86 行。这是完整的输出:
Compiling 'IC.vhd' in 'C:\VHDL\MyProjects'.
VHDL parser (vhdlfe V6.3 IR 35)
Library 'work' => directory 'lc22v10'
Linking 'C:\Program Files\Cypress\Warp\bin\std.vhd'.
Linking 'C:\Program Files\Cypress\Warp\lib\common\cypress.vhd'.
Linking 'C:\Program Files\Cypress\Warp\lib\common\work\cypress.vif'.
Library 'ieee' => directory 'C:\Program Files\Cypress\Warp\lib\ieee\work'
Linking 'C:\Program Files\Cypress\Warp\lib\ieee\work\stdlogic.vif'.
IC.vhd (line 86, col 8): (E0) syntax error
Error occurred within 'ARCHITECTURE' at line 14, column 28 in IC.vhd.
这是我的代码:
library IEEE;
use IEEE.std_logic_1164.all;
entity ic is
port(clk, direction:in std_logic; output:out std_logic_vector(2 dowton 0));
end ic;
architecture Moore of ic is
type latches_state is (st0,st1,st2,st3);
signal state:latches_state;
begin
next_state:process(clk)
begin
if rising_edge(clk) then
case state is
when st0=>
if direction='1' then
state<=st1;
else
state<=st3;
end if;
when st1=>
if direction='1' then
state<=st2;
else
state<=st3;
end if;
when st2=>
if direction='1' then
state<=st3;
else
state<=st1;
end if;
when st3=>
if direction='1' then
state<=st1;
else
state<=st2;
end if;
end case;
end if;
end process next_state;
output-proc:process(state)//This is line 86 (This comment does not exist in the original code I am trying to compile)
begin
if state=st0 then output<="000";
elsif state=st1 then output<="001";
elsif state=st2 then output<="010";
elsif state=st3 then output<="100";
end if;
end process output-pro;
end Moore;
解决方案
推荐阅读
- amazon-dynamodb - 不相关实体的单表设计还是多表设计?
- typescript - 如何在 Typescript 通用约束中为深层对象路径使用文字字符串参数?
- maven - 无法执行目标 org.jenkins-ci.tools:maven-hpi-plug in:3.11:resolve-test-dependencies(default-cli)
- ruby - 如何从 cron 作业调用的脚本中停止服务?
- python - 如何让我的服务器通过 UDP 多播到 Internet 上的客户端?我需要一个特殊的多播 IP 地址吗?
- python - Python,函数,这里发生了什么?如果 lst1[index] != lst2[len(lst2) - 1 - index]
- javascript - 在 Node 中设置 AWS 开发工具包凭证
- ios - 我的 TableView 只列出了 itemArray 中的最后一项?
- amazon-web-services - aws Lex UI 不显示来自其他帐户的 lambda 函数
- django - Django 查询集获得前 3 名用户