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

endclocking not indented properly on default clocking blocks #1457

Closed
veripoolbot opened this issue Jun 5, 2019 · 3 comments
Closed

endclocking not indented properly on default clocking blocks #1457

veripoolbot opened this issue Jun 5, 2019 · 3 comments
Assignees
Labels

Comments

@veripoolbot
Copy link
Collaborator


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


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


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


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


Looks good. Thanks for the quick response.

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

2 participants