verilog 中编译错误:port must be connected to a structural net expression

verilog 中编译错误:port must be connected to a structural net expression

题目
verilog 中编译错误:port must be connected to a structural net expression
module counter8(clk,clr,te,le,a,tf);
input clk,te,le,clr;
input [7:0] a;
output [7:0] tf;
reg [7:0] tf,th;
regth u1(le,a,th);
count u2(clk,clr,te,th,tf);
endmodule
module regth(le,a,thout);
input le;
input [7:0] a;
output [7:0] thout;
reg[7:0] thout;
always@(le)
begin
if(le==1) thout
答案
你的th在counter8中定义为reg类型,而在regth中thout是一个输出信号默认为net类型,所以你在counter8模块中将th传给regth模块的thout就会报这样的错误,模块counter8中th信号只是一个模块之间的连线,所以定义成wire类型应该就可以了.
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
热门考点

超级试练试题库

© 2017-2019 超级试练试题库,All Rights Reserved.