在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 6147|回复: 4

[求助] Error (10228): Verilog HDL error at tb_modules.sv(1): module "mod_a" cannot be declared more than once File

[复制链接]
发表于 2019-5-23 11:09:52 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
各位大佬,verilog初学者在hdlbits做题时遇到一个问题,mod_a没有被多次声明啊,为什么一直出现这个错误呢?代码如下:
module top_module ( input a, input b, output out );
    mod_a instance2 ( .out(out), .in1(a), .in2(b) );
endmodule
module mod_a ( input in1, input in2, output out );
    assign out=in1&in2;
endmodule


错误如下:
    Error (10228): Verilog HDL error at tb_modules.sv(1): module "mod_a" cannot be declared more than once File: /var/www/verilog/work/vlghG3SJN_dir/tb_modules.sv Line: 1Info (10499): HDL info at top_module.v(4): see declaration for object "mod_a" File: /var/www/verilog/work/vlghG3SJN_dir/top_module.v Line: 4Info (12021): Found 0 design units, including 0 entities, in source file tb_modules.svError: Quartus Prime Analysis & Synthesis was unsuccessful. 1 error, 1 warning    Error: Peak virtual memory: 1036 megabytes    Error: Processing ended: Wed May 22 23:04:58 2019    Error: Elapsed time: 00:00:00    Error: Total cpu time (on all processors): 00:00:01Error (23031): Evaluation of Tcl script /var/www/verilog/template/compile.tcl unsuccessfulError: Quartus Prime Shell was unsuccessful. 7 errors, 1 warning    Error: Peak virtual memory: 902 megabytes    Error: Processing ended: Wed May 22 23:04:59 2019    Error: Elapsed time: 00:00:03    Error: Total CPU time (on all processors): 00:00:02


发表于 2019-5-24 14:28:07 | 显示全部楼层
你这些代码放在一个.v里面的?分成两个试试看,然后放到一个filelist里面。
 楼主| 发表于 2019-5-25 15:10:21 | 显示全部楼层
大佬大佬,这是这道题的网址https://hdlbits.01xz.net/wiki/Module,他只留了一个空让写代码module top_module ( input a, input b, output out );
endmodule


发表于 2019-5-28 18:54:05 | 显示全部楼层
后面三行去掉,不需要定义mod_a
发表于 2019-5-28 19:31:52 | 显示全部楼层


我要学设计 发表于 2019-5-25 15:10
大佬大佬,这是这道题的网址https://hdlbits.01xz.net/wiki/Module,他只留了一个空让写代码module top_mod ...


这个网站好神奇!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-3-28 23:36 , Processed in 0.021534 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表