如何解决使用EDAPlayground的Verilog Testbench错误多路复用4x1
我正在使用EDAPlayground在Verilog中执行Multiplex 4x1,但是我仍然遇到testbench错误,我也不知道为什么。
ERROR VCP2000“语法错误。意外的令牌:和[_AND]。” “ design.sv” 26 6
module mux4x1(
input x1,x2,x3,x4,s0,s1,output f);
wire s0_inv,out_x1,out_x2;
wire s1_inv,out_x3,out_x4;
wire out_mux1,out_mux2;
wire out_mux3,out_mux4;
// mux2x1_1
not (s1_inv,s1);
and (out_x1,s1_inv,x1);
and (out_x2,x2);
or (out_mux1,out_x2);
// mux2x1_2
not (s1_inv,s1);
and (out_x3,x3);
and (out_x4,x4);
or (out_mux2,out_x4);
// mux4x1
not (s0_inv,s0)
and (out_mux3,s0_inv,out_mux1);
and (out_mux4,out_mux2);
or (f,out_mux3,out_mux4);
endmodule
链接:https://www.edaplayground.com/x/bkNc
解决方法
当我尝试仅编译您的设计代码时,出现此错误:
and (out_mux3,s0_inv,out_mux1);
|
xmvlog: *E,EXPSMC : expecting a semicolon (';') [7.1(IEEE)].
这种类型的错误通常是由报告行的上方行引起的:
not (s0_inv,s0)
只需添加分号:
not (s0_inv,s0);
EDAplayground提供了几种不同的模拟器,有些提供了比其他更有用的错误消息。您已将其设置为Aldec;例如,切换到Cadence,以查看其他错误消息。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。