diff options
| author | Glenn Morris | 2007-12-18 02:32:40 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-12-18 02:32:40 +0000 |
| commit | 4f9d920a2d764ffe93e7ec1a75c70cb1d46810f0 (patch) | |
| tree | ddee2ee1a8eac253aaa3c313047a26601a021726 | |
| parent | 27558c0dd51aafd1a94555b5911e4905e48025d7 (diff) | |
| download | emacs-4f9d920a2d764ffe93e7ec1a75c70cb1d46810f0.tar.gz emacs-4f9d920a2d764ffe93e7ec1a75c70cb1d46810f0.zip | |
Replace all instances of string-to-int with string-to-number,
insert-string with insert, and read-input with read-string.
(top-level): No need to require imenu, reporter, dinotrace, vc,
font-lock when compiling. Always require compile. Relegate remaining
compatibility cruft to XEmacs. Don't require font-lock.
(verilog-version): Remove superfluous concat.
(dinotrace-unannotate-all, zmacs-activate-region)
(customize-apropos): No need to define.
(verilog-regexp-opt): On Emacs, just make it an alias for regexp-opt.
(verilog-font-lock-keywords, verilog-font-lock-keywords-1)
(verilog-font-lock-keywords-2, verilog-font-lock-keywords-3)
(verilog-startup-message-displayed): These are variables, not constants.
(verilog-batch-execute-func, verilog-auto-inst)
(verilog-auto-inst-param): Use mapc rather than mapcar.
(sigs-in, sigs-inout, sigs-out): Define for compiler rather than
actually defining.
(verilog-modi-get-decls, verilog-modi-get-sub-decls)
(verilog-modi-get-outputs, verilog-modi-get-inouts)
(verilog-modi-get-inputs, verilog-modi-get-wires)
(verilog-modi-get-regs, verilog-modi-get-assigns)
(verilog-modi-get-consts, verilog-modi-get-gparams)
(verilog-modi-get-sub-outputs, verilog-modi-get-sub-inouts)
(verilog-modi-get-sub-inputs): Move inline functions earlier in
the file.
(sigs-in, sigs-out): Don't declare multiple times.
(got-sig, got-rvalue, uses-delayed): Define for compiler with just
`defvar'.
(verilog-auto): Call dinotrace-unannotate-all only if bound.
(verilog-module-inside-filename-p): No need to wrap fboundp test
in condition-case.
(reporter-submit-bug-report): Autoload it.
(verilog-mark-defun): Call zmacs-activate-region only if bound.
(verilog-font-customize): Call customize-apropos only if bound.
(verilog-getopt-flags, verilog-auto-reeval-locals): Use
make-local-variable rather than make-variable-buffer-local.
(verilog-company, verilog-project, verilog-modi-cache-list): Move
make-variable-buffer-local calls to top-level.
(font-lock-defaults-alist): Don't define it.
(verilog-need-fld): Remove.
(verilog-font-lock-init): Don't set font-lock-defaults-alist.
(verilog-mode): Only call make-local-hook on XEmacs. Set
font-lock-defaults rather than using verilog-font-lock-init.
| -rw-r--r-- | lisp/ChangeLog | 52 | ||||
| -rw-r--r-- | lisp/progmodes/verilog-mode.el | 520 |
2 files changed, 295 insertions, 277 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 02b51f7ae0b..30b7a23d712 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,55 @@ | |||
| 1 | 2007-12-18 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/cc-subword.el (c-subword-mode): Drop support for | ||
| 4 | systems without define-minor-mode. | ||
| 5 | |||
| 6 | * progmodes/cc-vars.el (defcustom-c-stylevar): Remove debugging | ||
| 7 | message. | ||
| 8 | |||
| 9 | * progmodes/verilog-mode.el: Replace all instances of | ||
| 10 | string-to-int with string-to-number, insert-string with insert, | ||
| 11 | and read-input with read-string. | ||
| 12 | (top-level): No need to require imenu, reporter, dinotrace, vc, | ||
| 13 | font-lock when compiling. Always require compile. Relegate remaining | ||
| 14 | compatibility cruft to XEmacs. Don't require font-lock. | ||
| 15 | (verilog-version): Remove superfluous concat. | ||
| 16 | (dinotrace-unannotate-all, zmacs-activate-region) | ||
| 17 | (customize-apropos): No need to define. | ||
| 18 | (verilog-regexp-opt): On Emacs, just make it an alias for regexp-opt. | ||
| 19 | (verilog-font-lock-keywords, verilog-font-lock-keywords-1) | ||
| 20 | (verilog-font-lock-keywords-2, verilog-font-lock-keywords-3) | ||
| 21 | (verilog-startup-message-displayed): These are variables, not constants. | ||
| 22 | (verilog-batch-execute-func, verilog-auto-inst) | ||
| 23 | (verilog-auto-inst-param): Use mapc rather than mapcar. | ||
| 24 | (sigs-in, sigs-inout, sigs-out): Define for compiler rather than | ||
| 25 | actually defining. | ||
| 26 | (verilog-modi-get-decls, verilog-modi-get-sub-decls) | ||
| 27 | (verilog-modi-get-outputs, verilog-modi-get-inouts) | ||
| 28 | (verilog-modi-get-inputs, verilog-modi-get-wires) | ||
| 29 | (verilog-modi-get-regs, verilog-modi-get-assigns) | ||
| 30 | (verilog-modi-get-consts, verilog-modi-get-gparams) | ||
| 31 | (verilog-modi-get-sub-outputs, verilog-modi-get-sub-inouts) | ||
| 32 | (verilog-modi-get-sub-inputs): Move inline functions earlier in | ||
| 33 | the file. | ||
| 34 | (sigs-in, sigs-out): Don't declare multiple times. | ||
| 35 | (got-sig, got-rvalue, uses-delayed): Define for compiler with just | ||
| 36 | `defvar'. | ||
| 37 | (verilog-auto): Call dinotrace-unannotate-all only if bound. | ||
| 38 | (verilog-module-inside-filename-p): No need to wrap fboundp test | ||
| 39 | in condition-case. | ||
| 40 | (reporter-submit-bug-report): Autoload it. | ||
| 41 | (verilog-mark-defun): Call zmacs-activate-region only if bound. | ||
| 42 | (verilog-font-customize): Call customize-apropos only if bound. | ||
| 43 | (verilog-getopt-flags, verilog-auto-reeval-locals): Use | ||
| 44 | make-local-variable rather than make-variable-buffer-local. | ||
| 45 | (verilog-company, verilog-project, verilog-modi-cache-list): Move | ||
| 46 | make-variable-buffer-local calls to top-level. | ||
| 47 | (font-lock-defaults-alist): Don't define it. | ||
| 48 | (verilog-need-fld): Remove. | ||
| 49 | (verilog-font-lock-init): Don't set font-lock-defaults-alist. | ||
| 50 | (verilog-mode): Only call make-local-hook on XEmacs. Set | ||
| 51 | font-lock-defaults rather than using verilog-font-lock-init. | ||
| 52 | |||
| 1 | 2007-12-17 Andreas Schwab <schwab@suse.de> | 53 | 2007-12-17 Andreas Schwab <schwab@suse.de> |
| 2 | 54 | ||
| 3 | * progmodes/sh-script.el (sh-font-lock-syntactic-keywords): Fix | 55 | * progmodes/sh-script.el (sh-font-lock-syntactic-keywords): Fix |
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 2d34d9d599a..884e85e47f2 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el | |||
| @@ -115,164 +115,135 @@ | |||
| 115 | (defun verilog-version () | 115 | (defun verilog-version () |
| 116 | "Inform caller of the version of this file." | 116 | "Inform caller of the version of this file." |
| 117 | (interactive) | 117 | (interactive) |
| 118 | (message (concat "Using verilog-mode version " verilog-mode-version) )) | 118 | (message "Using verilog-mode version %s" verilog-mode-version)) |
| 119 | |||
| 120 | (require 'compile) | ||
| 119 | 121 | ||
| 120 | ;; Insure we have certain packages, and deal with it if we don't | 122 | ;; Insure we have certain packages, and deal with it if we don't |
| 121 | (eval-when-compile | 123 | (eval-when-compile |
| 122 | (condition-case nil | 124 | (when (featurep 'xemacs) |
| 123 | (require 'imenu) | 125 | (condition-case nil |
| 124 | (error nil)) | 126 | (require 'easymenu) |
| 125 | (condition-case nil | 127 | (error nil)) |
| 126 | (require 'reporter) | 128 | (condition-case nil |
| 127 | (error nil)) | 129 | (require 'regexp-opt) |
| 128 | (condition-case nil | 130 | (error nil)) |
| 129 | (require 'easymenu) | 131 | ;; Bug in 19.28 through 19.30 skeleton.el, not provided. |
| 130 | (error nil)) | 132 | (condition-case nil |
| 131 | (condition-case nil | 133 | (load "skeleton") |
| 132 | (require 'regexp-opt) | 134 | (error nil)) |
| 133 | (error nil)) | 135 | (condition-case nil |
| 134 | (condition-case nil | 136 | (if (fboundp 'when) |
| 135 | (load "skeleton") ;; bug in 19.28 through 19.30 skeleton.el, not provided. | 137 | nil ;; fab |
| 136 | (error nil)) | 138 | (defmacro when (cond &rest body) |
| 137 | (condition-case nil | 139 | (list 'if cond (cons 'progn body)))) |
| 138 | (require 'vc) | 140 | (error nil)) |
| 139 | (error nil)) | 141 | (condition-case nil |
| 140 | (condition-case nil | 142 | (if (fboundp 'unless) |
| 141 | (if (fboundp 'when) | 143 | nil ;; fab |
| 142 | nil ;; fab | 144 | (defmacro unless (cond &rest body) |
| 143 | (defmacro when (cond &rest body) | 145 | (cons 'if (cons cond (cons nil body))))) |
| 144 | (list 'if cond (cons 'progn body)))) | 146 | (error nil)) |
| 145 | (error nil)) | 147 | (condition-case nil |
| 146 | (condition-case nil | 148 | (if (fboundp 'store-match-data) |
| 147 | (if (fboundp 'unless) | 149 | nil ;; fab |
| 148 | nil ;; fab | 150 | (defmacro store-match-data (&rest args) nil)) |
| 149 | (defmacro unless (cond &rest body) | 151 | (error nil)) |
| 150 | (cons 'if (cons cond (cons nil body))))) | 152 | (condition-case nil |
| 151 | (error nil)) | 153 | (if (boundp 'current-menubar) |
| 152 | (condition-case nil | 154 | nil ;; great |
| 153 | (if (fboundp 'store-match-data) | 155 | (progn |
| 154 | nil ;; fab | 156 | (defmacro add-submenu (&rest args) nil)) |
| 155 | (defmacro store-match-data (&rest args) nil)) | 157 | ) |
| 156 | (error nil)) | 158 | (error nil)) |
| 157 | (if (featurep 'xemacs) | 159 | (condition-case nil |
| 158 | (condition-case nil | 160 | (if (fboundp 'char-before) |
| 159 | (if (boundp 'current-menubar) | 161 | nil ;; great |
| 160 | nil ;; great | 162 | (defmacro char-before (&rest body) |
| 161 | (progn | 163 | (char-after (1- (point))))) |
| 162 | (defmacro add-submenu (&rest args) nil)) | 164 | (error nil)) |
| 163 | ) | 165 | (condition-case nil |
| 164 | (error nil))) | 166 | (require 'custom) |
| 165 | (condition-case nil | 167 | (error nil)) |
| 166 | (if (fboundp 'zmacs-activate-region) | 168 | (condition-case nil |
| 167 | nil ;; great | 169 | (if (fboundp 'match-string-no-properties) |
| 168 | (defmacro zmacs-activate-region (&rest args) nil)) | 170 | nil ;; great |
| 169 | (error nil)) | 171 | (defsubst match-string-no-properties (num &optional string) |
| 170 | (condition-case nil | 172 | "Return string of text matched by last search, without text properties. |
| 171 | (if (fboundp 'char-before) | ||
| 172 | nil ;; great | ||
| 173 | (defmacro char-before (&rest body) | ||
| 174 | (char-after (1- (point))))) | ||
| 175 | (error nil)) | ||
| 176 | ;; Requires to define variables that would be "free" warnings | ||
| 177 | (condition-case nil | ||
| 178 | (require 'font-lock) | ||
| 179 | (error nil)) | ||
| 180 | (condition-case nil | ||
| 181 | (require 'compile) | ||
| 182 | (error nil)) | ||
| 183 | (condition-case nil | ||
| 184 | (require 'custom) | ||
| 185 | (error nil)) | ||
| 186 | (condition-case nil | ||
| 187 | (require 'dinotrace) | ||
| 188 | (error nil)) | ||
| 189 | (condition-case nil | ||
| 190 | (if (fboundp 'dinotrace-unannotate-all) | ||
| 191 | nil ;; great | ||
| 192 | (defun dinotrace-unannotate-all (&rest args) nil)) | ||
| 193 | (error nil)) | ||
| 194 | (condition-case nil | ||
| 195 | (if (fboundp 'customize-apropos) | ||
| 196 | nil ;; great | ||
| 197 | (defun customize-apropos (&rest args) nil)) | ||
| 198 | (error nil)) | ||
| 199 | (condition-case nil | ||
| 200 | (if (fboundp 'match-string-no-properties) | ||
| 201 | nil ;; great | ||
| 202 | (defsubst match-string-no-properties (num &optional string) | ||
| 203 | "Return string of text matched by last search, without text properties. | ||
| 204 | NUM specifies which parenthesized expression in the last regexp. | 173 | NUM specifies which parenthesized expression in the last regexp. |
| 205 | Value is nil if NUMth pair didn't match, or there were less than NUM pairs. | 174 | Value is nil if NUMth pair didn't match, or there were less than NUM pairs. |
| 206 | Zero means the entire text matched by the whole regexp or whole string. | 175 | Zero means the entire text matched by the whole regexp or whole string. |
| 207 | STRING should be given if the last search was by `string-match' on STRING." | 176 | STRING should be given if the last search was by `string-match' on STRING." |
| 208 | (if (match-beginning num) | 177 | (if (match-beginning num) |
| 209 | (if string | 178 | (if string |
| 210 | (let ((result | 179 | (let ((result |
| 211 | (substring string (match-beginning num) (match-end num)))) | 180 | (substring string (match-beginning num) (match-end num)))) |
| 212 | (set-text-properties 0 (length result) nil result) | 181 | (set-text-properties 0 (length result) nil result) |
| 213 | result) | 182 | result) |
| 214 | (buffer-substring-no-properties (match-beginning num) | 183 | (buffer-substring-no-properties (match-beginning num) |
| 215 | (match-end num) | 184 | (match-end num) |
| 216 | (current-buffer) | 185 | (current-buffer) |
| 217 | ))))) | 186 | ))))) |
| 218 | (error nil)) | 187 | (error nil)) |
| 219 | (if (and (featurep 'custom) (fboundp 'custom-declare-variable)) | 188 | (if (and (featurep 'custom) (fboundp 'custom-declare-variable)) |
| 220 | nil ;; We've got what we needed | 189 | nil ;; We've got what we needed |
| 221 | ;; We have the old custom-library, hack around it! | 190 | ;; We have the old custom-library, hack around it! |
| 222 | (defmacro defgroup (&rest args) nil) | 191 | (defmacro defgroup (&rest args) nil) |
| 223 | (defmacro customize (&rest args) | 192 | (defmacro customize (&rest args) |
| 224 | (message "Sorry, Customize is not available with this version of emacs")) | 193 | (message "Sorry, Customize is not available with this version of emacs")) |
| 225 | (defmacro defcustom (var value doc &rest args) | 194 | (defmacro defcustom (var value doc &rest args) |
| 226 | `(defvar ,var ,value ,doc)) | 195 | `(defvar ,var ,value ,doc)) |
| 227 | ) | 196 | ) |
| 228 | (if (fboundp 'defface) | 197 | (if (fboundp 'defface) |
| 229 | nil ; great! | 198 | nil ; great! |
| 230 | (defmacro defface (var values doc &rest args) | 199 | (defmacro defface (var values doc &rest args) |
| 231 | `(make-face ,var)) | 200 | `(make-face ,var)) |
| 232 | ) | 201 | ) |
| 233 | 202 | ||
| 234 | (if (and (featurep 'custom) (fboundp 'customize-group)) | 203 | (if (and (featurep 'custom) (fboundp 'customize-group)) |
| 235 | nil ;; We've got what we needed | 204 | nil ;; We've got what we needed |
| 236 | ;; We have an intermediate custom-library, hack around it! | 205 | ;; We have an intermediate custom-library, hack around it! |
| 237 | (defmacro customize-group (var &rest args) | 206 | (defmacro customize-group (var &rest args) |
| 238 | `(customize ,var)) | 207 | `(customize ,var)) |
| 239 | ) | 208 | ))) |
| 240 | 209 | ||
| 241 | ) | ||
| 242 | ;; Provide a regular expression optimization routine, using regexp-opt | 210 | ;; Provide a regular expression optimization routine, using regexp-opt |
| 243 | ;; if provided by the user's elisp libraries | 211 | ;; if provided by the user's elisp libraries |
| 244 | (eval-and-compile | 212 | (eval-and-compile |
| 245 | (if (fboundp 'regexp-opt) | 213 | (if (featurep 'xemacs) |
| 246 | ;; regexp-opt is defined, does it take 3 or 2 arguments? | 214 | (if (fboundp 'regexp-opt) |
| 247 | (if (fboundp 'function-max-args) | 215 | ;; regexp-opt is defined, does it take 3 or 2 arguments? |
| 248 | (let ((args (function-max-args `regexp-opt))) | 216 | (if (fboundp 'function-max-args) |
| 249 | (cond | 217 | (let ((args (function-max-args `regexp-opt))) |
| 250 | ((eq args 3) ;; It takes 3 | 218 | (cond |
| 251 | (condition-case nil ; Hide this defun from emacses | 219 | ((eq args 3) ;; It takes 3 |
| 220 | (condition-case nil ; Hide this defun from emacses | ||
| 252 | ;with just a two input regexp | 221 | ;with just a two input regexp |
| 253 | (defun verilog-regexp-opt (a b) | 222 | (defun verilog-regexp-opt (a b) |
| 254 | "Deal with differing number of required arguments for `regexp-opt'. | 223 | "Deal with differing number of required arguments for `regexp-opt'. |
| 255 | Call 'regexp-opt' on A and B." | 224 | Call 'regexp-opt' on A and B." |
| 256 | (regexp-opt a b 't) | 225 | (regexp-opt a b 't) |
| 257 | ) | 226 | ) |
| 258 | (error nil)) | 227 | (error nil)) |
| 259 | ) | 228 | ) |
| 260 | ((eq args 2) ;; It takes 2 | 229 | ((eq args 2) ;; It takes 2 |
| 261 | (defun verilog-regexp-opt (a b) | 230 | (defun verilog-regexp-opt (a b) |
| 262 | "Call 'regexp-opt' on A and B." | 231 | "Call 'regexp-opt' on A and B." |
| 263 | (regexp-opt a b)) | 232 | (regexp-opt a b)) |
| 264 | ) | 233 | ) |
| 265 | (t nil))) | 234 | (t nil))) |
| 266 | ;; We can't tell; assume it takes 2 | 235 | ;; We can't tell; assume it takes 2 |
| 267 | (defun verilog-regexp-opt (a b) | 236 | (defun verilog-regexp-opt (a b) |
| 268 | "Call 'regexp-opt' on A and B." | 237 | "Call 'regexp-opt' on A and B." |
| 269 | (regexp-opt a b)) | 238 | (regexp-opt a b)) |
| 270 | ) | 239 | ) |
| 271 | ;; There is no regexp-opt, provide our own | 240 | ;; There is no regexp-opt, provide our own |
| 272 | (defun verilog-regexp-opt (strings &optional paren shy) | 241 | (defun verilog-regexp-opt (strings &optional paren shy) |
| 273 | (let ((open (if paren "\\(" "")) (close (if paren "\\)" ""))) | 242 | (let ((open (if paren "\\(" "")) (close (if paren "\\)" ""))) |
| 274 | (concat open (mapconcat 'regexp-quote strings "\\|") close))) | 243 | (concat open (mapconcat 'regexp-quote strings "\\|") close))) |
| 275 | )) | 244 | ) |
| 245 | ;; Emacs. | ||
| 246 | (defalias 'verilog-regexp-opt 'regexp-opt))) | ||
| 276 | 247 | ||
| 277 | (eval-when-compile | 248 | (eval-when-compile |
| 278 | (defun verilog-regexp-words (a) | 249 | (defun verilog-regexp-words (a) |
| @@ -287,7 +258,8 @@ STRING should be given if the last search was by `string-match' on STRING." | |||
| 287 | (defun verilog-font-customize () | 258 | (defun verilog-font-customize () |
| 288 | "Link to customize fonts used for Verilog." | 259 | "Link to customize fonts used for Verilog." |
| 289 | (interactive) | 260 | (interactive) |
| 290 | (customize-apropos "font-lock-*" 'faces)) | 261 | (if (fboundp 'customize-apropos) |
| 262 | (customize-apropos "font-lock-*" 'faces))) | ||
| 291 | 263 | ||
| 292 | (defgroup verilog-mode nil | 264 | (defgroup verilog-mode nil |
| 293 | "Facilitates easy editing of Verilog source text" | 265 | "Facilitates easy editing of Verilog source text" |
| @@ -872,10 +844,14 @@ format (e.g. 09/17/1997) is not supported.") | |||
| 872 | "*Default name of Company for verilog header. | 844 | "*Default name of Company for verilog header. |
| 873 | If set will become buffer local.") | 845 | If set will become buffer local.") |
| 874 | 846 | ||
| 847 | (make-variable-buffer-local 'verilog-company) | ||
| 848 | |||
| 875 | (defvar verilog-project nil | 849 | (defvar verilog-project nil |
| 876 | "*Default name of Project for verilog header. | 850 | "*Default name of Project for verilog header. |
| 877 | If set will become buffer local.") | 851 | If set will become buffer local.") |
| 878 | 852 | ||
| 853 | (make-variable-buffer-local 'verilog-project) | ||
| 854 | |||
| 879 | (defvar verilog-mode-map | 855 | (defvar verilog-mode-map |
| 880 | (let ((map (make-sparse-keymap))) | 856 | (let ((map (make-sparse-keymap))) |
| 881 | (define-key map ";" 'electric-verilog-semi) | 857 | (define-key map ";" 'electric-verilog-semi) |
| @@ -1685,10 +1661,10 @@ Called by `compilation-mode-hook'. This allows \\[next-error] to find the error | |||
| 1685 | ;; figure out version numbers if not already discovered | 1661 | ;; figure out version numbers if not already discovered |
| 1686 | (and (or (not major) (not minor)) | 1662 | (and (or (not major) (not minor)) |
| 1687 | (string-match "\\([0-9]+\\).\\([0-9]+\\)" emacs-version) | 1663 | (string-match "\\([0-9]+\\).\\([0-9]+\\)" emacs-version) |
| 1688 | (setq major (string-to-int (substring emacs-version | 1664 | (setq major (string-to-number (substring emacs-version |
| 1689 | (match-beginning 1) | 1665 | (match-beginning 1) |
| 1690 | (match-end 1))) | 1666 | (match-end 1))) |
| 1691 | minor (string-to-int (substring emacs-version | 1667 | minor (string-to-number (substring emacs-version |
| 1692 | (match-beginning 2) | 1668 | (match-beginning 2) |
| 1693 | (match-end 2))))) | 1669 | (match-end 2))))) |
| 1694 | (if (not (and major minor)) | 1670 | (if (not (and major minor)) |
| @@ -1827,17 +1803,17 @@ supported list, along with the values for this variable: | |||
| 1827 | (defvar verilog-mode-syntax-table nil | 1803 | (defvar verilog-mode-syntax-table nil |
| 1828 | "Syntax table used in `verilog-mode' buffers.") | 1804 | "Syntax table used in `verilog-mode' buffers.") |
| 1829 | 1805 | ||
| 1830 | (defconst verilog-font-lock-keywords nil | 1806 | (defvar verilog-font-lock-keywords nil |
| 1831 | "Default highlighting for Verilog mode.") | 1807 | "Default highlighting for Verilog mode.") |
| 1832 | 1808 | ||
| 1833 | (defconst verilog-font-lock-keywords-1 nil | 1809 | (defvar verilog-font-lock-keywords-1 nil |
| 1834 | "Subdued level highlighting for Verilog mode.") | 1810 | "Subdued level highlighting for Verilog mode.") |
| 1835 | 1811 | ||
| 1836 | (defconst verilog-font-lock-keywords-2 nil | 1812 | (defvar verilog-font-lock-keywords-2 nil |
| 1837 | "Medium level highlighting for Verilog mode. | 1813 | "Medium level highlighting for Verilog mode. |
| 1838 | See also `verilog-font-lock-extra-types'.") | 1814 | See also `verilog-font-lock-extra-types'.") |
| 1839 | 1815 | ||
| 1840 | (defconst verilog-font-lock-keywords-3 nil | 1816 | (defvar verilog-font-lock-keywords-3 nil |
| 1841 | "Gaudy level highlighting for Verilog mode. | 1817 | "Gaudy level highlighting for Verilog mode. |
| 1842 | See also `verilog-font-lock-extra-types'.") | 1818 | See also `verilog-font-lock-extra-types'.") |
| 1843 | (defvar verilog-font-lock-translate-off-face | 1819 | (defvar verilog-font-lock-translate-off-face |
| @@ -2244,10 +2220,6 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2244 | (defun verilog-declaration-beg () | 2220 | (defun verilog-declaration-beg () |
| 2245 | (verilog-re-search-backward verilog-declaration-re (bobp) t)) | 2221 | (verilog-re-search-backward verilog-declaration-re (bobp) t)) |
| 2246 | 2222 | ||
| 2247 | (require 'font-lock) | ||
| 2248 | (defvar verilog-need-fld 1) | ||
| 2249 | (defvar font-lock-defaults-alist nil) ;In case we are XEmacs | ||
| 2250 | |||
| 2251 | (defun verilog-font-lock-init () | 2223 | (defun verilog-font-lock-init () |
| 2252 | "Initialize fontification." | 2224 | "Initialize fontification." |
| 2253 | ;; highlight keywords and standardized types, attributes, enumeration | 2225 | ;; highlight keywords and standardized types, attributes, enumeration |
| @@ -2257,38 +2229,19 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2257 | (when verilog-highlight-translate-off | 2229 | (when verilog-highlight-translate-off |
| 2258 | (list | 2230 | (list |
| 2259 | ;; Fontify things in translate off regions | 2231 | ;; Fontify things in translate off regions |
| 2260 | '(verilog-match-translate-off (0 'verilog-font-lock-translate-off-face prepend)) | 2232 | '(verilog-match-translate-off |
| 2261 | )) | 2233 | (0 'verilog-font-lock-translate-off-face prepend)) |
| 2262 | ) | 2234 | )))) |
| 2263 | ) | ||
| 2264 | (put 'verilog-mode 'font-lock-defaults | 2235 | (put 'verilog-mode 'font-lock-defaults |
| 2265 | '((verilog-font-lock-keywords | 2236 | '((verilog-font-lock-keywords |
| 2266 | verilog-font-lock-keywords-1 | 2237 | verilog-font-lock-keywords-1 |
| 2267 | verilog-font-lock-keywords-2 | 2238 | verilog-font-lock-keywords-2 |
| 2268 | verilog-font-lock-keywords-3 | 2239 | verilog-font-lock-keywords-3) |
| 2269 | ) | 2240 | nil ; nil means highlight strings & comments as well as keywords |
| 2270 | nil ;; nil means highlight strings & comments as well as keywords | 2241 | nil ; nil means keywords must match case |
| 2271 | nil ;; nil means keywords must match case | 2242 | nil ; syntax table handled elsewhere |
| 2272 | nil ;; syntax table handled elsewhere | 2243 | ;; Function to move to beginning of reasonable region to highlight |
| 2273 | verilog-beg-of-defun ;; function to move to beginning of reasonable region to highlight | 2244 | verilog-beg-of-defun))) |
| 2274 | )) | ||
| 2275 | (if verilog-need-fld | ||
| 2276 | (let ((verilog-mode-defaults | ||
| 2277 | '((verilog-font-lock-keywords | ||
| 2278 | verilog-font-lock-keywords-1 | ||
| 2279 | verilog-font-lock-keywords-2 | ||
| 2280 | verilog-font-lock-keywords-3 | ||
| 2281 | ) | ||
| 2282 | nil ;; nil means highlight strings & comments as well as keywords | ||
| 2283 | nil ;; nil means keywords must match case | ||
| 2284 | nil ;; syntax table handled elsewhere | ||
| 2285 | verilog-beg-of-defun ;; function to move to beginning of reasonable region to highlight | ||
| 2286 | ))) | ||
| 2287 | (setq font-lock-defaults-alist | ||
| 2288 | (append | ||
| 2289 | font-lock-defaults-alist | ||
| 2290 | (list (cons 'verilog-mode verilog-mode-defaults)))) | ||
| 2291 | (setq verilog-need-fld 0)))) | ||
| 2292 | 2245 | ||
| 2293 | ;; initialize fontification for Verilog Mode | 2246 | ;; initialize fontification for Verilog Mode |
| 2294 | (verilog-font-lock-init) | 2247 | (verilog-font-lock-init) |
| @@ -2297,7 +2250,7 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2297 | '("Please use \\[verilog-submit-bug-report] to report bugs." | 2250 | '("Please use \\[verilog-submit-bug-report] to report bugs." |
| 2298 | "Visit http://www.verilog.com to check for updates" | 2251 | "Visit http://www.verilog.com to check for updates" |
| 2299 | )) | 2252 | )) |
| 2300 | (defconst verilog-startup-message-displayed t) | 2253 | (defvar verilog-startup-message-displayed t) |
| 2301 | (defun verilog-display-startup-message () | 2254 | (defun verilog-display-startup-message () |
| 2302 | (if (not verilog-startup-message-displayed) | 2255 | (if (not verilog-startup-message-displayed) |
| 2303 | (if (sit-for 5) | 2256 | (if (sit-for 5) |
| @@ -2486,15 +2439,20 @@ Key bindings specific to `verilog-mode-map' are: | |||
| 2486 | (add-submenu nil verilog-stmt-menu) | 2439 | (add-submenu nil verilog-stmt-menu) |
| 2487 | )) | 2440 | )) |
| 2488 | ;; Stuff for GNU emacs | 2441 | ;; Stuff for GNU emacs |
| 2489 | (make-local-variable 'font-lock-defaults) | 2442 | (set (make-local-variable 'font-lock-defaults) |
| 2443 | '((verilog-font-lock-keywords verilog-font-lock-keywords-1 | ||
| 2444 | verilog-font-lock-keywords-2 | ||
| 2445 | verilog-font-lock-keywords-3) | ||
| 2446 | nil nil nil verilog-beg-of-defun)) | ||
| 2490 | ;;------------------------------------------------------------ | 2447 | ;;------------------------------------------------------------ |
| 2491 | ;; now hook in 'verilog-colorize-include-files (eldo-mode.el&spice-mode.el) | 2448 | ;; now hook in 'verilog-colorize-include-files (eldo-mode.el&spice-mode.el) |
| 2492 | ;; all buffer local: | 2449 | ;; all buffer local: |
| 2493 | (make-local-hook 'font-lock-mode-hook) | 2450 | (when (featurep 'xemacs) |
| 2494 | (make-local-hook 'font-lock-after-fontify-buffer-hook); doesn't exist in emacs 20 | 2451 | (make-local-hook 'font-lock-mode-hook) |
| 2452 | (make-local-hook 'font-lock-after-fontify-buffer-hook); doesn't exist in emacs 20 | ||
| 2453 | (make-local-hook 'after-change-functions)) | ||
| 2495 | (add-hook 'font-lock-mode-hook 'verilog-colorize-include-files-buffer t t) | 2454 | (add-hook 'font-lock-mode-hook 'verilog-colorize-include-files-buffer t t) |
| 2496 | (add-hook 'font-lock-after-fontify-buffer-hook 'verilog-colorize-include-files-buffer t t) ; not in emacs 20 | 2455 | (add-hook 'font-lock-after-fontify-buffer-hook 'verilog-colorize-include-files-buffer t t) ; not in emacs 20 |
| 2497 | (make-local-hook 'after-change-functions) | ||
| 2498 | (add-hook 'after-change-functions 'verilog-colorize-include-files t t) | 2456 | (add-hook 'after-change-functions 'verilog-colorize-include-files t t) |
| 2499 | 2457 | ||
| 2500 | ;; Tell imenu how to handle verilog. | 2458 | ;; Tell imenu how to handle verilog. |
| @@ -2535,7 +2493,7 @@ With optional ARG, remove existing end of line comments." | |||
| 2535 | (newline)) | 2493 | (newline)) |
| 2536 | (progn | 2494 | (progn |
| 2537 | (newline) | 2495 | (newline) |
| 2538 | (insert-string "// ") | 2496 | (insert "// ") |
| 2539 | (beginning-of-line))) | 2497 | (beginning-of-line))) |
| 2540 | (verilog-indent-line)) | 2498 | (verilog-indent-line)) |
| 2541 | ((nth 4 state) ; Inside any comment (hence /**/) | 2499 | ((nth 4 state) ; Inside any comment (hence /**/) |
| @@ -2785,7 +2743,8 @@ This puts the mark at the end, and point at the beginning." | |||
| 2785 | (verilog-end-of-defun) | 2743 | (verilog-end-of-defun) |
| 2786 | (push-mark (point)) | 2744 | (push-mark (point)) |
| 2787 | (verilog-beg-of-defun) | 2745 | (verilog-beg-of-defun) |
| 2788 | (zmacs-activate-region)) | 2746 | (if (fboundp 'zmacs-activate-region) |
| 2747 | (zmacs-activate-region))) | ||
| 2789 | 2748 | ||
| 2790 | (defun verilog-comment-region (start end) | 2749 | (defun verilog-comment-region (start end) |
| 2791 | ; checkdoc-params: (start end) | 2750 | ; checkdoc-params: (start end) |
| @@ -3634,13 +3593,13 @@ Useful for creating tri's and other expanded fields." | |||
| 3634 | (regexp-quote ket) | 3593 | (regexp-quote ket) |
| 3635 | "\\(.*\\)$") signal-string) | 3594 | "\\(.*\\)$") signal-string) |
| 3636 | (let* ((sig-head (match-string 1 signal-string)) | 3595 | (let* ((sig-head (match-string 1 signal-string)) |
| 3637 | (vec-start (string-to-int (match-string 2 signal-string))) | 3596 | (vec-start (string-to-number (match-string 2 signal-string))) |
| 3638 | (vec-end (if (= (match-beginning 3) (match-end 3)) | 3597 | (vec-end (if (= (match-beginning 3) (match-end 3)) |
| 3639 | vec-start | 3598 | vec-start |
| 3640 | (string-to-int (substring signal-string (1+ (match-beginning 3)) (match-end 3))))) | 3599 | (string-to-number (substring signal-string (1+ (match-beginning 3)) (match-end 3))))) |
| 3641 | (vec-range (if (= (match-beginning 4) (match-end 4)) | 3600 | (vec-range (if (= (match-beginning 4) (match-end 4)) |
| 3642 | 1 | 3601 | 1 |
| 3643 | (string-to-int (substring signal-string (+ 2 (match-beginning 4)) (match-end 4))))) | 3602 | (string-to-number (substring signal-string (+ 2 (match-beginning 4)) (match-end 4))))) |
| 3644 | (sig-tail (match-string 5 signal-string)) | 3603 | (sig-tail (match-string 5 signal-string)) |
| 3645 | vec) | 3604 | vec) |
| 3646 | ;; Decode vectors | 3605 | ;; Decode vectors |
| @@ -3777,15 +3736,15 @@ becomes: | |||
| 3777 | (let ((lim (save-excursion (end-of-line) (point)))) | 3736 | (let ((lim (save-excursion (end-of-line) (point)))) |
| 3778 | (if (re-search-forward code lim 'move) | 3737 | (if (re-search-forward code lim 'move) |
| 3779 | (throw 'already t) | 3738 | (throw 'already t) |
| 3780 | (insert-string (concat " " code))))) | 3739 | (insert (concat " " code))))) |
| 3781 | (t | 3740 | (t |
| 3782 | ))) | 3741 | ))) |
| 3783 | ((verilog-in-star-comment-p) | 3742 | ((verilog-in-star-comment-p) |
| 3784 | (re-search-backward "/\*") | 3743 | (re-search-backward "/\*") |
| 3785 | (insert-string (format " // surefire lint_off_line %6s" code )) | 3744 | (insert (format " // surefire lint_off_line %6s" code )) |
| 3786 | ) | 3745 | ) |
| 3787 | (t | 3746 | (t |
| 3788 | (insert-string (format " // surefire lint_off_line %6s" code )) | 3747 | (insert (format " // surefire lint_off_line %6s" code )) |
| 3789 | ))))))) | 3748 | ))))))) |
| 3790 | 3749 | ||
| 3791 | (defun verilog-verilint-off () | 3750 | (defun verilog-verilint-off () |
| @@ -3839,12 +3798,12 @@ This lets programs calling batch mode to easily extract error messages." | |||
| 3839 | ;; Make sure any sub-files we read get proper mode | 3798 | ;; Make sure any sub-files we read get proper mode |
| 3840 | (setq default-major-mode `verilog-mode) | 3799 | (setq default-major-mode `verilog-mode) |
| 3841 | ;; Ditto files already read in | 3800 | ;; Ditto files already read in |
| 3842 | (mapcar '(lambda (buf) | 3801 | (mapc (lambda (buf) |
| 3843 | (when (buffer-file-name buf) | 3802 | (when (buffer-file-name buf) |
| 3844 | (save-excursion | 3803 | (save-excursion |
| 3845 | (set-buffer buf) | 3804 | (set-buffer buf) |
| 3846 | (verilog-mode)))) | 3805 | (verilog-mode)))) |
| 3847 | (buffer-list)) | 3806 | (buffer-list)) |
| 3848 | ;; Process the files | 3807 | ;; Process the files |
| 3849 | (mapcar '(lambda (buf) | 3808 | (mapcar '(lambda (buf) |
| 3850 | (when (buffer-file-name buf) | 3809 | (when (buffer-file-name buf) |
| @@ -5861,12 +5820,10 @@ Bound search by LIMIT. Adapted from | |||
| 5861 | (search-forward "<title>") | 5820 | (search-forward "<title>") |
| 5862 | (replace-match string t t) | 5821 | (replace-match string t t) |
| 5863 | (setq string (read-string "project: " verilog-project)) | 5822 | (setq string (read-string "project: " verilog-project)) |
| 5864 | (make-variable-buffer-local 'verilog-project) | ||
| 5865 | (setq verilog-project string) | 5823 | (setq verilog-project string) |
| 5866 | (search-forward "<project>") | 5824 | (search-forward "<project>") |
| 5867 | (replace-match string t t) | 5825 | (replace-match string t t) |
| 5868 | (setq string (read-string "Company: " verilog-company)) | 5826 | (setq string (read-string "Company: " verilog-company)) |
| 5869 | (make-variable-buffer-local 'verilog-company) | ||
| 5870 | (setq verilog-company string) | 5827 | (setq verilog-company string) |
| 5871 | (search-forward "<company>") | 5828 | (search-forward "<company>") |
| 5872 | (replace-match string t t) | 5829 | (replace-match string t t) |
| @@ -6021,10 +5978,10 @@ Duplicate signals are also removed. For example A[2] and A[1] become A[2:1]." | |||
| 6021 | (setq bus (verilog-sig-bits sig)) | 5978 | (setq bus (verilog-sig-bits sig)) |
| 6022 | (cond ((and bus | 5979 | (cond ((and bus |
| 6023 | (or (and (string-match "\\[\\([0-9]+\\):\\([0-9]+\\)\\]" bus) | 5980 | (or (and (string-match "\\[\\([0-9]+\\):\\([0-9]+\\)\\]" bus) |
| 6024 | (setq highbit (string-to-int (match-string 1 bus)) | 5981 | (setq highbit (string-to-number (match-string 1 bus)) |
| 6025 | lowbit (string-to-int (match-string 2 bus)))) | 5982 | lowbit (string-to-number (match-string 2 bus)))) |
| 6026 | (and (string-match "\\[\\([0-9]+\\)\\]" bus) | 5983 | (and (string-match "\\[\\([0-9]+\\)\\]" bus) |
| 6027 | (setq highbit (string-to-int (match-string 1 bus)) | 5984 | (setq highbit (string-to-number (match-string 1 bus)) |
| 6028 | lowbit highbit)))) | 5985 | lowbit highbit)))) |
| 6029 | ;; Combine bits in bus | 5986 | ;; Combine bits in bus |
| 6030 | (if sv-highbit | 5987 | (if sv-highbit |
| @@ -6292,9 +6249,44 @@ Return a array of [outputs inouts inputs wire reg assign const]." | |||
| 6292 | (nreverse sigs-gparam) | 6249 | (nreverse sigs-gparam) |
| 6293 | )))) | 6250 | )))) |
| 6294 | 6251 | ||
| 6295 | (defvar sigs-in nil) ; Prevent compile warning | 6252 | (defvar sigs-in) ; Prevent compile warning |
| 6296 | (defvar sigs-inout nil) ; Prevent compile warning | 6253 | (defvar sigs-inout) ; Prevent compile warning |
| 6297 | (defvar sigs-out nil) ; Prevent compile warning | 6254 | (defvar sigs-out) ; Prevent compile warning |
| 6255 | |||
| 6256 | |||
| 6257 | (defsubst verilog-modi-get-decls (modi) | ||
| 6258 | (verilog-modi-cache-results modi 'verilog-read-decls)) | ||
| 6259 | |||
| 6260 | (defsubst verilog-modi-get-sub-decls (modi) | ||
| 6261 | (verilog-modi-cache-results modi 'verilog-read-sub-decls)) | ||
| 6262 | |||
| 6263 | |||
| 6264 | ;; Signal reading for given module | ||
| 6265 | ;; Note these all take modi's - as returned from the | ||
| 6266 | ;; verilog-modi-current function. | ||
| 6267 | (defsubst verilog-modi-get-outputs (modi) | ||
| 6268 | (aref (verilog-modi-get-decls modi) 0)) | ||
| 6269 | (defsubst verilog-modi-get-inouts (modi) | ||
| 6270 | (aref (verilog-modi-get-decls modi) 1)) | ||
| 6271 | (defsubst verilog-modi-get-inputs (modi) | ||
| 6272 | (aref (verilog-modi-get-decls modi) 2)) | ||
| 6273 | (defsubst verilog-modi-get-wires (modi) | ||
| 6274 | (aref (verilog-modi-get-decls modi) 3)) | ||
| 6275 | (defsubst verilog-modi-get-regs (modi) | ||
| 6276 | (aref (verilog-modi-get-decls modi) 4)) | ||
| 6277 | (defsubst verilog-modi-get-assigns (modi) | ||
| 6278 | (aref (verilog-modi-get-decls modi) 5)) | ||
| 6279 | (defsubst verilog-modi-get-consts (modi) | ||
| 6280 | (aref (verilog-modi-get-decls modi) 6)) | ||
| 6281 | (defsubst verilog-modi-get-gparams (modi) | ||
| 6282 | (aref (verilog-modi-get-decls modi) 7)) | ||
| 6283 | (defsubst verilog-modi-get-sub-outputs (modi) | ||
| 6284 | (aref (verilog-modi-get-sub-decls modi) 0)) | ||
| 6285 | (defsubst verilog-modi-get-sub-inouts (modi) | ||
| 6286 | (aref (verilog-modi-get-sub-decls modi) 1)) | ||
| 6287 | (defsubst verilog-modi-get-sub-inputs (modi) | ||
| 6288 | (aref (verilog-modi-get-sub-decls modi) 2)) | ||
| 6289 | |||
| 6298 | 6290 | ||
| 6299 | (defun verilog-read-sub-decls-sig (submodi comment port sig vec multidim) | 6291 | (defun verilog-read-sub-decls-sig (submodi comment port sig vec multidim) |
| 6300 | "For verilog-read-sub-decls-line, add a signal." | 6292 | "For verilog-read-sub-decls-line, add a signal." |
| @@ -6506,11 +6498,10 @@ For example if declare A A (.B(SIG)) then B will be included in the list." | |||
| 6506 | (end-pt (point))) | 6498 | (end-pt (point))) |
| 6507 | (eval-region beg-pt end-pt nil))))) | 6499 | (eval-region beg-pt end-pt nil))))) |
| 6508 | 6500 | ||
| 6509 | (eval-when-compile | 6501 | ;; These are passed in a let, not global |
| 6510 | ;; These are passed in a let, not global | 6502 | (defvar got-sig) |
| 6511 | (if (not (boundp 'sigs-in)) | 6503 | (defvar got-rvalue) |
| 6512 | (defvar sigs-in nil) (defvar sigs-out nil) | 6504 | (defvar uses-delayed) |
| 6513 | (defvar got-sig nil) (defvar got-rvalue nil) (defvar uses-delayed nil))) | ||
| 6514 | 6505 | ||
| 6515 | (defun verilog-read-always-signals-recurse | 6506 | (defun verilog-read-always-signals-recurse |
| 6516 | (exit-keywd rvalue ignore-next) | 6507 | (exit-keywd rvalue ignore-next) |
| @@ -7033,10 +7024,10 @@ Some macros and such are also found and included. For dinotrace.el" | |||
| 7033 | "Convert `verilog-library-flags' into standard library variables." | 7024 | "Convert `verilog-library-flags' into standard library variables." |
| 7034 | ;; If the flags are local, then all the outputs should be local also | 7025 | ;; If the flags are local, then all the outputs should be local also |
| 7035 | (when (local-variable-p `verilog-library-flags (current-buffer)) | 7026 | (when (local-variable-p `verilog-library-flags (current-buffer)) |
| 7036 | (make-variable-buffer-local 'verilog-library-extensions) | 7027 | (mapc 'make-local-variable '(verilog-library-extensions |
| 7037 | (make-variable-buffer-local 'verilog-library-directories) | 7028 | verilog-library-directories |
| 7038 | (make-variable-buffer-local 'verilog-library-files) | 7029 | verilog-library-files |
| 7039 | (make-variable-buffer-local 'verilog-library-flags)) | 7030 | verilog-library-flags))) |
| 7040 | ;; Allow user to customize | 7031 | ;; Allow user to customize |
| 7041 | (run-hooks 'verilog-before-getopt-flags-hook) | 7032 | (run-hooks 'verilog-before-getopt-flags-hook) |
| 7042 | ;; Process arguments | 7033 | ;; Process arguments |
| @@ -7061,11 +7052,8 @@ unless it is already a member of the variable's list" | |||
| 7061 | "Return point if MODULE is specified inside FILENAME, else nil. | 7052 | "Return point if MODULE is specified inside FILENAME, else nil. |
| 7062 | Allows version control to check out the file if need be." | 7053 | Allows version control to check out the file if need be." |
| 7063 | (and (or (file-exists-p filename) | 7054 | (and (or (file-exists-p filename) |
| 7064 | (and | 7055 | (and (fboundp 'vc-backend) |
| 7065 | (condition-case nil | 7056 | (vc-backend filename))) |
| 7066 | (fboundp 'vc-backend) | ||
| 7067 | (error nil)) | ||
| 7068 | (vc-backend filename))) | ||
| 7069 | (let (pt) | 7057 | (let (pt) |
| 7070 | (save-excursion | 7058 | (save-excursion |
| 7071 | (set-buffer (find-file-noselect filename)) | 7059 | (set-buffer (find-file-noselect filename)) |
| @@ -7224,6 +7212,8 @@ variables to build the path." | |||
| 7224 | For speeding up verilog-modi-get-* commands. | 7212 | For speeding up verilog-modi-get-* commands. |
| 7225 | Buffer-local.") | 7213 | Buffer-local.") |
| 7226 | 7214 | ||
| 7215 | (make-variable-buffer-local 'verilog-modi-cache-list) | ||
| 7216 | |||
| 7227 | (defvar verilog-modi-cache-preserve-tick nil | 7217 | (defvar verilog-modi-cache-preserve-tick nil |
| 7228 | "Modification tick after which the cache is still considered valid. | 7218 | "Modification tick after which the cache is still considered valid. |
| 7229 | Use verilog-preserve-cache's to set") | 7219 | Use verilog-preserve-cache's to set") |
| @@ -7349,7 +7339,6 @@ Cache the output of function so next call may have faster access." | |||
| 7349 | (setq func-returns (funcall function)) | 7339 | (setq func-returns (funcall function)) |
| 7350 | (when fontlocked (font-lock-mode t))) | 7340 | (when fontlocked (font-lock-mode t))) |
| 7351 | ;; Cache for next time | 7341 | ;; Cache for next time |
| 7352 | (make-variable-buffer-local 'verilog-modi-cache-list) | ||
| 7353 | (setq verilog-modi-cache-list | 7342 | (setq verilog-modi-cache-list |
| 7354 | (cons (list (list (verilog-modi-name modi) function) | 7343 | (cons (list (list (verilog-modi-name modi) function) |
| 7355 | (buffer-modified-tick) | 7344 | (buffer-modified-tick) |
| @@ -7384,37 +7373,6 @@ and invalidating the cache." | |||
| 7384 | (verilog-modi-cache-preserve-buffer (current-buffer))) | 7373 | (verilog-modi-cache-preserve-buffer (current-buffer))) |
| 7385 | (progn ,@body))) | 7374 | (progn ,@body))) |
| 7386 | 7375 | ||
| 7387 | (defsubst verilog-modi-get-decls (modi) | ||
| 7388 | (verilog-modi-cache-results modi 'verilog-read-decls)) | ||
| 7389 | |||
| 7390 | (defsubst verilog-modi-get-sub-decls (modi) | ||
| 7391 | (verilog-modi-cache-results modi 'verilog-read-sub-decls)) | ||
| 7392 | |||
| 7393 | ;; Signal reading for given module | ||
| 7394 | ;; Note these all take modi's - as returned from the verilog-modi-current function | ||
| 7395 | (defsubst verilog-modi-get-outputs (modi) | ||
| 7396 | (aref (verilog-modi-get-decls modi) 0)) | ||
| 7397 | (defsubst verilog-modi-get-inouts (modi) | ||
| 7398 | (aref (verilog-modi-get-decls modi) 1)) | ||
| 7399 | (defsubst verilog-modi-get-inputs (modi) | ||
| 7400 | (aref (verilog-modi-get-decls modi) 2)) | ||
| 7401 | (defsubst verilog-modi-get-wires (modi) | ||
| 7402 | (aref (verilog-modi-get-decls modi) 3)) | ||
| 7403 | (defsubst verilog-modi-get-regs (modi) | ||
| 7404 | (aref (verilog-modi-get-decls modi) 4)) | ||
| 7405 | (defsubst verilog-modi-get-assigns (modi) | ||
| 7406 | (aref (verilog-modi-get-decls modi) 5)) | ||
| 7407 | (defsubst verilog-modi-get-consts (modi) | ||
| 7408 | (aref (verilog-modi-get-decls modi) 6)) | ||
| 7409 | (defsubst verilog-modi-get-gparams (modi) | ||
| 7410 | (aref (verilog-modi-get-decls modi) 7)) | ||
| 7411 | (defsubst verilog-modi-get-sub-outputs (modi) | ||
| 7412 | (aref (verilog-modi-get-sub-decls modi) 0)) | ||
| 7413 | (defsubst verilog-modi-get-sub-inouts (modi) | ||
| 7414 | (aref (verilog-modi-get-sub-decls modi) 1)) | ||
| 7415 | (defsubst verilog-modi-get-sub-inputs (modi) | ||
| 7416 | (aref (verilog-modi-get-sub-decls modi) 2)) | ||
| 7417 | |||
| 7418 | 7376 | ||
| 7419 | (defun verilog-signals-matching-enum (in-list enum) | 7377 | (defun verilog-signals-matching-enum (in-list enum) |
| 7420 | "Return all signals in IN-LIST matching the given ENUM." | 7378 | "Return all signals in IN-LIST matching the given ENUM." |
| @@ -7604,8 +7562,8 @@ This repairs those mis-inserted by a AUTOARG." | |||
| 7604 | (cond ((not range-exp) | 7562 | (cond ((not range-exp) |
| 7605 | "1") | 7563 | "1") |
| 7606 | ((string-match "^\\s *\\([0-9]+\\)\\s *:\\s *\\([0-9]+\\)\\s *$" range-exp) | 7564 | ((string-match "^\\s *\\([0-9]+\\)\\s *:\\s *\\([0-9]+\\)\\s *$" range-exp) |
| 7607 | (int-to-string (1+ (abs (- (string-to-int (match-string 1 range-exp)) | 7565 | (int-to-string (1+ (abs (- (string-to-number (match-string 1 range-exp)) |
| 7608 | (string-to-int (match-string 2 range-exp))))))) | 7566 | (string-to-number (match-string 2 range-exp))))))) |
| 7609 | ((string-match "^\\(.*\\)\\s *:\\s *\\(.*\\)\\s *$" range-exp) | 7567 | ((string-match "^\\(.*\\)\\s *:\\s *\\(.*\\)\\s *$" range-exp) |
| 7610 | (concat "(1+(" (match-string 1 range-exp) | 7568 | (concat "(1+(" (match-string 1 range-exp) |
| 7611 | ")" | 7569 | ")" |
| @@ -7928,7 +7886,7 @@ Typing \\[verilog-inject-auto] will make this into: | |||
| 7928 | (defun verilog-auto-reeval-locals (&optional force) | 7886 | (defun verilog-auto-reeval-locals (&optional force) |
| 7929 | "Read file local variable segment at bottom of file if it has changed. | 7887 | "Read file local variable segment at bottom of file if it has changed. |
| 7930 | If FORCE, always reread it." | 7888 | If FORCE, always reread it." |
| 7931 | (make-variable-buffer-local 'verilog-auto-last-file-locals) | 7889 | (make-local-variable 'verilog-auto-last-file-locals) |
| 7932 | (let ((curlocal (verilog-auto-read-locals))) | 7890 | (let ((curlocal (verilog-auto-read-locals))) |
| 7933 | (when (or force (not (equal verilog-auto-last-file-locals curlocal))) | 7891 | (when (or force (not (equal verilog-auto-last-file-locals curlocal))) |
| 7934 | (setq verilog-auto-last-file-locals curlocal) | 7892 | (setq verilog-auto-last-file-locals curlocal) |
| @@ -8435,10 +8393,12 @@ Lisp Templates: | |||
| 8435 | (when sig-list | 8393 | (when sig-list |
| 8436 | (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) | 8394 | (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) |
| 8437 | (indent-to indent-pt) | 8395 | (indent-to indent-pt) |
| 8438 | (insert "// Outputs\n") ;; Note these are searched for in verilog-read-sub-decls | 8396 | ;; Note these are searched for in verilog-read-sub-decls. |
| 8439 | (mapcar (function (lambda (port) | 8397 | (insert "// Outputs\n") |
| 8440 | (verilog-auto-inst-port port indent-pt tpl-list tpl-num for-star))) | 8398 | (mapc (lambda (port) |
| 8441 | sig-list))) | 8399 | (verilog-auto-inst-port port indent-pt |
| 8400 | tpl-list tpl-num for-star)) | ||
| 8401 | sig-list))) | ||
| 8442 | (let ((sig-list (verilog-signals-not-in | 8402 | (let ((sig-list (verilog-signals-not-in |
| 8443 | (verilog-modi-get-inouts submodi) | 8403 | (verilog-modi-get-inouts submodi) |
| 8444 | skip-pins)) | 8404 | skip-pins)) |
| @@ -8447,9 +8407,10 @@ Lisp Templates: | |||
| 8447 | (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) | 8407 | (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) |
| 8448 | (indent-to indent-pt) | 8408 | (indent-to indent-pt) |
| 8449 | (insert "// Inouts\n") | 8409 | (insert "// Inouts\n") |
| 8450 | (mapcar (function (lambda (port) | 8410 | (mapc (lambda (port) |
| 8451 | (verilog-auto-inst-port port indent-pt tpl-list tpl-num for-star))) | 8411 | (verilog-auto-inst-port port indent-pt |
| 8452 | sig-list))) | 8412 | tpl-list tpl-num for-star)) |
| 8413 | sig-list))) | ||
| 8453 | (let ((sig-list (verilog-signals-not-in | 8414 | (let ((sig-list (verilog-signals-not-in |
| 8454 | (verilog-modi-get-inputs submodi) | 8415 | (verilog-modi-get-inputs submodi) |
| 8455 | skip-pins)) | 8416 | skip-pins)) |
| @@ -8458,9 +8419,10 @@ Lisp Templates: | |||
| 8458 | (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) | 8419 | (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) |
| 8459 | (indent-to indent-pt) | 8420 | (indent-to indent-pt) |
| 8460 | (insert "// Inputs\n") | 8421 | (insert "// Inputs\n") |
| 8461 | (mapcar (function (lambda (port) | 8422 | (mapc (lambda (port) |
| 8462 | (verilog-auto-inst-port port indent-pt tpl-list tpl-num for-star))) | 8423 | (verilog-auto-inst-port port indent-pt |
| 8463 | sig-list))) | 8424 | tpl-list tpl-num for-star)) |
| 8425 | sig-list))) | ||
| 8464 | ;; Kill extra semi | 8426 | ;; Kill extra semi |
| 8465 | (save-excursion | 8427 | (save-excursion |
| 8466 | (cond (did-first | 8428 | (cond (did-first |
| @@ -8561,10 +8523,12 @@ Templates: | |||
| 8561 | (when sig-list | 8523 | (when sig-list |
| 8562 | (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) | 8524 | (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) |
| 8563 | (indent-to indent-pt) | 8525 | (indent-to indent-pt) |
| 8564 | (insert "// Parameters\n") ;; Note these are searched for in verilog-read-sub-decls | 8526 | ;; Note these are searched for in verilog-read-sub-decls. |
| 8565 | (mapcar (function (lambda (port) | 8527 | (insert "// Parameters\n") |
| 8566 | (verilog-auto-inst-port port indent-pt tpl-list tpl-num nil))) | 8528 | (mapc (lambda (port) |
| 8567 | sig-list))) | 8529 | (verilog-auto-inst-port port indent-pt |
| 8530 | tpl-list tpl-num nil)) | ||
| 8531 | sig-list))) | ||
| 8568 | ;; Kill extra semi | 8532 | ;; Kill extra semi |
| 8569 | (save-excursion | 8533 | (save-excursion |
| 8570 | (cond (did-first | 8534 | (cond (did-first |
| @@ -9569,9 +9533,9 @@ being different from the final output's line numbering." | |||
| 9569 | (goto-char (point-min)) | 9533 | (goto-char (point-min)) |
| 9570 | (while (re-search-forward " Templated T\\([0-9]+\\) L\\([0-9]+\\)" nil t) | 9534 | (while (re-search-forward " Templated T\\([0-9]+\\) L\\([0-9]+\\)" nil t) |
| 9571 | (replace-match (concat " Templated " | 9535 | (replace-match (concat " Templated " |
| 9572 | (int-to-string (+ (nth (string-to-int (match-string 1)) | 9536 | (int-to-string (+ (nth (string-to-number (match-string 1)) |
| 9573 | template-line) | 9537 | template-line) |
| 9574 | (string-to-int (match-string 2))))) | 9538 | (string-to-number (match-string 2))))) |
| 9575 | t t)))) | 9539 | t t)))) |
| 9576 | 9540 | ||
| 9577 | 9541 | ||
| @@ -9636,7 +9600,7 @@ If you have bugs with these autos, try contacting the AUTOAUTHOR | |||
| 9636 | Wilson Snyder (wsnyder@wsnyder.org), and/or see http://www.veripool.com." | 9600 | Wilson Snyder (wsnyder@wsnyder.org), and/or see http://www.veripool.com." |
| 9637 | (interactive) | 9601 | (interactive) |
| 9638 | (unless noninteractive (message "Updating AUTOs...")) | 9602 | (unless noninteractive (message "Updating AUTOs...")) |
| 9639 | (if (featurep 'dinotrace) | 9603 | (if (fboundp 'dinotrace-unannotate-all) |
| 9640 | (dinotrace-unannotate-all)) | 9604 | (dinotrace-unannotate-all)) |
| 9641 | (let ((oldbuf (if (not (buffer-modified-p)) | 9605 | (let ((oldbuf (if (not (buffer-modified-p)) |
| 9642 | (buffer-string))) | 9606 | (buffer-string))) |
| @@ -9790,7 +9754,7 @@ Wilson Snyder (wsnyder@wsnyder.org), and/or see http://www.veripool.com." | |||
| 9790 | (defvar verilog-sk-reset nil) | 9754 | (defvar verilog-sk-reset nil) |
| 9791 | (defun verilog-sk-prompt-reset () | 9755 | (defun verilog-sk-prompt-reset () |
| 9792 | "Prompt for the name of a state machine reset." | 9756 | "Prompt for the name of a state machine reset." |
| 9793 | (setq verilog-sk-reset (read-input "name of reset: " "rst"))) | 9757 | (setq verilog-sk-reset (read-string "name of reset: " "rst"))) |
| 9794 | 9758 | ||
| 9795 | 9759 | ||
| 9796 | (define-skeleton verilog-sk-prompt-state-selector | 9760 | (define-skeleton verilog-sk-prompt-state-selector |
| @@ -10235,6 +10199,8 @@ Files are checked based on `verilog-library-directories'." | |||
| 10235 | (princ "To submit a bug, use M-x verilog-submit-bug-report\n") | 10199 | (princ "To submit a bug, use M-x verilog-submit-bug-report\n") |
| 10236 | (princ "\n"))) | 10200 | (princ "\n"))) |
| 10237 | 10201 | ||
| 10202 | (autoload 'reporter-submit-bug-report "reporter") | ||
| 10203 | |||
| 10238 | (defun verilog-submit-bug-report () | 10204 | (defun verilog-submit-bug-report () |
| 10239 | "Submit via mail a bug report on verilog-mode.el." | 10205 | "Submit via mail a bug report on verilog-mode.el." |
| 10240 | (interactive) | 10206 | (interactive) |