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
253 stars 90 forks source link

endclocking not indented properly on default clocking blocks #1457

Closed veripoolbot closed 5 years ago

veripoolbot commented 5 years ago

Author Name: Paul Donahue Original Redmine Issue: 1457 from https://www.veripool.org

Original Assignee: Wilson Snyder (@wsnyder)


Clocking blocks seem to indent appropriately with verilog-batch-indent but default clocking blocks (IEEE 1800-2017 section 14.12) don't.

Here's what I'm using: $ emacs --batch --no-init-file --no-site-file -l verilog-mode.el -f verilog-version Using verilog-mode version 2019-05-06-28bee25-vpo $ emacs --version GNU Emacs 25.3.1 Copyright (C) 2017 Free Software Foundation, Inc. GNU Emacs comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of GNU Emacs under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING.

Here's the before and after of the simplest default clocking block: $ cat ~/foo.sv module top; default clocking @(posedge clk); endclocking endmodule $ emacs --batch --no-init-file --no-site-file -l verilog-mode.el ~/foo.sv -f verilog-batch-indent Processing /home/pdonahue/foo.sv Indenting region... Indenting region...done $ cat ~/foo.sv module top; default clocking @(posedge clk); endclocking endmodule

The beginning of the block was correctly moved from 2 to 3 spaces of indentation. The endclocking doesn't align with it, though.

Thanks,

-Paul

veripoolbot commented 5 years ago

Original Redmine Comment Author Name: Paul Donahue Original Date: 2019-06-05T21:48:47Z


That didn't look good at all. I misunderstood the user interface on preview vs. create. Here's the original description with reasonable formatting:

Here's what I'm using:

$ emacs --batch --no-init-file --no-site-file -l verilog-mode.el -f verilog-version
Using verilog-mode version 2019-05-06-28bee25-vpo
$ emacs --version
GNU Emacs 25.3.1
Copyright (C) 2017 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

Here's the before and after of the simplest default clocking block:

$ cat ~/foo.sv
module top;
  default clocking @(posedge clk);
  endclocking
endmodule
$ emacs --batch --no-init-file --no-site-file -l verilog-mode.el ~/foo.sv -f verilog-batch-indent
Processing /home/pdonahue/foo.sv
Indenting region...
Indenting region...done
$ cat ~/foo.sv
module top;
    default clocking @(posedge clk);
endclocking
endmodule

The beginning of the block was correctly moved from 2 to 3 spaces of indentation. The endclocking doesn't align with it, though.

Thanks,

-Paul

veripoolbot commented 5 years ago

Original Redmine Comment Author Name: Wilson Snyder (@wsnyder) Original Date: 2019-06-06T01:03:41Z


It's unfortunate that the language says "default clocking foo;" has no endclocking while "default clocking @(foo);" does.

Anyhow thanks for the report, generally indent stuff is hard and needs postponement but this is easy enough, fixed in git and verilog-mode-2019-06-05-f8186c4-vpo.

veripoolbot commented 5 years ago

Original Redmine Comment Author Name: Paul Donahue Original Date: 2019-06-10T23:56:25Z


Looks good. Thanks for the quick response.