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

Indentation of localparam not working #1134

Closed
veripoolbot opened this issue Mar 9, 2017 · 2 comments
Closed

Indentation of localparam not working #1134

veripoolbot opened this issue Mar 9, 2017 · 2 comments
Labels

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Clarke Watson
Original Redmine Issue: 1134 from https://www.veripool.org

Original Assignee: Michael McNamara


This is related to issue #104. It appears that the current version of verilog-mode.el (Feb 12, 2017) does not handle localparam indentation properly. I have attached an example below.

module test
    (
     // Clock and Reset
     input        reset_n ,
     input        clk ,
     input [7:0]  data_in ,
     output [7:0] data_out);

    // FSM States
    localparam [10:0] FSM_IDLE_ST  = 11'b00000000001 ,
       FSM_LOAD_ST     = 11'b00000000010 ,
       FSM_CHEC_ST     = 11'b00000000100 ,
       FSM_WAIT_ST   = 11'b00000001000 ,
       FSM_SSLO_ST      = 11'b00000010000 ,
       FSM_STAR_ST       = 11'b00000100000 ,
       FSM_PROF_ST     = 11'b00001000000 ,
       FSM_STOP_ST        = 11'b00010000000 ,
       FSM_WAIT_ST     = 11'b00100000000 ,
       FSM_FINI_ST      = 11'b01000000000 ,
       FSM_ERRO_ST       = 11'b10000000000 ;

endmodule


These are my settings:

(setq
       verilog-auto-delete-trailing-whitespace		t
       verilog-auto-endcomments         			t
       verilog-auto-indent-on-newline   			t
       verilog-auto-lineup              			'all
       verilog-auto-newline             			t
       verilog-auto-template-warn-unused			t
       verilog-auto-wire-comment				nil
       verilog-case-indent              			3
       verilog-cexp-indent              			3
       verilog-highlight-p1800-keywords 			nil
       verilog-indent-being-after-if			t
       verilog-indent-level             			3
       verilog-indent-level-module      			3
       verilog-indent-level-declaration 			3
       verilog-indent-level-behavioral  			3
       verilog-indent-level-directive   			1
       verilog-indent-lists				t
       verilog-minimum-comment-distance 			40
       verilog-tab-always-indent        			t
       )

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Kaushal Modi
Original Date: 2017-05-09T19:21:45Z


Add @bit@ keyword before @[10:0]@.

Starting off with

module test
    (
     // Clock and Reset
     input        reset_n ,
     input        clk ,
     input [7:0]  data_in ,
     output [7:0] data_out);

    // FSM States
    localparam bit [10:0] FSM_IDLE_ST  = 11'b00000000001 , // Add bit keyword here
       FSM_LOAD_ST     = 11'b00000000010 ,
       FSM_CHEC_ST     = 11'b00000000100 ,
       FSM_WAIT_ST   = 11'b00000001000 ,
       FSM_SSLO_ST      = 11'b00000010000 ,
       FSM_STAR_ST       = 11'b00000100000 ,
       FSM_PROF_ST     = 11'b00001000000 ,
       FSM_STOP_ST        = 11'b00010000000 ,
       FSM_WAIT_ST     = 11'b00100000000 ,
       FSM_FINI_ST      = 11'b01000000000 ,
       FSM_ERRO_ST       = 11'b10000000000 ;

endmodule

  1. @c-x h@
  2. @c-m @
  3. @c-c =@ (with point on @localparam@ line for example)

I get:

module test
  (
    // Clock and Reset
    input        reset_n ,
    input        clk ,
    input [7:0]  data_in ,
    output [7:0] data_out);

    // FSM States
    localparam bit [10:0] FSM_IDLE_ST = 11'b00000000001 ,
                          FSM_LOAD_ST = 11'b00000000010 ,
                          FSM_CHEC_ST = 11'b00000000100 ,
                          FSM_WAIT_ST = 11'b00000001000 ,
                          FSM_SSLO_ST = 11'b00000010000 ,
                          FSM_STAR_ST = 11'b00000100000 ,
                          FSM_PROF_ST = 11'b00001000000 ,
                          FSM_STOP_ST = 11'b00010000000 ,
                          FSM_WAIT_ST = 11'b00100000000 ,
                          FSM_FINI_ST = 11'b01000000000 ,
                          FSM_ERRO_ST = 11'b10000000000 ;

endmodule

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Clarke Watson
Original Date: 2017-05-15T18:15:16Z


That solves the issue. Thanks!

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

No branches or pull requests

1 participant