aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilson Snyder2019-09-23 18:49:25 -0400
committerWilson Snyder2019-09-23 18:49:25 -0400
commitd3f8279422f12cff8e90254d872d2afcb9da021d (patch)
treeeb26989fbc92e6a33d00c319e8ddd49d1ec55aa5
parentfc64a0c0e2ea88abfaff6416ce20173484548154 (diff)
downloademacs-d3f8279422f12cff8e90254d872d2afcb9da021d.tar.gz
emacs-d3f8279422f12cff8e90254d872d2afcb9da021d.zip
Verilog-Mode collected updates.
* lisp/progmodes/verilog-mode.el (verilog-auto-inst-param): Add regexp paramter to AUTOINSTPARAM to select which parameters to export. Reported by Vish S. (verilog-build-defun-re): Fix `verilog-goto-defun' to find automatic function/tasks, bug1492. Reported by Enze Chi. (verilog-preprocessor): Update default.
-rw-r--r--lisp/progmodes/verilog-mode.el70
1 files changed, 39 insertions, 31 deletions
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 15bb25f25b0..baeaf8b95de 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -4,12 +4,12 @@
4 4
5;; Author: Michael McNamara <mac@verilog.com> 5;; Author: Michael McNamara <mac@verilog.com>
6;; Wilson Snyder <wsnyder@wsnyder.org> 6;; Wilson Snyder <wsnyder@wsnyder.org>
7;; X-URL: http://www.veripool.org 7;; X-URL: https://www.veripool.org
8;; Created: 3 Jan 1996 8;; Created: 3 Jan 1996
9;; Keywords: languages 9;; Keywords: languages
10;; The "Version" is the date followed by the decimal rendition of the Git 10;; The "Version" is the date followed by the decimal rendition of the Git
11;; commit hex. 11;; commit hex.
12;; Version: 2019.06.21.103209889 12;; Version: 2019.09.23.004801067
13 13
14;; Yoni Rabkin <yoni@rabkins.net> contacted the maintainer of this 14;; Yoni Rabkin <yoni@rabkins.net> contacted the maintainer of this
15;; file on 19/3/2008, and the maintainer agreed that when a bug is 15;; file on 19/3/2008, and the maintainer agreed that when a bug is
@@ -55,7 +55,7 @@
55;; under continuous development. Please report any issues to the issue 55;; under continuous development. Please report any issues to the issue
56;; tracker at 56;; tracker at
57;; 57;;
58;; http://www.veripool.org/verilog-mode 58;; https://www.veripool.org/verilog-mode
59;; 59;;
60;; Please use verilog-submit-bug-report to submit a report; type C-c 60;; Please use verilog-submit-bug-report to submit a report; type C-c
61;; C-b to invoke this and as a result we will have a much easier time 61;; C-b to invoke this and as a result we will have a much easier time
@@ -72,7 +72,7 @@
72;; default. 72;; default.
73 73
74;; You can get step by step help in installing this file by going to 74;; You can get step by step help in installing this file by going to
75;; <http://www.veripool.com/verilog-mode> 75;; <https://www.veripool.org/verilog-mode>
76 76
77;; The short list of installation instructions are: To set up 77;; The short list of installation instructions are: To set up
78;; automatic Verilog mode, put this file in your load path, and put 78;; automatic Verilog mode, put this file in your load path, and put
@@ -117,14 +117,14 @@
117 117
118;;; History: 118;;; History:
119;; 119;;
120;; See commit history at http://www.veripool.org/verilog-mode.html 120;; See commit history at https://www.veripool.org/verilog-mode
121;; (This section is required to appease checkdoc.) 121;; (This section is required to appease checkdoc.)
122 122
123;;; Code: 123;;; Code:
124;; 124;;
125 125
126;; This variable will always hold the version number of the mode 126;; This variable will always hold the version number of the mode
127(defconst verilog-mode-version "2019-06-21-626dba1-vpo-GNU" 127(defconst verilog-mode-version "2019-09-23-049422b-vpo-GNU"
128 "Version of this Verilog mode.") 128 "Version of this Verilog mode.")
129(defconst verilog-mode-release-emacs t 129(defconst verilog-mode-release-emacs t
130 "If non-nil, this version of Verilog mode was released with Emacs itself.") 130 "If non-nil, this version of Verilog mode was released with Emacs itself.")
@@ -530,8 +530,7 @@ you to the next lint error."
530;; We don't mark it safe, as it's used as a shell command 530;; We don't mark it safe, as it's used as a shell command
531 531
532(defcustom verilog-preprocessor 532(defcustom verilog-preprocessor
533 ;; Very few tools give preprocessed output, so we'll default to Verilog-Perl 533 "verilator -E __FLAGS__ __FILE__"
534 "vppreproc __FLAGS__ __FILE__"
535 "Program and arguments to use to preprocess Verilog source. 534 "Program and arguments to use to preprocess Verilog source.
536This is invoked with `verilog-preprocess', and depending on the 535This is invoked with `verilog-preprocess', and depending on the
537`verilog-set-compile-command', may also be invoked when you type 536`verilog-set-compile-command', may also be invoked when you type
@@ -2983,7 +2982,7 @@ find the errors."
2983 "\\)\\|\\(?:" 2982 "\\)\\|\\(?:"
2984 ;; `define and `if can span multiple lines if line ends in '\'. 2983 ;; `define and `if can span multiple lines if line ends in '\'.
2985 ;; NOTE: `if is not IEEE 1800-2012. 2984 ;; NOTE: `if is not IEEE 1800-2012.
2986 ;; from http://www.emacswiki.org/emacs/MultilineRegexp 2985 ;; from https://www.emacswiki.org/emacs/MultilineRegexp
2987 (concat "\\<\\(`define\\|`if\\)\\>" ; directive 2986 (concat "\\<\\(`define\\|`if\\)\\>" ; directive
2988 "\\s-+" ; separator 2987 "\\s-+" ; separator
2989 "\\(?:.*?\\(?:\n.*\\)*?\\)" ; definition: to end of line, then maybe more lines (excludes any trailing \n) 2988 "\\(?:.*?\\(?:\n.*\\)*?\\)" ; definition: to end of line, then maybe more lines (excludes any trailing \n)
@@ -3830,7 +3829,7 @@ Variables controlling indentation/edit style:
3830 3829
3831Variables controlling other actions: 3830Variables controlling other actions:
3832 3831
3833 `verilog-linter' (default `surelint') 3832 `verilog-linter' (default `none')
3834 Unix program to call to run the lint checker. This is the default 3833 Unix program to call to run the lint checker. This is the default
3835 command for \\[compile-command] and \\[verilog-auto-save-compile]. 3834 command for \\[compile-command] and \\[verilog-auto-save-compile].
3836 3835
@@ -7628,9 +7627,9 @@ and `verilog-separator-keywords'.)"
7628(defun verilog-build-defun-re (str &optional arg) 7627(defun verilog-build-defun-re (str &optional arg)
7629 "Return function/task/module starting with STR as regular expression. 7628 "Return function/task/module starting with STR as regular expression.
7630With optional second ARG non-nil, STR is the complete name of the instruction." 7629With optional second ARG non-nil, STR is the complete name of the instruction."
7631 (if arg 7630 (unless arg
7632 (concat "^\\(function\\|task\\|module\\)[ \t]+\\(" str "\\)\\>") 7631 (setq str (concat str "[a-zA-Z0-9_]*")))
7633 (concat "^\\(function\\|task\\|module\\)[ \t]+\\(" str "[a-zA-Z0-9_]*\\)\\>"))) 7632 (concat "^\\s-*\\(function\\|task\\|module\\)[ \t]+\\(?:\\(?:static\\|automatic\\)\\s-+\\)?\\(" str "\\)\\>"))
7634 7633
7635(defun verilog-comp-defun (verilog-str verilog-pred verilog-flag) 7634(defun verilog-comp-defun (verilog-str verilog-pred verilog-flag)
7636 "Function passed to `completing-read', `try-completion' or `all-completions'. 7635 "Function passed to `completing-read', `try-completion' or `all-completions'.
@@ -8996,7 +8995,7 @@ Outputs comments above subcell signals, for example:
8996 ;; below 3 modified by verilog-read-sub-decls-line 8995 ;; below 3 modified by verilog-read-sub-decls-line
8997 sigs-out sigs-inout sigs-in sigs-intf sigs-intfd) 8996 sigs-out sigs-inout sigs-in sigs-intf sigs-intfd)
8998 (verilog-beg-of-defun-quick) 8997 (verilog-beg-of-defun-quick)
8999 (while (verilog-re-search-forward-quick "\\(/\\*AUTOINST\\*/\\|\\.\\*\\)" end-mod-point t) 8998 (while (verilog-re-search-forward-quick "\\(/\\*AUTOINST\\((.*?)\\)?\\*/\\|\\.\\*\\)" end-mod-point t)
9000 (save-excursion 8999 (save-excursion
9001 (goto-char (match-beginning 0)) 9000 (goto-char (match-beginning 0))
9002 (setq par-values (and verilog-auto-inst-param-value 9001 (setq par-values (and verilog-auto-inst-param-value
@@ -10811,6 +10810,7 @@ Intended for internal use inside a `verilog-save-font-no-change-functions' block
10811 (verilog-regexp-words 10810 (verilog-regexp-words
10812 '("AS" "AUTOARG" "AUTOCONCATWIDTH" "AUTOINST" "AUTOINSTPARAM" 10811 '("AS" "AUTOARG" "AUTOCONCATWIDTH" "AUTOINST" "AUTOINSTPARAM"
10813 "AUTOSENSE"))) 10812 "AUTOSENSE")))
10813 "\\((.*?)\\)?"
10814 "\\*/") 10814 "\\*/")
10815 'verilog-delete-to-paren) 10815 'verilog-delete-to-paren)
10816 ;; Do .* instantiations, but avoid removing any user pins by looking for our magic comments 10816 ;; Do .* instantiations, but avoid removing any user pins by looking for our magic comments
@@ -10941,7 +10941,7 @@ shown) will make this into:
10941 (forward-char 1) 10941 (forward-char 1)
10942 (let ((indent-pt (+ (current-column))) 10942 (let ((indent-pt (+ (current-column)))
10943 (end-pt (save-excursion (verilog-forward-close-paren) (point)))) 10943 (end-pt (save-excursion (verilog-forward-close-paren) (point))))
10944 (cond ((verilog-re-search-forward-quick "\\(/\\*AUTOINST\\*/\\|\\.\\*\\)" end-pt t) 10944 (cond ((verilog-re-search-forward-quick "\\(/\\*AUTOINST\\((.*?)\\)?\\*/\\|\\.\\*\\)" end-pt t)
10945 (goto-char end-pt)) ; Already there, continue search with next instance 10945 (goto-char end-pt)) ; Already there, continue search with next instance
10946 (t 10946 (t
10947 ;; Delete identical interconnect 10947 ;; Delete identical interconnect
@@ -11596,7 +11596,7 @@ Exceptions:
11596 Unless you are instantiating a module multiple times, or the module is 11596 Unless you are instantiating a module multiple times, or the module is
11597 something trivial like an adder, DO NOT CHANGE SIGNAL NAMES ACROSS HIERARCHY. 11597 something trivial like an adder, DO NOT CHANGE SIGNAL NAMES ACROSS HIERARCHY.
11598 It just makes for unmaintainable code. To sanitize signal names, try 11598 It just makes for unmaintainable code. To sanitize signal names, try
11599 vrename from URL `http://www.veripool.org'. 11599 vrename from URL `https://www.veripool.org'.
11600 11600
11601 When you need to violate this suggestion there are two ways to list 11601 When you need to violate this suggestion there are two ways to list
11602 exceptions, placing them before the AUTOINST, or using templates. 11602 exceptions, placing them before the AUTOINST, or using templates.
@@ -11679,7 +11679,7 @@ Templates:
11679 InstModule ms2m (/*AUTOINST*/ 11679 InstModule ms2m (/*AUTOINST*/
11680 // Outputs 11680 // Outputs
11681 .NotInTemplate (NotInTemplate), 11681 .NotInTemplate (NotInTemplate),
11682 .ptl_bus (ptl_busnew[3:0]), // Templated 11682 .ptl_bus (ptl_busnew[3:0]),
11683 .... 11683 ....
11684 11684
11685 11685
@@ -11831,11 +11831,11 @@ Lisp Templates:
11831 occur. 11831 occur.
11832 11832
11833For more information see the \\[verilog-faq] and forums at URL 11833For more information see the \\[verilog-faq] and forums at URL
11834`http://www.veripool.org'." 11834`https://www.veripool.org'."
11835 (save-excursion 11835 (save-excursion
11836 ;; Find beginning 11836 ;; Find beginning
11837 (let* ((pt (point)) 11837 (let* ((pt (point))
11838 (for-star (save-excursion (backward-char 2) (looking-at "\\.\\*"))) 11838 (for-star (save-excursion (backward-char 2) (looking-at "\\.\\*")))
11839 (indent-pt (save-excursion (verilog-backward-open-paren) 11839 (indent-pt (save-excursion (verilog-backward-open-paren)
11840 (1+ (current-column)))) 11840 (1+ (current-column))))
11841 (verilog-auto-inst-column (max verilog-auto-inst-column 11841 (verilog-auto-inst-column (max verilog-auto-inst-column
@@ -11940,6 +11940,10 @@ For more information see the \\[verilog-faq] and forums at URL
11940Replace the parameter connections to an instantiation with ones 11940Replace the parameter connections to an instantiation with ones
11941automatically derived from the module header of the instantiated netlist. 11941automatically derived from the module header of the instantiated netlist.
11942 11942
11943You may also provide an optional regular expression, in which
11944case only parameters matching the regular expression will be
11945included.
11946
11943See \\[verilog-auto-inst] for limitations, and templates to customize the 11947See \\[verilog-auto-inst] for limitations, and templates to customize the
11944output. 11948output.
11945 11949
@@ -11975,7 +11979,9 @@ Templates:
11975 just as you would with \\[verilog-auto-inst]." 11979 just as you would with \\[verilog-auto-inst]."
11976 (save-excursion 11980 (save-excursion
11977 ;; Find beginning 11981 ;; Find beginning
11978 (let* ((pt (point)) 11982 (let* ((params (verilog-read-auto-params 0 1))
11983 (regexp (nth 0 params))
11984 (pt (point))
11979 (indent-pt (save-excursion (verilog-backward-open-paren) 11985 (indent-pt (save-excursion (verilog-backward-open-paren)
11980 (1+ (current-column)))) 11986 (1+ (current-column))))
11981 (verilog-auto-inst-column (max verilog-auto-inst-column 11987 (verilog-auto-inst-column (max verilog-auto-inst-column
@@ -12017,6 +12023,8 @@ Templates:
12017 (verilog-decls-get-gparams submoddecls) 12023 (verilog-decls-get-gparams submoddecls)
12018 skip-pins)) 12024 skip-pins))
12019 (vl-dir "parameter")) 12025 (vl-dir "parameter"))
12026 (when regexp
12027 (setq sig-list (verilog-signals-matching-regexp sig-list regexp)))
12020 (when sig-list 12028 (when sig-list
12021 (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) 12029 (when (not did-first) (verilog-auto-inst-first) (setq did-first t))
12022 ;; Note these are searched for in verilog-read-sub-decls. 12030 ;; Note these are searched for in verilog-read-sub-decls.
@@ -12390,7 +12398,7 @@ isn't declared elsewhere inside the module. This is useful for modules which
12390only instantiate other modules. 12398only instantiate other modules.
12391 12399
12392Limitations: 12400Limitations:
12393 This ONLY detects outputs of AUTOINSTants (see `verilog-read-sub-decls'). 12401 This ONLY detects inputs of AUTOINSTants (see `verilog-read-sub-decls').
12394 12402
12395 If placed inside the parenthesis of a module declaration, it creates 12403 If placed inside the parenthesis of a module declaration, it creates
12396 Verilog 2001 style, else uses Verilog 1995 style. 12404 Verilog 2001 style, else uses Verilog 1995 style.
@@ -12474,7 +12482,7 @@ Make inout statements for any inout signal in an /*AUTOINST*/ that
12474isn't declared elsewhere inside the module. 12482isn't declared elsewhere inside the module.
12475 12483
12476Limitations: 12484Limitations:
12477 This ONLY detects outputs of AUTOINSTants (see `verilog-read-sub-decls'). 12485 This ONLY detects inouts of AUTOINSTants (see `verilog-read-sub-decls').
12478 12486
12479 If placed inside the parenthesis of a module declaration, it creates 12487 If placed inside the parenthesis of a module declaration, it creates
12480 Verilog 2001 style, else uses Verilog 1995 style. 12488 Verilog 2001 style, else uses Verilog 1995 style.
@@ -13832,7 +13840,7 @@ Using \\[describe-function], see also:
13832 `verilog-read-includes' for reading \\=`includes 13840 `verilog-read-includes' for reading \\=`includes
13833 13841
13834If you have bugs with these autos, please file an issue at 13842If you have bugs with these autos, please file an issue at
13835URL `http://www.veripool.org/verilog-mode' or contact the AUTOAUTHOR 13843URL `https://www.veripool.org/verilog-mode' or contact the AUTOAUTHOR
13836Wilson Snyder (wsnyder@wsnyder.org)." 13844Wilson Snyder (wsnyder@wsnyder.org)."
13837 (interactive) 13845 (interactive)
13838 (unless noninteractive (message "Updating AUTOs...")) 13846 (unless noninteractive (message "Updating AUTOs..."))
@@ -13890,8 +13898,8 @@ Wilson Snyder (wsnyder@wsnyder.org)."
13890 (verilog-auto-re-search-do "/\\*AUTOINSERTLISP(.*?)\\*/" 13898 (verilog-auto-re-search-do "/\\*AUTOINSERTLISP(.*?)\\*/"
13891 'verilog-auto-insert-lisp) 13899 'verilog-auto-insert-lisp)
13892 ;; Expand instances before need the signals the instances input/output 13900 ;; Expand instances before need the signals the instances input/output
13893 (verilog-auto-re-search-do "/\\*AUTOINSTPARAM\\*/" 'verilog-auto-inst-param) 13901 (verilog-auto-re-search-do "/\\*AUTOINSTPARAM\\((.*?)\\)?\\*/" 'verilog-auto-inst-param)
13894 (verilog-auto-re-search-do "/\\*AUTOINST\\*/" 'verilog-auto-inst) 13902 (verilog-auto-re-search-do "/\\*AUTOINST\\((.*?)\\)?\\*/" 'verilog-auto-inst)
13895 (verilog-auto-re-search-do "\\.\\*" 'verilog-auto-star) 13903 (verilog-auto-re-search-do "\\.\\*" 'verilog-auto-star)
13896 ;; Must be done before autoin/out as creates a reg 13904 ;; Must be done before autoin/out as creates a reg
13897 (verilog-auto-re-search-do "/\\*AUTOASCIIENUM(.*?)\\*/" 'verilog-auto-ascii-enum) 13905 (verilog-auto-re-search-do "/\\*AUTOASCIIENUM(.*?)\\*/" 'verilog-auto-ascii-enum)
@@ -14427,7 +14435,7 @@ Clicking on the middle-mouse button loads them in a buffer (as in dired)."
14427 ;; This scanner is syntax-fragile, so don't get bent 14435 ;; This scanner is syntax-fragile, so don't get bent
14428 (when verilog-highlight-modules 14436 (when verilog-highlight-modules
14429 (condition-case nil 14437 (condition-case nil
14430 (while (verilog-re-search-forward-quick "\\(/\\*AUTOINST\\*/\\|\\.\\*\\)" end-point t) 14438 (while (verilog-re-search-forward-quick "\\(/\\*AUTOINST\\((.*?)\\)?\\*/\\|\\.\\*\\)" end-point t)
14431 (save-excursion 14439 (save-excursion
14432 (goto-char (match-beginning 0)) 14440 (goto-char (match-beginning 0))
14433 (unless (verilog-inside-comment-or-string-p) 14441 (unless (verilog-inside-comment-or-string-p)
@@ -14513,9 +14521,9 @@ Files are checked based on `verilog-library-flags'."
14513 (with-output-to-temp-buffer "*verilog-mode help*" 14521 (with-output-to-temp-buffer "*verilog-mode help*"
14514 (princ (format "You are using verilog-mode %s\n" verilog-mode-version)) 14522 (princ (format "You are using verilog-mode %s\n" verilog-mode-version))
14515 (princ "\n") 14523 (princ "\n")
14516 (princ "For new releases, see http://www.veripool.com/verilog-mode\n") 14524 (princ "For new releases, see https://www.veripool.org/verilog-mode\n")
14517 (princ "\n") 14525 (princ "\n")
14518 (princ "For frequently asked questions, see http://www.veripool.org/verilog-mode-faq.html\n") 14526 (princ "For frequently asked questions, see https://www.veripool.org/verilog-mode-faq.html\n")
14519 (princ "\n") 14527 (princ "\n")
14520 (princ "To submit a bug, use M-x verilog-submit-bug-report\n") 14528 (princ "To submit a bug, use M-x verilog-submit-bug-report\n")
14521 (princ "\n"))) 14529 (princ "\n")))
@@ -14617,11 +14625,11 @@ I save so much time, my files are colored nicely, my co workers respect
14617my coding ability... until now. I'd really appreciate anything you 14625my coding ability... until now. I'd really appreciate anything you
14618could do to help me out with this minor deficiency in the product. 14626could do to help me out with this minor deficiency in the product.
14619 14627
14620I've taken a look at the Verilog-Mode FAQ at: 14628I've taken a look at the Verilog-Mode FAQ at
14621https://www.veripool.org/wiki/verilog-mode/Faq 14629https://www.veripool.org/verilog-mode-faq.html.
14622 14630
14623And, I've considered filing the bug on the issue tracker at 14631And, I've considered filing the bug on the issue tracker at
14624https://www.veripool.org/projects/verilog-mode/issues 14632https://www.veripool.org/verilog-mode-bugs
14625since I realize that public bugs are easier for you to track, 14633since I realize that public bugs are easier for you to track,
14626and for others to search, but would prefer to email. 14634and for others to search, but would prefer to email.
14627 14635