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 and indentation issue with import and "=" for localparam #1272

Open
veripoolbot opened this issue Feb 1, 2018 · 2 comments
Open

alignment and indentation issue with import and "=" for localparam #1272

veripoolbot opened this issue Feb 1, 2018 · 2 comments
Labels

Comments

@veripoolbot
Copy link
Collaborator

@veripoolbot veripoolbot commented Feb 1, 2018


Author Name: Enzo Chi
Original Redmine Issue: 1272 from https://www.veripool.org


I am using verilog-mode from commit "c579c46" and set "verilog-auto-lineup" to "all"

Example code:

module alignment_test
import bar_pkg::*;
     import foo_pkg::*;
     #(
       parameter DATA_WIDTH = 8,
       parameter ADDR_WIDTH = 4
       )
     (
      input wire                  clk,
      input wire                  res_n,
      input wire                  valid,
      input wire [DATA_WIDHT-1:0] data_in,
      input wire [ADDR_WIDTH-1:0] addr,
      output logic                accept
      );

     localparam LP_BAR_0 = 1;
     localparam LP_BAR_100 = 100;
     localparam logic [3:0]       LP_BAR_5 = 5;

endmodule

  1. The first "import" right after the module name is not indent and not aligned with the second one.
  2. The local parameter names are not aligned.
  3. The "=" of local parameters are not aligned.
  4. It looks like the LP_BAR_5 is tried to aligned with the port list. What I think the aligned should be inside scope: {}, (), begin/end, etc

Here is the expected code:

module alignment_test
     import bar_pkg::*;
     import foo_pkg::*;
     #(
         parameter DATA_WIDTH = 8,
         parameter ADDR_WIDTH = 4
     )
     (
         input wire                  clk,
         input wire                  res_n,
         input wire                  valid,
         input wire [DATA_WIDHT-1:0] data_in,
         input wire [ADDR_WIDTH-1:0] addr,
         output logic                accept
      );

     localparam             LP_BAR_0   = 1;
     localparam             LP_BAR_100 = 100;
     localparam logic [3:0] LP_BAR_5   = 5;

endmodule

@veripoolbot
Copy link
Collaborator Author

@veripoolbot veripoolbot commented Feb 2, 2018


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-02-02T00:30:47Z


I agree this isn't what's expected. Please note the indent code is mostly fixed by contributions, so there may be a long wait for a fix unless you can contribute a parch.

@veripoolbot veripoolbot added the indents label Mar 14, 2020
@vinamarora8
Copy link
Contributor

@vinamarora8 vinamarora8 commented Jul 5, 2020

#1683 solves point 2 and 4

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.