繁体   English   中英

未找到 Verilog 测试平台模块

[英]Verilog Testbench module not found

我正在尝试制作我的第一个程序测试平台并在详细说明期间出现错误调用“错误:未知模块类型:电路 2 错误。

*** These modules were missing:
        circuit referenced 1 times.
***". 

有人可以帮我吗? 我尝试了不同的调用模块的方法。 这是代码:

module circuit (a,b,c,d,o);
input a,b,c,d;
output o;
wire e,f,g,h,i,j,k,l,m,n;
not (e,a);
not (f,b);
not (g,c);
not (h,d);
and (I,e,g);
and (j,e,f,c,h);
and (k,a,f,g,h);
and (l,a,c);
and (m,b,g,d);
and (n,b,c,d);
or (o,i);
or (o,j);
or (o,k);
or (o,l);
or (o,m);
or (o,n);

endmodule

这是测试台代码

module TB_circuit;  
reg a1,b1,c1,d1;
wire o1;
circuit my_module(a1,b1,c1,d1,o1);
initial
begin
a1=0;
c1=0;
#period;
end
endmodule

两者都是不同的文件,但在同一个文件夹中。 任何帮助,将不胜感激。 谢谢!

您需要将period声明为parameter并将其设置为数值,例如 50:

module TB_circuit;  
    reg a1,b1,c1,d1;
    wire o1;
    parameter period = 50;
    circuit my_module(a1,b1,c1,d1,o1);
initial
begin
    a1=0;
    c1=0;
    #period;
end
endmodule

这是edaplayground上编译的示例。 它是免费的,但您需要注册一个帐户。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM