【问题标题】:Error near "output": syntax error, unexpected output, expecting ')'“输出”附近的错误:语法错误,意外输出,期待')'
【发布时间】:2021-09-29 19:43:59
【问题描述】:
module rc_adder4 (
    input logic[2:0]a, b
    output logic[2:0] s, 
    output logic c_out
    );
    logic [3:0] c;

    rc_adder_slice UUT[2:0] (
    .a(a),
    .b(b),
    .c_in(c[2:0]),
    .s(s),
    .c_out(c[3:1])

);

// COMPLETE USING ARRAY INSTANCING

    assign c[0] = 1'b0;// COMPLETE
    assign c_out = c[3];// COMPLETE
    
endmodule

我试图运行这部分,但它说:

“输出”附近:语法错误,意外输出,期待 ')'

谁能帮帮我?

【问题讨论】:

    标签: debugging verilog system-verilog modelsim


    【解决方案1】:

    我使用的模拟器给出了更有意义的错误信息:

        output logic[2:0] s, 
             |
    xmvlog: *E,POLICI: Expecting a comma between adjacent port declarations.
    

    这告诉您需要用逗号分隔所有信号,并且您缺少最后一个 input 和第一个 output 之间的逗号。

    变化:

    input logic[2:0]a, b
    

    到:

    input logic[2:0]a, b,
    //                  ^
    

    有时不同的模拟器可以为您提供更多有用的信息。您可以在 edaplaygroud 上注册一个免费帐户以访问多个模拟器。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-27
      • 2017-12-03
      • 2017-09-12
      • 1970-01-01
      • 1970-01-01
      • 2019-12-06
      • 2013-11-15
      • 1970-01-01
      相关资源
      最近更新 更多