【问题标题】:Verilog testbench error multiplex 4x1 using EDAPlaygroundVerilog 测试台错误多路复用器 4x1 使用 EDA Playground
【发布时间】:2021-01-23 20:49:01
【问题描述】:

我正在使用 EDAPlayground 在 Verilog 中执行 Multiplex 4x1,但我仍然遇到测试台错误,我不知道为什么。

这里有一个错误:

ERROR VCP2000 “语法错误。意外的标记:and[_AND]。” “设计.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, s1, x2);
  or (out_mux1, out_x1, out_x2);

// mux2x1_2
  not (s1_inv, s1);
  and (out_x3, s1_inv, x3);
  and (out_x4, s1, x4);
  or (out_mux2, out_x3, out_x4);
  
// mux4x1
  not (s0_inv, s0)
  and (out_mux3, s0_inv, out_mux1);
  and (out_mux4, s0_inv, out_mux2);
  or (f, out_mux3, out_mux4);
endmodule 

链接:https://www.edaplayground.com/x/bkNc

【问题讨论】:

    标签: verilog edaplayground


    【解决方案1】:

    当我尝试只编译您的设计代码时,我收到此错误:

      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 以查看不同的错误消息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多