Skip to content

Title: Formatter: syntax error on macro mixed with named parameters in instantiation parameter list #2537

Description

@somyadashora

verible-verilog-format fails to parse a macro appearing alongside named parameter assignments in an instantiation parameter list. A macro as the entire param list parses fine.

    // fails: syntax error at token "`MY_PARAM_INST"
    module top;
      sub #(.W(8), 
                `MY_PARAM_INST)
      u_sub (.clk(clk));
    endmodule
$ verible-verilog-format --failsafe_success=false - < repro.sv
-: <stdin>:2:16-29: syntax error at token "`MY_PARAM_INST"
Macro-first also fails (#(MY_PARAM_INST, .W(8))→ syntax error at token "."), and a macro in a port *connection* list fails lexical-equivalence verification. 
Works:#(MY_PARAM_INST) alone, and a macro on its own line as a module item.

Version: v0.0-4080-ga0a8d8eb. Since the formatter parses the whole file, one such line makes the entire file unformattable, including --lines ranges elsewhere.

Related: #812 (macro in port declaration), #2289 (macros in delay/always positions).

Sources: #812, #2289

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions