Skip to content

Formatter: non-convergence wrapping a multi-line sum of long macros in a localparam #2547

Description

@kbrunham-intel

verible-verilog-format fails to converge when a localparam is initialized to a sum of several long `MACRO identifiers written across lines. The first format pass puts each + and macro on its own line; the second pass joins the final + onto the last macro, so format(format(x)) != format(x).

Test case

module m;
  localparam N =
      `MACRO_GEN3_SCRAMBLE_LFSR_REGOUT
      + `MACRO_GEN3_SCRAMBLE_REGIN
      + `MACRO_GEN3_SCRAMBLE_REGOUT
      ;
endmodule

Actual output

Re-formatted text does not match formatted text; formatting failed to converge!  Please file a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    formatterVerilog code formatter issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions