diff options
| author | Stefan Monnier | 2009-11-05 20:54:34 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-11-05 20:54:34 +0000 |
| commit | 148623016fb5ff868bae887ac52b71a90b470bb2 (patch) | |
| tree | 63152fd632163660f48b34fc193c3962c2dcba97 | |
| parent | f6a074209a507c56ff9183b0806af0f214fc29f9 (diff) | |
| download | emacs-148623016fb5ff868bae887ac52b71a90b470bb2.tar.gz emacs-148623016fb5ff868bae887ac52b71a90b470bb2.zip | |
* verilog-mode.el (verilog-getopt-file, verilog-set-define):
Remove extra save-excursions and make-variable-buffer-local's.
Suggested by Stefan Monnier.
(verilog-getopt-file, verilog-module-inside-filename-p)
(verilog-set-define): Merge GNU 1.35 and repair changes from
switching to using with-current-buffer.
(verilog-read-always-signals-recurse): Fix "a == 2'b00 ? b : c"
being treated as a number and confusing AUTORESET.
Reported by Dan Dever.
(verilog-auto-ignore-concat, verilog-read-sub-decls-expr):
Add verilog-auto-ignore-concat to fix backward compatibility with
older verilog-modes. Reported by Dan Katz.
(verilog-read-auto-template): Fix AUTO_TEMPLATEs with regexps
containing closing anchors "...$".
(verilog-read-decls): Fix AUTOREG not detecting "assign {a,b}".
Reported by Wade Smith.
(verilog-batch-execute-func) Comment on function usage.
(verilog-label-re): Fix regular expression for labels.
(verilog-label-re, verilog-calc-1): Support proper indent of named
asserts.
(verilog-backward-token, verilog-basic-complete-re)
(verilog-beg-of-statement, verilog-indent-re): Support proper
indent of the assert statement at the beginning of a block of text.
(verilog-beg-block-re, verilog-ovm-begin-re): Support the
`ovm_object_param_utils_begin and `ovm_component_param_utils_begin
tokens as begins.
| -rw-r--r-- | lisp/ChangeLog | 42 | ||||
| -rw-r--r-- | lisp/progmodes/verilog-mode.el | 139 |
2 files changed, 119 insertions, 62 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7b2de46fe4c..729c5436a3b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,45 @@ | |||
| 1 | 2009-11-05 Wilson Snyder <wsnyder@wsnyder.org> | ||
| 2 | |||
| 3 | * verilog-mode.el (verilog-getopt-file, verilog-set-define): | ||
| 4 | Remove extra save-excursions and make-variable-buffer-local's. | ||
| 5 | Suggested by Stefan Monnier. | ||
| 6 | |||
| 7 | (verilog-getopt-file, verilog-module-inside-filename-p) | ||
| 8 | (verilog-set-define): Merge GNU 1.35 and repair changes from | ||
| 9 | switching to using with-current-buffer. | ||
| 10 | |||
| 11 | (verilog-read-always-signals-recurse): Fix "a == 2'b00 ? b : c" | ||
| 12 | being treated as a number and confusing AUTORESET. | ||
| 13 | Reported by Dan Dever. | ||
| 14 | |||
| 15 | (verilog-auto-ignore-concat, verilog-read-sub-decls-expr): | ||
| 16 | Add verilog-auto-ignore-concat to fix backward compatibility with | ||
| 17 | older verilog-modes. Reported by Dan Katz. | ||
| 18 | |||
| 19 | (verilog-read-auto-template): Fix AUTO_TEMPLATEs with regexps | ||
| 20 | containing closing anchors "...$". | ||
| 21 | |||
| 22 | (verilog-read-decls): Fix AUTOREG not detecting "assign {a,b}". | ||
| 23 | Reported by Wade Smith. | ||
| 24 | |||
| 25 | (verilog-batch-execute-func) Comment on function usage. | ||
| 26 | |||
| 27 | 2009-11-05 Michael McNamara <mac@mail.brushroad.com> | ||
| 28 | |||
| 29 | * verilog-mode.el (verilog-label-re): Fix regular expression for | ||
| 30 | labels. | ||
| 31 | |||
| 32 | (verilog-label-re, verilog-calc-1): Support proper indent of named | ||
| 33 | asserts. | ||
| 34 | |||
| 35 | (verilog-backward-token, verilog-basic-complete-re) | ||
| 36 | (verilog-beg-of-statement, verilog-indent-re): Support proper | ||
| 37 | indent of the assert statement at the beginning of a block of text. | ||
| 38 | |||
| 39 | (verilog-beg-block-re, verilog-ovm-begin-re): Support the | ||
| 40 | `ovm_object_param_utils_begin and `ovm_component_param_utils_begin | ||
| 41 | tokens as begins. | ||
| 42 | |||
| 1 | 2009-11-05 Glenn Morris <rgm@gnu.org> | 43 | 2009-11-05 Glenn Morris <rgm@gnu.org> |
| 2 | 44 | ||
| 3 | * emacs-lisp/bytecomp.el (byte-compile-insert-header): Drop test for | 45 | * emacs-lisp/bytecomp.el (byte-compile-insert-header): Drop test for |
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 27f7580f523..8239cdda3a1 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el | |||
| @@ -118,9 +118,9 @@ | |||
| 118 | ;;; Code: | 118 | ;;; Code: |
| 119 | 119 | ||
| 120 | ;; This variable will always hold the version number of the mode | 120 | ;; This variable will always hold the version number of the mode |
| 121 | (defconst verilog-mode-version "525" | 121 | (defconst verilog-mode-version "547" |
| 122 | "Version of this Verilog mode.") | 122 | "Version of this Verilog mode.") |
| 123 | (defconst verilog-mode-release-date "2009-07-02-GNU" | 123 | (defconst verilog-mode-release-date "2009-11-05-GNU" |
| 124 | "Release date of this Verilog mode.") | 124 | "Release date of this Verilog mode.") |
| 125 | (defconst verilog-mode-release-emacs t | 125 | (defconst verilog-mode-release-emacs t |
| 126 | "If non-nil, this version of Verilog mode was released with Emacs itself.") | 126 | "If non-nil, this version of Verilog mode was released with Emacs itself.") |
| @@ -579,6 +579,16 @@ The name of the function or case will be set between the braces." | |||
| 579 | :type 'boolean) | 579 | :type 'boolean) |
| 580 | (put 'verilog-auto-endcomments 'safe-local-variable 'verilog-booleanp) | 580 | (put 'verilog-auto-endcomments 'safe-local-variable 'verilog-booleanp) |
| 581 | 581 | ||
| 582 | (defcustom verilog-auto-ignore-concat nil | ||
| 583 | "*True means ignore signals in {...} concatenations for AUTOWIRE etc. | ||
| 584 | This will exclude signals referenced as pin connections in {...} | ||
| 585 | from AUTOWIRE, AUTOOUTPUT and friends. This flag should be set | ||
| 586 | for backward compatibility only and not set in new designs; it | ||
| 587 | may be removed in future versions." | ||
| 588 | :group 'verilog-mode-actions | ||
| 589 | :type 'boolean) | ||
| 590 | (put 'verilog-auto-ignore-concat 'safe-local-variable 'verilog-booleanp) | ||
| 591 | |||
| 582 | (defcustom verilog-auto-read-includes nil | 592 | (defcustom verilog-auto-read-includes nil |
| 583 | "*True means to automatically read includes before AUTOs. | 593 | "*True means to automatically read includes before AUTOs. |
| 584 | This will do a `verilog-read-defines' and `verilog-read-includes' before | 594 | This will do a `verilog-read-defines' and `verilog-read-includes' before |
| @@ -701,7 +711,7 @@ always be saved." | |||
| 701 | '( | 711 | '( |
| 702 | ("[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 1 bold t) | 712 | ("[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 1 bold t) |
| 703 | ("[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 2 bold t) | 713 | ("[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 2 bold t) |
| 704 | 714 | ||
| 705 | ("\\(WARNING\\|ERROR\\|INFO\\): \\([^,]+\\), line \\([0-9]+\\):" 2 bold t) | 715 | ("\\(WARNING\\|ERROR\\|INFO\\): \\([^,]+\\), line \\([0-9]+\\):" 2 bold t) |
| 706 | ("\\(WARNING\\|ERROR\\|INFO\\): \\([^,]+\\), line \\([0-9]+\\):" 3 bold t) | 716 | ("\\(WARNING\\|ERROR\\|INFO\\): \\([^,]+\\), line \\([0-9]+\\):" 3 bold t) |
| 707 | 717 | ||
| @@ -869,11 +879,11 @@ the MSB or LSB of a signal inside an AUTORESET." | |||
| 869 | (put 'verilog-assignment-delay 'safe-local-variable 'stringp) | 879 | (put 'verilog-assignment-delay 'safe-local-variable 'stringp) |
| 870 | 880 | ||
| 871 | (defcustom verilog-auto-arg-sort nil | 881 | (defcustom verilog-auto-arg-sort nil |
| 872 | "*If set, AUTOARG will sort signal names, rather than leave them in | 882 | "*If set, AUTOARG signal names will be sorted, not in delaration order. |
| 873 | declaration order. Declaration order is advantageous with order based | 883 | Declaration order is advantageous with order based instantiations |
| 874 | instantiations and is the default for backward compatibility. Sorted order | 884 | and is the default for backward compatibility. Sorted order |
| 875 | reduces changes when declarations are moved around in a file, and it's bad | 885 | reduces changes when declarations are moved around in a file, and |
| 876 | practice to rely on order based instantiations anyhow." | 886 | it's bad practice to rely on order based instantiations anyhow." |
| 877 | :group 'verilog-mode-auto | 887 | :group 'verilog-mode-auto |
| 878 | :type 'boolean) | 888 | :type 'boolean) |
| 879 | (put 'verilog-auto-arg-sort 'safe-local-variable 'verilog-booleanp) | 889 | (put 'verilog-auto-arg-sort 'safe-local-variable 'verilog-booleanp) |
| @@ -1473,7 +1483,7 @@ find the errors." | |||
| 1473 | (cdr compilation-error-regexp-alist-alist))))) | 1483 | (cdr compilation-error-regexp-alist-alist))))) |
| 1474 | (if (boundp 'compilation-font-lock-keywords) | 1484 | (if (boundp 'compilation-font-lock-keywords) |
| 1475 | (progn | 1485 | (progn |
| 1476 | (make-variable-buffer-local 'compilation-font-lock-keywords) | 1486 | (make-local-variable 'compilation-font-lock-keywords) |
| 1477 | (setq compilation-font-lock-keywords verilog-error-font-lock-keywords) | 1487 | (setq compilation-font-lock-keywords verilog-error-font-lock-keywords) |
| 1478 | (font-lock-set-defaults))) | 1488 | (font-lock-set-defaults))) |
| 1479 | ;; Need to re-run compilation-error-regexp builder | 1489 | ;; Need to re-run compilation-error-regexp builder |
| @@ -1524,8 +1534,10 @@ find the errors." | |||
| 1524 | (verilog-regexp-opt | 1534 | (verilog-regexp-opt |
| 1525 | '( | 1535 | '( |
| 1526 | "`ovm_component_utils_begin" | 1536 | "`ovm_component_utils_begin" |
| 1537 | "`ovm_component_param_utils_begin" | ||
| 1527 | "`ovm_field_utils_begin" | 1538 | "`ovm_field_utils_begin" |
| 1528 | "`ovm_object_utils_begin" | 1539 | "`ovm_object_utils_begin" |
| 1540 | "`ovm_object_param_utils_begin" | ||
| 1529 | "`ovm_sequence_utils_begin" | 1541 | "`ovm_sequence_utils_begin" |
| 1530 | "`ovm_sequencer_utils_begin" | 1542 | "`ovm_sequencer_utils_begin" |
| 1531 | ) nil ))) | 1543 | ) nil ))) |
| @@ -1658,6 +1670,7 @@ find the errors." | |||
| 1658 | ;; a, | 1670 | ;; a, |
| 1659 | ;; b : | 1671 | ;; b : |
| 1660 | 1672 | ||
| 1673 | (defconst verilog-label-re (concat verilog-symbol-re "\\s-*:\\s-*")) | ||
| 1661 | (defconst verilog-no-indent-begin-re | 1674 | (defconst verilog-no-indent-begin-re |
| 1662 | "\\<\\(if\\|else\\|while\\|for\\|repeat\\|always\\|always_comb\\|always_ff\\|always_latch\\)\\>") | 1675 | "\\<\\(if\\|else\\|while\\|for\\|repeat\\|always\\|always_comb\\|always_ff\\|always_latch\\)\\>") |
| 1663 | 1676 | ||
| @@ -1778,11 +1791,11 @@ find the errors." | |||
| 1778 | "\\(\\<always_ff\\>\\(\[ \t\]*@\\)?\\)\\|" ; 5 | 1791 | "\\(\\<always_ff\\>\\(\[ \t\]*@\\)?\\)\\|" ; 5 |
| 1779 | "\\(\\<always_latch\\>\\(\[ \t\]*@\\)?\\)\\|" ; 6 | 1792 | "\\(\\<always_latch\\>\\(\[ \t\]*@\\)?\\)\\|" ; 6 |
| 1780 | "\\(\\<fork\\>\\)\\|" ; 7 | 1793 | "\\(\\<fork\\>\\)\\|" ; 7 |
| 1781 | "\\(\\<always\\>\\(\[ \t\]*@\\)?\\)\\|" | 1794 | "\\(\\<always\\>\\(\[ \t\]*@\\)?\\)\\|" |
| 1782 | "\\(\\<if\\>\\)\\|" | 1795 | "\\(\\<if\\>\\)\\|" |
| 1783 | "\\(\\<clocking\\>\\)\\|" | 1796 | "\\(\\<clocking\\>\\)\\|" |
| 1784 | "\\(\\<task\\>\\)\\|" | 1797 | "\\(\\<task\\>\\)\\|" |
| 1785 | "\\(\\<function\\>\\)\\|" | 1798 | "\\(\\<function\\>\\)\\|" |
| 1786 | "\\(\\<initial\\>\\)\\|" | 1799 | "\\(\\<initial\\>\\)\\|" |
| 1787 | "\\(\\<interface\\>\\)\\|" | 1800 | "\\(\\<interface\\>\\)\\|" |
| 1788 | "\\(\\<package\\>\\)\\|" | 1801 | "\\(\\<package\\>\\)\\|" |
| @@ -1813,8 +1826,10 @@ find the errors." | |||
| 1813 | "task" | 1826 | "task" |
| 1814 | ;;; OVM | 1827 | ;;; OVM |
| 1815 | "`ovm_component_utils_begin" | 1828 | "`ovm_component_utils_begin" |
| 1829 | "`ovm_component_param_utils_begin" | ||
| 1816 | "`ovm_field_utils_begin" | 1830 | "`ovm_field_utils_begin" |
| 1817 | "`ovm_object_utils_begin" | 1831 | "`ovm_object_utils_begin" |
| 1832 | "`ovm_object_param_utils_begin" | ||
| 1818 | "`ovm_sequence_utils_begin" | 1833 | "`ovm_sequence_utils_begin" |
| 1819 | "`ovm_sequencer_utils_begin" | 1834 | "`ovm_sequencer_utils_begin" |
| 1820 | 1835 | ||
| @@ -1998,8 +2013,10 @@ find the errors." | |||
| 1998 | "`time_scale" | 2013 | "`time_scale" |
| 1999 | ;; OVM Begin tokens | 2014 | ;; OVM Begin tokens |
| 2000 | "`ovm_component_utils_begin" | 2015 | "`ovm_component_utils_begin" |
| 2016 | "`ovm_component_param_utils_begin" | ||
| 2001 | "`ovm_field_utils_begin" | 2017 | "`ovm_field_utils_begin" |
| 2002 | "`ovm_object_utils_begin" | 2018 | "`ovm_object_utils_begin" |
| 2019 | "`ovm_object_param_utils_begin" | ||
| 2003 | "`ovm_sequence_utils_begin" | 2020 | "`ovm_sequence_utils_begin" |
| 2004 | "`ovm_sequencer_utils_begin" | 2021 | "`ovm_sequencer_utils_begin" |
| 2005 | ;; OVM End tokens | 2022 | ;; OVM End tokens |
| @@ -2050,7 +2067,7 @@ find the errors." | |||
| 2050 | `( | 2067 | `( |
| 2051 | "always" "assign" "always_latch" "always_ff" "always_comb" "constraint" | 2068 | "always" "assign" "always_latch" "always_ff" "always_comb" "constraint" |
| 2052 | "import" "initial" "final" "module" "macromodule" "repeat" "randcase" "while" | 2069 | "import" "initial" "final" "module" "macromodule" "repeat" "randcase" "while" |
| 2053 | "if" "for" "forever" "foreach" "else" "parameter" "do" "localparam" | 2070 | "if" "for" "forever" "foreach" "else" "parameter" "do" "localparam" "assert" |
| 2054 | )))) | 2071 | )))) |
| 2055 | (defconst verilog-complete-reg | 2072 | (defconst verilog-complete-reg |
| 2056 | (concat | 2073 | (concat |
| @@ -3245,7 +3262,7 @@ With ARG, first kill any existing labels." | |||
| 3245 | (looking-at "\\<") | 3262 | (looking-at "\\<") |
| 3246 | (forward-word -1))) | 3263 | (forward-word -1))) |
| 3247 | (and | 3264 | (and |
| 3248 | (looking-at verilog-extended-complete-re) | 3265 | (looking-at verilog-complete-reg) |
| 3249 | (not (save-excursion | 3266 | (not (save-excursion |
| 3250 | (verilog-backward-token) | 3267 | (verilog-backward-token) |
| 3251 | (looking-at verilog-extended-complete-re)))) | 3268 | (looking-at verilog-extended-complete-re)))) |
| @@ -4137,7 +4154,10 @@ This lets programs calling batch mode to easily extract error messages." | |||
| 4137 | (defun verilog-batch-execute-func (funref) | 4154 | (defun verilog-batch-execute-func (funref) |
| 4138 | "Internal processing of a batch command, running FUNREF on all command arguments." | 4155 | "Internal processing of a batch command, running FUNREF on all command arguments." |
| 4139 | (verilog-batch-error-wrapper | 4156 | (verilog-batch-error-wrapper |
| 4140 | ;; !!! FIXME: Setting global variables like that is *VERY NASTY* !!! --Stef | 4157 | ;; Setting global variables like that is *VERY NASTY* !!! --Stef |
| 4158 | ;; However, this function is called only when Emacs is being used as | ||
| 4159 | ;; a standalone language instead of as an editor, so we'll live. | ||
| 4160 | ;; | ||
| 4141 | ;; General globals needed | 4161 | ;; General globals needed |
| 4142 | (setq make-backup-files nil) | 4162 | (setq make-backup-files nil) |
| 4143 | (setq-default make-backup-files nil) | 4163 | (setq-default make-backup-files nil) |
| @@ -4466,11 +4486,13 @@ Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)." | |||
| 4466 | ((looking-at "\\<property\\>") | 4486 | ((looking-at "\\<property\\>") |
| 4467 | ; *sigh* | 4487 | ; *sigh* |
| 4468 | ; {assert|assume|cover} property (); are complete | 4488 | ; {assert|assume|cover} property (); are complete |
| 4489 | ; and could also be labeled: - foo: assert property | ||
| 4469 | ; but | 4490 | ; but |
| 4470 | ; property ID () ... needs end_property | 4491 | ; property ID () ... needs end_property |
| 4471 | (verilog-beg-of-statement) | 4492 | (verilog-beg-of-statement) |
| 4472 | (if (looking-at "\\(assert\\|assume\\|cover\\)\\s-+property\\>") | 4493 | (if (looking-at (concat "\\(" verilog-label-re "\\)?" |
| 4473 | (throw 'nesting 'statement) ; We don't need an endproperty for these | 4494 | "\\(assert\\|assume\\|cover\\)\\s-+property\\>")) |
| 4495 | (throw 'continue 'statement) ; We don't need an endproperty for these | ||
| 4474 | (throw 'nesting 'block) ;We still need a endproperty | 4496 | (throw 'nesting 'block) ;We still need a endproperty |
| 4475 | )) | 4497 | )) |
| 4476 | 4498 | ||
| @@ -4487,7 +4509,7 @@ Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)." | |||
| 4487 | ((looking-at verilog-defun-level-re) | 4509 | ((looking-at verilog-defun-level-re) |
| 4488 | (if (looking-at verilog-defun-level-generate-only-re) | 4510 | (if (looking-at verilog-defun-level-generate-only-re) |
| 4489 | (if (verilog-in-generate-region-p) | 4511 | (if (verilog-in-generate-region-p) |
| 4490 | (throw 'continue 'foo) ; always block in a generate | 4512 | (throw 'continue 'foo) ; always block in a generate - keep looking |
| 4491 | (throw 'nesting 'defun)) | 4513 | (throw 'nesting 'defun)) |
| 4492 | (throw 'nesting 'defun))) | 4514 | (throw 'nesting 'defun))) |
| 4493 | 4515 | ||
| @@ -4668,7 +4690,7 @@ Set point to where line starts." | |||
| 4668 | continued)) | 4690 | continued)) |
| 4669 | 4691 | ||
| 4670 | (defun verilog-backward-token () | 4692 | (defun verilog-backward-token () |
| 4671 | "Step backward token, returing true if nil if continued line." | 4693 | "Step backward token, returing true if this is a continued line." |
| 4672 | (interactive) | 4694 | (interactive) |
| 4673 | (verilog-backward-syntactic-ws) | 4695 | (verilog-backward-syntactic-ws) |
| 4674 | (cond | 4696 | (cond |
| @@ -6587,23 +6609,19 @@ Return a array of [outputs inouts inputs wire reg assign const]." | |||
| 6587 | ((eq ?= (following-char)) | 6609 | ((eq ?= (following-char)) |
| 6588 | (setq rvalue t newsig nil) | 6610 | (setq rvalue t newsig nil) |
| 6589 | (forward-char 1)) | 6611 | (forward-char 1)) |
| 6590 | ((and (or rvalue sig-paren) | 6612 | ((and (eq ?, (following-char)) |
| 6591 | (cond ((and (eq ?, (following-char)) | 6613 | (eq paren sig-paren)) |
| 6592 | (eq paren sig-paren)) | 6614 | (setq rvalue nil) |
| 6593 | (setq rvalue nil) | 6615 | (forward-char 1)) |
| 6594 | (forward-char 1) | 6616 | ;; ,'s can occur inside {} & funcs |
| 6595 | t) | 6617 | ((looking-at "[{(]") |
| 6596 | ;; ,'s can occur inside {} & funcs | 6618 | (setq paren (1+ paren)) |
| 6597 | ((looking-at "[{(]") | 6619 | (forward-char 1)) |
| 6598 | (setq paren (1+ paren)) | 6620 | ((looking-at "[})]") |
| 6599 | (forward-char 1) | 6621 | (setq paren (1- paren)) |
| 6600 | t) | 6622 | (forward-char 1) |
| 6601 | ((looking-at "[})]") | 6623 | (when (< paren sig-paren) |
| 6602 | (setq paren (1- paren)) | 6624 | (setq expect-signal nil))) ; ) that ends variables inside v2k arg list |
| 6603 | (forward-char 1) | ||
| 6604 | (when (< paren sig-paren) | ||
| 6605 | (setq expect-signal nil)) ; ) that ends variables inside v2k arg list | ||
| 6606 | t)))) | ||
| 6607 | ((looking-at "\\s-*\\(\\[[^]]+\\]\\)") | 6625 | ((looking-at "\\s-*\\(\\[[^]]+\\]\\)") |
| 6608 | (goto-char (match-end 0)) | 6626 | (goto-char (match-end 0)) |
| 6609 | (cond (newsig ; Memory, not just width. Patch last signal added's memory (nth 3) | 6627 | (cond (newsig ; Memory, not just width. Patch last signal added's memory (nth 3) |
| @@ -6674,7 +6692,6 @@ Return a array of [outputs inouts inputs wire reg assign const]." | |||
| 6674 | ((and expect-signal | 6692 | ((and expect-signal |
| 6675 | (eq functask 0) | 6693 | (eq functask 0) |
| 6676 | (not rvalue) | 6694 | (not rvalue) |
| 6677 | (eq paren sig-paren) | ||
| 6678 | (not (member keywd verilog-keywords))) | 6695 | (not (member keywd verilog-keywords))) |
| 6679 | ;; Add new signal to expect-signal's variable | 6696 | ;; Add new signal to expect-signal's variable |
| 6680 | (setq newsig (list keywd vec nil nil enum signed typedefed multidim modport)) | 6697 | (setq newsig (list keywd vec nil nil enum signed typedefed multidim modport)) |
| @@ -6791,10 +6808,11 @@ Return a array of [outputs inouts inputs wire reg assign const]." | |||
| 6791 | (cond | 6808 | (cond |
| 6792 | ;; {..., a, b} requires us to recurse on a,b | 6809 | ;; {..., a, b} requires us to recurse on a,b |
| 6793 | ((string-match "^\\s-*{\\([^{}]*\\)}\\s-*$" expr) | 6810 | ((string-match "^\\s-*{\\([^{}]*\\)}\\s-*$" expr) |
| 6794 | (let ((mlst (split-string (match-string 1 expr) ",")) | 6811 | (unless verilog-auto-ignore-concat |
| 6795 | mstr) | 6812 | (let ((mlst (split-string (match-string 1 expr) ",")) |
| 6796 | (while (setq mstr (pop mlst)) | 6813 | mstr) |
| 6797 | (verilog-read-sub-decls-expr submoddecls comment port mstr)))) | 6814 | (while (setq mstr (pop mlst)) |
| 6815 | (verilog-read-sub-decls-expr submoddecls comment port mstr))))) | ||
| 6798 | (t | 6816 | (t |
| 6799 | (let (sig vec multidim) | 6817 | (let (sig vec multidim) |
| 6800 | (cond ;; Find \signal. Final space is part of escaped signal name | 6818 | (cond ;; Find \signal. Final space is part of escaped signal name |
| @@ -7017,7 +7035,7 @@ IGNORE-NEXT is true to ignore next token, fake from inside case statement." | |||
| 7017 | (point))) | 7035 | (point))) |
| 7018 | sig-last-tolk sig-tolk | 7036 | sig-last-tolk sig-tolk |
| 7019 | sig-tolk nil) | 7037 | sig-tolk nil) |
| 7020 | ;;(if dbg (setq dbg (concat dbg (format "\tPt=%S %S\trv=%S in=%S ee=%S\n" (point) keywd rvalue ignore-next end-else-check)))) | 7038 | ;;(if dbg (setq dbg (concat dbg (format "\tPt=%S %S\trv=%S in=%S ee=%S gs=%S\n" (point) keywd rvalue ignore-next end-else-check got-sig)))) |
| 7021 | (cond | 7039 | (cond |
| 7022 | ((equal keywd "\"") | 7040 | ((equal keywd "\"") |
| 7023 | (or (re-search-forward "[^\\]\"" nil t) | 7041 | (or (re-search-forward "[^\\]\"" nil t) |
| @@ -7044,7 +7062,7 @@ IGNORE-NEXT is true to ignore next token, fake from inside case statement." | |||
| 7044 | (setq end-else-check t)) | 7062 | (setq end-else-check t)) |
| 7045 | (forward-char 1)) | 7063 | (forward-char 1)) |
| 7046 | ((equal keywd "'") | 7064 | ((equal keywd "'") |
| 7047 | (if (looking-at "'s?[hdxbo][0-9a-fA-F_xz? \t]*") | 7065 | (if (looking-at "'[sS]?[hdxboHDXBO]?[ \t]*[0-9a-fA-F_xzXZ?]+") |
| 7048 | (goto-char (match-end 0)) | 7066 | (goto-char (match-end 0)) |
| 7049 | (forward-char 1))) | 7067 | (forward-char 1))) |
| 7050 | ((equal keywd ":") ;; Case statement, begin/end label, x?y:z | 7068 | ((equal keywd ":") ;; Case statement, begin/end label, x?y:z |
| @@ -7137,10 +7155,7 @@ IGNORE-NEXT is true to ignore next token, fake from inside case statement." | |||
| 7137 | uses-delayed) ;; Found signal/rvalue; push if not function | 7155 | uses-delayed) ;; Found signal/rvalue; push if not function |
| 7138 | (search-forward ")") | 7156 | (search-forward ")") |
| 7139 | (verilog-read-always-signals-recurse nil nil nil) | 7157 | (verilog-read-always-signals-recurse nil nil nil) |
| 7140 | ;;(if dbg (with-current-buffer (get-buffer-create "*vl-dbg*") | 7158 | ;;(if dbg (with-current-buffer (get-buffer-create "*vl-dbg*")) (delete-region (point-min) (point-max)) (insert dbg) (setq dbg "")) |
| 7141 | ;; (delete-region (point-min) (point-max)) | ||
| 7142 | ;; (insert dbg) | ||
| 7143 | ;; (setq dbg ""))) | ||
| 7144 | ;; Return what was found | 7159 | ;; Return what was found |
| 7145 | (list sigs-out nil sigs-in uses-delayed)))) | 7160 | (list sigs-out nil sigs-in uses-delayed)))) |
| 7146 | 7161 | ||
| @@ -7188,7 +7203,7 @@ list of ( (signal_name connection_name)... )." | |||
| 7188 | (goto-char (match-end 0)) | 7203 | (goto-char (match-end 0)) |
| 7189 | ;; Parse "REGEXP" | 7204 | ;; Parse "REGEXP" |
| 7190 | ;; We reserve @"..." for future lisp expressions that evaluate once-per-AUTOINST | 7205 | ;; We reserve @"..." for future lisp expressions that evaluate once-per-AUTOINST |
| 7191 | (when (looking-at "\\s-*\"\\([^\"]*)\\)\"") | 7206 | (when (looking-at "\\s-*\"\\([^\"]*\\)\"") |
| 7192 | (setq tpl-regexp (match-string 1)) | 7207 | (setq tpl-regexp (match-string 1)) |
| 7193 | (goto-char (match-end 0))) | 7208 | (goto-char (match-end 0))) |
| 7194 | (search-forward "(") | 7209 | (search-forward "(") |
| @@ -7256,13 +7271,13 @@ Optionally associate it with the specified enumeration ENUMNAME." | |||
| 7256 | (let ((mac (intern (concat "vh-" defname)))) | 7271 | (let ((mac (intern (concat "vh-" defname)))) |
| 7257 | ;;(message "Define %s=%s" defname defvalue) (sleep-for 1) | 7272 | ;;(message "Define %s=%s" defname defvalue) (sleep-for 1) |
| 7258 | ;; Need to define to a constant if no value given | 7273 | ;; Need to define to a constant if no value given |
| 7259 | (set (make-variable-buffer-local mac) | 7274 | (set (make-local-variable mac) |
| 7260 | (if (equal defvalue "") "1" defvalue))) | 7275 | (if (equal defvalue "") "1" defvalue))) |
| 7261 | (if enumname | 7276 | (if enumname |
| 7262 | (let ((enumvar (intern (concat "venum-" enumname)))) | 7277 | (let ((enumvar (intern (concat "venum-" enumname)))) |
| 7263 | ;;(message "Define %s=%s" defname defvalue) (sleep-for 1) | 7278 | ;;(message "Define %s=%s" defname defvalue) (sleep-for 1) |
| 7264 | (unless (boundp enumvar) (set enumvar nil)) | 7279 | (unless (boundp enumvar) (set enumvar nil)) |
| 7265 | (make-variable-buffer-local enumvar) | 7280 | (make-local-variable enumvar) |
| 7266 | (add-to-list enumvar defname))))) | 7281 | (add-to-list enumvar defname))))) |
| 7267 | 7282 | ||
| 7268 | (defun verilog-read-defines (&optional filename recurse subcall) | 7283 | (defun verilog-read-defines (&optional filename recurse subcall) |
| @@ -7499,8 +7514,7 @@ Some macros and such are also found and included. For dinotrace.el." | |||
| 7499 | (forward-line 1) | 7514 | (forward-line 1) |
| 7500 | (when (string-match "//" line) | 7515 | (when (string-match "//" line) |
| 7501 | (setq line (substring line 0 (match-beginning 0)))) | 7516 | (setq line (substring line 0 (match-beginning 0)))) |
| 7502 | ;; Variables are buffer-local, so need right context. | 7517 | (with-current-buffer orig-buffer ; Variables are buffer-local, so need right context. |
| 7503 | (with-current-buffer orig-buffer | ||
| 7504 | (verilog-getopt line)))))) | 7518 | (verilog-getopt line)))))) |
| 7505 | 7519 | ||
| 7506 | (defun verilog-getopt-flags () | 7520 | (defun verilog-getopt-flags () |
| @@ -7602,15 +7616,16 @@ Allows version control to check out the file if need be." | |||
| 7602 | (vc-backend filename))) | 7616 | (vc-backend filename))) |
| 7603 | (let (pt) | 7617 | (let (pt) |
| 7604 | (with-current-buffer (find-file-noselect filename) | 7618 | (with-current-buffer (find-file-noselect filename) |
| 7605 | (goto-char (point-min)) | 7619 | (save-excursion |
| 7606 | (while (and | 7620 | (goto-char (point-min)) |
| 7607 | ;; It may be tempting to look for verilog-defun-re, | 7621 | (while (and |
| 7608 | ;; don't, it slows things down a lot! | 7622 | ;; It may be tempting to look for verilog-defun-re, |
| 7609 | (verilog-re-search-forward-quick "\\<module\\>" nil t) | 7623 | ;; don't, it slows things down a lot! |
| 7610 | (verilog-re-search-forward-quick "[(;]" nil t)) | 7624 | (verilog-re-search-forward-quick "\\<module\\>" nil t) |
| 7611 | (if (equal module (verilog-read-module-name)) | 7625 | (verilog-re-search-forward-quick "[(;]" nil t)) |
| 7612 | (setq pt (point)))) | 7626 | (if (equal module (verilog-read-module-name)) |
| 7613 | pt)))) | 7627 | (setq pt (point)))) |
| 7628 | pt))))) | ||
| 7614 | 7629 | ||
| 7615 | (defun verilog-is-number (symbol) | 7630 | (defun verilog-is-number (symbol) |
| 7616 | "Return true if SYMBOL is number-like." | 7631 | "Return true if SYMBOL is number-like." |
| @@ -9731,7 +9746,7 @@ same expansion will result from only extracting signals starting with i: | |||
| 9731 | 9746 | ||
| 9732 | /*AUTOINOUTMODULE(\"ExampMain\",\"^i\")*/ | 9747 | /*AUTOINOUTMODULE(\"ExampMain\",\"^i\")*/ |
| 9733 | 9748 | ||
| 9734 | You may also provide an optional second regulat expression, in | 9749 | You may also provide an optional second regular expression, in |
| 9735 | which case only signals which have that pin direction and data | 9750 | which case only signals which have that pin direction and data |
| 9736 | type will be included. This matches against everything before | 9751 | type will be included. This matches against everything before |
| 9737 | the signal name in the declaration, for example against | 9752 | the signal name in the declaration, for example against |