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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 7498|回复: 6

求助顶层文件

[复制链接]
发表于 2009-7-15 16:10:31 | 显示全部楼层 |阅读模式

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

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

x
原程序:

module hwdzq
(       input g_clk,auto,
        output reg [6:0] code,
        output reg high,spks
);
wire [7:0] index;
reg [11:0] tone0;
assign index=q;
tone  tone1(
           .index(index),
            .high(high),
            .code(code),
            .tone0(tone0)
             );
            
            
            
reg m4_clk;            
            
speaker   speaker1(
              .g_clk(g_clk),
              .tone1(tone0),
               .spks(spks),
               .m4_clk(m4_clk)
               );
               
               
               
reg [7:0] index0;              
wire m4_clk1;
assign m4_clk1=m4_clk;
               
automusic    automusic1(
               .m4_clk(m4_clk1),
               .g_clk(g_clk),
               .auto(auto),
               .index0(index0)
              );
              
wire [7:0] index5;            
wire [7:0]data;               
wire we;
reg [7:0] q;
assign we=1'b0;               
assign data=8'd0;               
assign index5=index0;
               
qumu2  qumu21(
.address(index5),
.data(data),
.we(we),
.q(q)
);
endmodule

最后全是这个错误:

Error (10663): Verilog HDL Port Connection error at hwdzq.v(27): output or inout port "high" must be connected to a structural net expression
Error (10663): Verilog HDL Port Connection error at hwdzq.v(28): output or inout port "code" must be connected to a structural net expression
Error (10663): Verilog HDL Port Connection error at hwdzq.v(29): output or inout port "tone0" must be connected to a structural net expression
Error: Can't elaborate top-level user hierarchy
发表于 2009-7-31 09:09:35 | 显示全部楼层
the signal high/code is only a net for connection. You declared it as a reg... that why you have such error message,..
发表于 2010-4-7 21:41:30 | 显示全部楼层
俺也遇到同样的问题,同求!!!!!!!
发表于 2010-4-17 00:59:48 | 显示全部楼层
reg [11:0] tone0;
应该定义为wire吧!其他的你自己好好检查下语法。
发表于 2010-4-17 11:48:58 | 显示全部楼层
例化的模块之间相连的信号定义为wire型,上个例化模块的输出可直接当做下个例化模块的输入,不需要在assign赋值
发表于 2010-4-17 13:50:12 | 显示全部楼层
关于wire型和reg型的使用
模块例化的输出必须连接到wire型,always模块的输出必须为reg型;若module的输出信号也在always中赋值,则在端口声明时必须按如下方式:output reg [SIZE-1:0] sig;
赋值的时候,wire型在always外部使用持续赋值:assign sign = (value),注意使用阻塞赋值;reg型在always内部一般使用非阻塞赋值。
发表于 2010-5-6 17:19:57 | 显示全部楼层
请问到底该怎么修改??
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2025-2-2 14:50 , Processed in 0.033976 second(s), 10 queries , Gzip On, Redis On.

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