关于verilog里的module调用问题,例如下,怎么写才能使下例成功运行,谢谢先
`timescale1ns/100psmoduletestbench();rega;//regb;wirec;trrryDUT(.a(a),//.b(b),.c(c));...
`timescale 1ns/100ps
module testbench ();
reg a;
//reg b;
wire c;
trrry DUT (
.a(a),
//.b(b),
.c(c)
);
initial begin
a = 1;
end
endmodule
module trrry(a, c);
input a,
reg b,
output c,
ad ad(.a, .b);
bc bc(.b, .c);
endmodule
module ad(a, b);
input wire a;
output reg b;
always @ (*)
b = a;
endmodule
module bc(b, c);
input wire b;
output reg c;
always @ (*)
c = b;
endmodule 展开
module testbench ();
reg a;
//reg b;
wire c;
trrry DUT (
.a(a),
//.b(b),
.c(c)
);
initial begin
a = 1;
end
endmodule
module trrry(a, c);
input a,
reg b,
output c,
ad ad(.a, .b);
bc bc(.b, .c);
endmodule
module ad(a, b);
input wire a;
output reg b;
always @ (*)
b = a;
endmodule
module bc(b, c);
input wire b;
output reg c;
always @ (*)
c = b;
endmodule 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏30(财富值+成长值)
展开全部
`timescale 1ns/100ps
module testbench ();
reg a;
//reg b;
wire c;
trrry DUT (
.a(a),
//.b(b),
.c(c)
);
initial begin
a = 1;
end
endmodule
module trrry(a, c);
input a;
wire b;
output c;
ad ad(.a, .b);
bc bc(.b, .c);
endmodule
module ad(a, b);
input wire a;
output b;
always @ (*)
b = a;
endmodule
module bc(b, c);
input wire b;
output c;
always @ (*)
c = b;
endmodule
我改了一些,你试试
module testbench ();
reg a;
//reg b;
wire c;
trrry DUT (
.a(a),
//.b(b),
.c(c)
);
initial begin
a = 1;
end
endmodule
module trrry(a, c);
input a;
wire b;
output c;
ad ad(.a, .b);
bc bc(.b, .c);
endmodule
module ad(a, b);
input wire a;
output b;
always @ (*)
b = a;
endmodule
module bc(b, c);
input wire b;
output c;
always @ (*)
c = b;
endmodule
我改了一些,你试试
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询