我是数字模拟的新手,我已经编写了下面的代码。它只适用于一个显示段,在这种情况下是' e。我使用http://www.edaplayground.com/来尝试模拟它,但每当我尝试运行它时我都会得到下一个:
testbench.sv:13:错误:无法绑定wire / reg /内存Seg_e `Seg_e_testbench'精心制作期间出现1个错误。退出代码预期: 0,收到:1
module Seg_e (
output reg seg,
input [3: 0] BCD
);
parameter ZERO = 1'b0;
parameter ONE = 1'b1;
always @ (BCD)
case (BCD)
0: seg = ONE;
1: seg = ZERO;
2: seg = ONE;
3: seg = ZERO;
4: seg = ZERO;
5: seg = ZERO;
6: seg = ONE;
7: seg = ZERO;
8: seg = ONE;
9: seg = ZERO;
default: seg = ZERO;
endcase
endmodule
module Seg_e_testbench;
wire seg;
reg [3: 0] BCD;
parameter ZERO = 1'b0;
parameter ONE = 1'b1;
initial #250 $finish;
initial fork
$dumpfile("dump.vcd");
$dumpvars(1,Seg_e);
#10 BCD = 0;
#20 BCD = 1;
#30 BCD = 2;
#40 BCD = 3;
#50 BCD = 4;
#60 BCD = 5;
#70 BCD = 6;
#80 BCD = 7;
#90 BCD = 8;
#100 BCD = 9;
join
Seg_e M0 (seg, BCD);
endmodule
答案 0 :(得分:2)
指定模块实例名称,而不是$dumpvars
语句中的模块名称:
$dumpvars(1, M0);
请参阅IEEE Std 1800-2012,“21.7.1.2指定要转储的变量($ dumpvars)”部分。
答案 1 :(得分:-1)
您应该提供测试平台的模块实例名称或模块名称( Seg_e_testbench ),而不是设计的模块名称。
http://www.referencedesigner.com/tutorials/verilog/verilog_62.php