Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alignment within generate-if #1404

Open
veripoolbot opened this issue Feb 27, 2019 · 2 comments
Open

alignment within generate-if #1404

veripoolbot opened this issue Feb 27, 2019 · 2 comments

Comments

@veripoolbot
Copy link
Collaborator


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
Copy link
Collaborator Author


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
Copy link
Collaborator Author


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant