4213|4

275

帖子

0

TA的资源

纯净的硅(初级)

楼主
 

多个vhdl源文件编译出错,请求指点 [复制链接]

此程序为以个全加器,
第一段代码:
library ieee;
use ieee.std_logic_1164.all;
entity h_adder is
port(a,b:in std_logic;
     co,so:out std_logic);
end h_adder;
architecture fh1 of h_adder is
begin
so<=a and(a nand b);
co<=not(a nand b);
end fh1;
第二段代码:
library ieee;
use ieee.std_logic_1164.all;
entity bianyi is
port(a,b:in std_logic;
       c:out std_logic);
end bianyi;
architecture f1 of bianyi is
begin
c<=a or b;
end f1;
第三段代码,用元件例化语句调用上面2个模块
library ieee;
use ieee.std_logic_1164.all;

entity f_adder is
port(ain,bin,cin:in std_logic;
       cout,sum:out std_logic);
end f_adder;

architecture yange of f_adder is
begin
component h_adder
port(a,b:in std_logic;
     co,so:out std_logic);
end component;

component bianyi
   port(a,b:in std_logic;
          c:out std_logic);
end component;

signal d,e,f :std_logic;
begin
u1:h_adder port map(a=>ain,b=>bin,co=>d,so=>e);
u2:h_adder port map(a=>e,b=>cin,co=>f,so=>sum);
u3: bianyi port map(a=>d,b=>f,co=>cout);
end yange;

用元件例化语句调用其他两个源文件生成一个SCH图时出现错误,我反复查看没有找不出问题,
求各位大侠指点下,看时哪里错了,我首次把多个文件整合起来,谢谢。
出现的错误如下:
Error (10500): VHDL syntax error at f_adder.vhdl(11) near text "component";  expecting "end", or "(", or an identifier ("component" is a reserved keyword), or a concurrent statement
Error (10500): VHDL syntax error at f_adder.vhdl(12) near text ":";  expecting ")", or ","
Error (10500): VHDL syntax error at f_adder.vhdl(17) near text ":";  expecting ")", or ","
Error (10500): VHDL syntax error at f_adder.vhdl(22) near text "begin";  expecting "end", or "(", or an identifier ("begin" is a reserved keyword), or a concurrent statement
Error: Quartus II Create Symbol File was unsuccessful. 4 errors, 0 warnings
        Error: Peak virtual memory: 170 megabytes
        Error: Processing ended: Wed Jul 27 15:05:05 2011
        Error: Elapsed time: 00:00:01
        Error: Total CPU time (on all processors): 00:00:02
此帖出自FPGA/CPLD论坛

最新回复

不客气,欢迎常来!  详情 回复 发表于 2011-7-28 08:59
点赞 关注
 

回复
举报

275

帖子

0

TA的资源

纯净的硅(初级)

沙发
 
自己现顶下,增加点人气
此帖出自FPGA/CPLD论坛
 
 

回复

6892

帖子

0

TA的资源

五彩晶圆(高级)

板凳
 

architecture yange of f_adder is
begin

 

上面多了一个BEGIN!

此帖出自FPGA/CPLD论坛
个人签名一个为理想不懈前进的人,一个永不言败人!
http://shop57496282.taobao.com/
欢迎光临网上店铺!
 
 
 

回复

275

帖子

0

TA的资源

纯净的硅(初级)

4
 
太感谢了,这次调试成功对我有特数意义,说明我已经初步会使用多个source文件,相互调用,也会使用了元件例化语句。再次感谢指导,谢谢。
此帖出自FPGA/CPLD论坛
 
 
 

回复

6892

帖子

0

TA的资源

五彩晶圆(高级)

5
 

不客气,欢迎常来!

此帖出自FPGA/CPLD论坛
个人签名一个为理想不懈前进的人,一个永不言败人!
http://shop57496282.taobao.com/
欢迎光临网上店铺!
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表