为什么VHDL程序总是出错?
本帖最后由 fpgaw 于 2010-7-16 10:28 编辑我是刚开始学习VHDL语言,用的是Quartus II 4.0WEB版软件,我编写了很简单的一段程序却总是运行 Analysis & Synthesis时出错。请各位大虾指点:
源程序:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL
ENTITY and2 IS
PORT (a : IN STD_LOGIC;
b : IN STD_LOGIC;
y : OUT STD_LOGIC);
END and2;
ARCHITECTURE behave OF and2 IS
BEGIN
y <= a AND b;
END behave;
出错信息为:
Error: Verilog HDL syntax error at 11.vhd(4) near text "ENTITY";expecting "(", or "'", or "."
Error: VHDL error at 11.vhd(10): entity "and2" is used but not declared
Error: VHDL error at 11.vhd(12): object "y" is used but not declared
Info: Found 0 design units, including 0 entities, in source file 11.vhd
Error: Quartus II Analysis & Synthesis was unsuccessful. 3 errors, 0 warnings
Error: Processing ended: Wed Mar 14 11:11:28 2007
Error: Elapsed time: 00:00:05 抱歉,把VHDL写成了VHDA,在此声明 建议多看看书上的格式<br>
VHDL的格式是比较繁的 VHDL 的编译器使用说明吗 在这个USE ieee.std_logic_1164.ALL语句加个分号; 非常感谢大家给我的建议,5楼的看的很仔细,我加了“;”后,错误少了,就是有一个错误:<br>
Error: Top-level design entity "11" is undefined 我LZ一样也是用的QUARTUS WEB版,现在也在学习中 加上下面的库试一试,有时一个加号都得引库:<br>
USE IEEE.STD_LOGIC_ARITH.ALL;<br>
USE IEEE.STD_LOGIC_UNSIGNED.ALL; 原帖由 tyclr 于 2007-3-14 22:28 发表
http://www.edacn.net/bbs/images/common/back.gif
<br>
非常感谢大家给我的建议,5楼的看的很仔细,我加了“;”后,错误少了,就是有一个错误:<br>
Error: Top-level design entity "11" is undefined 你在保存你的 .vhd 文件时没有保存为 and2.vhd,而是 11.vhd 。<br>
你把你的程序另存为 and2.vhd就好了。 应该在格式方面检查 初学者都是这样的吧
页:
[1]
2