veripool / verilog-mode

Verilog-Mode for Emacs with Indentation, Hightlighting and AUTOs. Master repository for pushing to GNU, verilog.com and veripool.org.
http://veripool.org/verilog-mode
GNU General Public License v3.0
261 stars 90 forks source link

alignment within generate-if #1404

Open veripoolbot opened 5 years ago

veripoolbot commented 5 years ago

Author Name: Warren Ferguson Original Redmine Issue: 1404 from https://www.veripool.org


I entered the following file and allowed verilog mode (latest verilog-mode.el) to choose its own alignment. Why is the first generate-if using always_comb choosing the unusual alignment of the else block, whereas the generate-if using assigns has the expected alignment?

module test
  #(paramweter integer OPT = 1
     )
    (input logic y,z;
    );

    if (OPT = 1) begin
       always_comb begin
          y = 1'b1;
       end
end else begin
    always_comb begin
       y = 1'b0;
    end
end

    if (OPT = 1) begin
       assign z = 1'b1;
    end else begin
       assign z = 1'b0;
    end

endmodule // test
veripoolbot commented 5 years ago

Original Redmine Comment Author Name: Warren Ferguson Original Date: 2019-02-27T21:38:50Z


Attached source file given that code in text was not interpreted correctly.

veripoolbot commented 5 years ago

Original Redmine Comment Author Name: Wilson Snyder (@wsnyder) Original Date: 2019-03-03T00:55:25Z


Verilog-mode seems to mis-assume always_comb is left-most inside a module.

There might be a wait, generally indentation fixes will need to wait for someone to provide a patch.