diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/verilog-mode.el | 283 |
1 files changed, 142 insertions, 141 deletions
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 65bee027d6c..4e2b726625f 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el | |||
| @@ -70,7 +70,7 @@ | |||
| 70 | ;; <http://www.verilog.com/emacs_install.html> | 70 | ;; <http://www.verilog.com/emacs_install.html> |
| 71 | 71 | ||
| 72 | ;; The short list of installation instructions are: To set up | 72 | ;; The short list of installation instructions are: To set up |
| 73 | ;; automatic verilog mode, put this file in your load path, and put | 73 | ;; automatic Verilog mode, put this file in your load path, and put |
| 74 | ;; the following in code (please un comment it first!) in your | 74 | ;; the following in code (please un comment it first!) in your |
| 75 | ;; .emacs, or in your site's site-load.el | 75 | ;; .emacs, or in your site's site-load.el |
| 76 | 76 | ||
| @@ -108,7 +108,7 @@ | |||
| 108 | ;; | 108 | ;; |
| 109 | 109 | ||
| 110 | ;;; History: | 110 | ;;; History: |
| 111 | ;; | 111 | ;; |
| 112 | ;; See commit history at http://www.veripool.com/verilog-mode.html | 112 | ;; See commit history at http://www.veripool.com/verilog-mode.html |
| 113 | ;; (This section is required to appease checkdoc.) | 113 | ;; (This section is required to appease checkdoc.) |
| 114 | 114 | ||
| @@ -203,7 +203,7 @@ STRING should be given if the last search was by `string-match' on STRING." | |||
| 203 | (defmacro defgroup (&rest args) nil) | 203 | (defmacro defgroup (&rest args) nil) |
| 204 | (defmacro customize (&rest args) | 204 | (defmacro customize (&rest args) |
| 205 | (message | 205 | (message |
| 206 | "Sorry, Customize is not available with this version of emacs")) | 206 | "Sorry, Customize is not available with this version of Emacs")) |
| 207 | (defmacro defcustom (var value doc &rest args) | 207 | (defmacro defcustom (var value doc &rest args) |
| 208 | `(defvar ,var ,value ,doc)) | 208 | `(defvar ,var ,value ,doc)) |
| 209 | ) | 209 | ) |
| @@ -282,7 +282,7 @@ STRING should be given if the last search was by `string-match' on STRING." | |||
| 282 | (or (equal value t) (equal value nil))) | 282 | (or (equal value t) (equal value nil))) |
| 283 | 283 | ||
| 284 | (defgroup verilog-mode nil | 284 | (defgroup verilog-mode nil |
| 285 | "Facilitates easy editing of Verilog source text" | 285 | "Facilitates easy editing of Verilog source text." |
| 286 | :group 'languages) | 286 | :group 'languages) |
| 287 | 287 | ||
| 288 | ; (defgroup verilog-mode-fonts nil | 288 | ; (defgroup verilog-mode-fonts nil |
| @@ -291,20 +291,20 @@ STRING should be given if the last search was by `string-match' on STRING." | |||
| 291 | ; :group 'verilog-mode) | 291 | ; :group 'verilog-mode) |
| 292 | 292 | ||
| 293 | (defgroup verilog-mode-indent nil | 293 | (defgroup verilog-mode-indent nil |
| 294 | "Customize indentation and highlighting of verilog source text" | 294 | "Customize indentation and highlighting of Verilog source text." |
| 295 | :group 'verilog-mode) | 295 | :group 'verilog-mode) |
| 296 | 296 | ||
| 297 | (defgroup verilog-mode-actions nil | 297 | (defgroup verilog-mode-actions nil |
| 298 | "Customize actions on verilog source text" | 298 | "Customize actions on Verilog source text." |
| 299 | :group 'verilog-mode) | 299 | :group 'verilog-mode) |
| 300 | 300 | ||
| 301 | (defgroup verilog-mode-auto nil | 301 | (defgroup verilog-mode-auto nil |
| 302 | "Customize AUTO actions when expanding verilog source text" | 302 | "Customize AUTO actions when expanding Verilog source text." |
| 303 | :group 'verilog-mode) | 303 | :group 'verilog-mode) |
| 304 | 304 | ||
| 305 | (defcustom verilog-linter | 305 | (defcustom verilog-linter |
| 306 | "echo 'No verilog-linter set, see \"M-x describe-variable verilog-linter\"'" | 306 | "echo 'No verilog-linter set, see \"M-x describe-variable verilog-linter\"'" |
| 307 | "*Unix program and arguments to call to run a lint checker on verilog source. | 307 | "*Unix program and arguments to call to run a lint checker on Verilog source. |
| 308 | Depending on the `verilog-set-compile-command', this may be invoked when | 308 | Depending on the `verilog-set-compile-command', this may be invoked when |
| 309 | you type \\[compile]. When the compile completes, \\[next-error] will take | 309 | you type \\[compile]. When the compile completes, \\[next-error] will take |
| 310 | you to the next lint error." | 310 | you to the next lint error." |
| @@ -314,7 +314,7 @@ you to the next lint error." | |||
| 314 | 314 | ||
| 315 | (defcustom verilog-coverage | 315 | (defcustom verilog-coverage |
| 316 | "echo 'No verilog-coverage set, see \"M-x describe-variable verilog-coverage\"'" | 316 | "echo 'No verilog-coverage set, see \"M-x describe-variable verilog-coverage\"'" |
| 317 | "*Program and arguments to use to annotate for coverage verilog source. | 317 | "*Program and arguments to use to annotate for coverage Verilog source. |
| 318 | Depending on the `verilog-set-compile-command', this may be invoked when | 318 | Depending on the `verilog-set-compile-command', this may be invoked when |
| 319 | you type \\[compile]. When the compile completes, \\[next-error] will take | 319 | you type \\[compile]. When the compile completes, \\[next-error] will take |
| 320 | you to the next lint error." | 320 | you to the next lint error." |
| @@ -324,7 +324,7 @@ you to the next lint error." | |||
| 324 | 324 | ||
| 325 | (defcustom verilog-simulator | 325 | (defcustom verilog-simulator |
| 326 | "echo 'No verilog-simulator set, see \"M-x describe-variable verilog-simulator\"'" | 326 | "echo 'No verilog-simulator set, see \"M-x describe-variable verilog-simulator\"'" |
| 327 | "*Program and arguments to use to interpret verilog source. | 327 | "*Program and arguments to use to interpret Verilog source. |
| 328 | Depending on the `verilog-set-compile-command', this may be invoked when | 328 | Depending on the `verilog-set-compile-command', this may be invoked when |
| 329 | you type \\[compile]. When the compile completes, \\[next-error] will take | 329 | you type \\[compile]. When the compile completes, \\[next-error] will take |
| 330 | you to the next lint error." | 330 | you to the next lint error." |
| @@ -334,7 +334,7 @@ you to the next lint error." | |||
| 334 | 334 | ||
| 335 | (defcustom verilog-compiler | 335 | (defcustom verilog-compiler |
| 336 | "echo 'No verilog-compiler set, see \"M-x describe-variable verilog-compiler\"'" | 336 | "echo 'No verilog-compiler set, see \"M-x describe-variable verilog-compiler\"'" |
| 337 | "*Program and arguments to use to compile verilog source. | 337 | "*Program and arguments to use to compile Verilog source. |
| 338 | Depending on the `verilog-set-compile-command', this may be invoked when | 338 | Depending on the `verilog-set-compile-command', this may be invoked when |
| 339 | you type \\[compile]. When the compile completes, \\[next-error] will take | 339 | you type \\[compile]. When the compile completes, \\[next-error] will take |
| 340 | you to the next lint error." | 340 | you to the next lint error." |
| @@ -370,7 +370,7 @@ entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." | |||
| 370 | (put 'verilog-indent-level 'safe-local-variable 'integerp) | 370 | (put 'verilog-indent-level 'safe-local-variable 'integerp) |
| 371 | 371 | ||
| 372 | (defcustom verilog-indent-level-module 3 | 372 | (defcustom verilog-indent-level-module 3 |
| 373 | "*Indentation of Module level Verilog statements. (eg always, initial) | 373 | "*Indentation of Module level Verilog statements (eg always, initial). |
| 374 | Set to 0 to get initial and always statements lined up on the left side of | 374 | Set to 0 to get initial and always statements lined up on the left side of |
| 375 | your screen." | 375 | your screen." |
| 376 | :group 'verilog-mode-indent | 376 | :group 'verilog-mode-indent |
| @@ -451,7 +451,7 @@ Set to 0 to have all directives start at the left side of the screen." | |||
| 451 | 451 | ||
| 452 | (defcustom verilog-tab-always-indent t | 452 | (defcustom verilog-tab-always-indent t |
| 453 | "*True means TAB should always re-indent the current line. | 453 | "*True means TAB should always re-indent the current line. |
| 454 | Nil means TAB will only reindent when at the beginning of the line." | 454 | A nil value means TAB will only reindent when at the beginning of the line." |
| 455 | :group 'verilog-mode-indent | 455 | :group 'verilog-mode-indent |
| 456 | :type 'boolean) | 456 | :type 'boolean) |
| 457 | (put 'verilog-tab-always-indent 'safe-local-variable 'verilog-booleanp) | 457 | (put 'verilog-tab-always-indent 'safe-local-variable 'verilog-booleanp) |
| @@ -480,7 +480,7 @@ Otherwise else is lined up with first character on line holding matching if." | |||
| 480 | (defcustom verilog-minimum-comment-distance 10 | 480 | (defcustom verilog-minimum-comment-distance 10 |
| 481 | "*Minimum distance (in lines) between begin and end required before a comment. | 481 | "*Minimum distance (in lines) between begin and end required before a comment. |
| 482 | Setting this variable to zero results in every end acquiring a comment; the | 482 | Setting this variable to zero results in every end acquiring a comment; the |
| 483 | default avoids too many redundant comments in tight quarters" | 483 | default avoids too many redundant comments in tight quarters." |
| 484 | :group 'verilog-mode-indent | 484 | :group 'verilog-mode-indent |
| 485 | :type 'integer) | 485 | :type 'integer) |
| 486 | (put 'verilog-minimum-comment-distance 'safe-local-variable 'integerp) | 486 | (put 'verilog-minimum-comment-distance 'safe-local-variable 'integerp) |
| @@ -530,9 +530,9 @@ would become | |||
| 530 | "*True means highlight words newly reserved by IEEE-1800. | 530 | "*True means highlight words newly reserved by IEEE-1800. |
| 531 | These will appear in `verilog-font-lock-p1800-face' in order to gently | 531 | These will appear in `verilog-font-lock-p1800-face' in order to gently |
| 532 | suggest changing where these words are used as variables to something else. | 532 | suggest changing where these words are used as variables to something else. |
| 533 | Nil means highlight these words as appropriate for the SystemVerilog | 533 | A nil value means highlight these words as appropriate for the SystemVerilog |
| 534 | IEEE-1800 standard. Note that changing this will require restarting Emacs | 534 | IEEE-1800 standard. Note that changing this will require restarting Emacs |
| 535 | to see the effect as font color choices are cached by Emacs" | 535 | to see the effect as font color choices are cached by Emacs." |
| 536 | :group 'verilog-mode-indent | 536 | :group 'verilog-mode-indent |
| 537 | :type 'boolean) | 537 | :type 'boolean) |
| 538 | (put 'verilog-highlight-p1800-keywords 'safe-local-variable 'verilog-booleanp) | 538 | (put 'verilog-highlight-p1800-keywords 'safe-local-variable 'verilog-booleanp) |
| @@ -577,8 +577,8 @@ instantiation. See also `verilog-auto-star' and `verilog-auto-star-save'." | |||
| 577 | 577 | ||
| 578 | (defcustom verilog-auto-star-save nil | 578 | (defcustom verilog-auto-star-save nil |
| 579 | "*Non-nil indicates to save to disk SystemVerilog .* instance expansions. | 579 | "*Non-nil indicates to save to disk SystemVerilog .* instance expansions. |
| 580 | Nil indicates direct connections will be removed before saving. Only | 580 | A nil value indicates direct connections will be removed before saving. |
| 581 | meaningful to those created due to `verilog-auto-star-expand' being set. | 581 | Only meaningful to those created due to `verilog-auto-star-expand' being set. |
| 582 | 582 | ||
| 583 | Instead of setting this, you may want to use /*AUTOINST*/, which will | 583 | Instead of setting this, you may want to use /*AUTOINST*/, which will |
| 584 | always be saved." | 584 | always be saved." |
| @@ -624,7 +624,7 @@ always be saved." | |||
| 624 | ; Leda | 624 | ; Leda |
| 625 | ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 2) | 625 | ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 2) |
| 626 | ) | 626 | ) |
| 627 | ; "*List of regexps for verilog compilers, like verilint. See compilation-error-regexp-alist for the formatting." | 627 | ; "*List of regexps for Verilog compilers, like verilint. See compilation-error-regexp-alist for the formatting." |
| 628 | ) | 628 | ) |
| 629 | 629 | ||
| 630 | (defvar verilog-error-font-lock-keywords | 630 | (defvar verilog-error-font-lock-keywords |
| @@ -697,7 +697,7 @@ something like: | |||
| 697 | // End: | 697 | // End: |
| 698 | 698 | ||
| 699 | Verilog-mode attempts to detect changes to this local variable, but they | 699 | Verilog-mode attempts to detect changes to this local variable, but they |
| 700 | are only insured to be correct when the file is first visited. Thus if you | 700 | are only insured to be correct when the file is first visited. Thus if you |
| 701 | have problems, use \\[find-alternate-file] RET to have these take effect. | 701 | have problems, use \\[find-alternate-file] RET to have these take effect. |
| 702 | 702 | ||
| 703 | See also the variables mentioned above." | 703 | See also the variables mentioned above." |
| @@ -719,7 +719,7 @@ something like: | |||
| 719 | // End: | 719 | // End: |
| 720 | 720 | ||
| 721 | Verilog-mode attempts to detect changes to this local variable, but they | 721 | Verilog-mode attempts to detect changes to this local variable, but they |
| 722 | are only insured to be correct when the file is first visited. Thus if you | 722 | are only insured to be correct when the file is first visited. Thus if you |
| 723 | have problems, use \\[find-alternate-file] RET to have these take effect. | 723 | have problems, use \\[find-alternate-file] RET to have these take effect. |
| 724 | 724 | ||
| 725 | See also `verilog-library-flags', `verilog-library-files' | 725 | See also `verilog-library-flags', `verilog-library-files' |
| @@ -742,7 +742,7 @@ something like: | |||
| 742 | // End: | 742 | // End: |
| 743 | 743 | ||
| 744 | Verilog-mode attempts to detect changes to this local variable, but they | 744 | Verilog-mode attempts to detect changes to this local variable, but they |
| 745 | are only insured to be correct when the file is first visited. Thus if you | 745 | are only insured to be correct when the file is first visited. Thus if you |
| 746 | have problems, use \\[find-alternate-file] RET to have these take effect. | 746 | have problems, use \\[find-alternate-file] RET to have these take effect. |
| 747 | 747 | ||
| 748 | See also `verilog-library-flags', `verilog-library-directories'." | 748 | See also `verilog-library-flags', `verilog-library-directories'." |
| @@ -777,7 +777,7 @@ included." | |||
| 777 | "*If true, AUTOSENSE should assume all defines represent constants. | 777 | "*If true, AUTOSENSE should assume all defines represent constants. |
| 778 | When true, the defines will not be included in sensitivity lists. To | 778 | When true, the defines will not be included in sensitivity lists. To |
| 779 | maintain compatibility with other sites, this should be set at the bottom | 779 | maintain compatibility with other sites, this should be set at the bottom |
| 780 | of each verilog file that requires it, rather than being set globally." | 780 | of each Verilog file that requires it, rather than being set globally." |
| 781 | :group 'verilog-mode-auto | 781 | :group 'verilog-mode-auto |
| 782 | :type 'boolean) | 782 | :type 'boolean) |
| 783 | (put 'verilog-auto-sense-defines-constant 'safe-local-variable 'verilog-booleanp) | 783 | (put 'verilog-auto-sense-defines-constant 'safe-local-variable 'verilog-booleanp) |
| @@ -787,7 +787,7 @@ of each verilog file that requires it, rather than being set globally." | |||
| 787 | This is then used to set the width of the zero (32'h0 for example). This | 787 | This is then used to set the width of the zero (32'h0 for example). This |
| 788 | is required by some lint tools that aren't smart enough to ignore widths of | 788 | is required by some lint tools that aren't smart enough to ignore widths of |
| 789 | the constant zero. This may result in ugly code when parameters determine | 789 | the constant zero. This may result in ugly code when parameters determine |
| 790 | the MSB or LSB of a signal inside a AUTORESET." | 790 | the MSB or LSB of a signal inside an AUTORESET." |
| 791 | :type 'boolean | 791 | :type 'boolean |
| 792 | :group 'verilog-mode-auto) | 792 | :group 'verilog-mode-auto) |
| 793 | (put 'verilog-auto-reset-widths 'safe-local-variable 'verilog-booleanp) | 793 | (put 'verilog-auto-reset-widths 'safe-local-variable 'verilog-booleanp) |
| @@ -802,8 +802,8 @@ the MSB or LSB of a signal inside a AUTORESET." | |||
| 802 | "*If true, when creating default ports with AUTOINST, use bus subscripts. | 802 | "*If true, when creating default ports with AUTOINST, use bus subscripts. |
| 803 | If nil, skip the subscript when it matches the entire bus as declared in | 803 | If nil, skip the subscript when it matches the entire bus as declared in |
| 804 | the module (AUTOWIRE signals always are subscripted, you must manually | 804 | the module (AUTOWIRE signals always are subscripted, you must manually |
| 805 | declare the wire to have the subscripts removed.) Nil may speed up some | 805 | declare the wire to have the subscripts removed.) Setting this to nil may |
| 806 | simulators, but is less general and harder to read, so avoid." | 806 | speed up some simulators, but is less general and harder to read, so avoid." |
| 807 | :group 'verilog-mode-auto | 807 | :group 'verilog-mode-auto |
| 808 | :type 'boolean) | 808 | :type 'boolean) |
| 809 | (put 'verilog-auto-inst-vector 'safe-local-variable 'verilog-booleanp) | 809 | (put 'verilog-auto-inst-vector 'safe-local-variable 'verilog-booleanp) |
| @@ -856,7 +856,7 @@ For example, \"_t$\" matches typedefs named with _t, as in the C language." | |||
| 856 | (put 'verilog-typedef-regexp 'safe-local-variable 'stringp) | 856 | (put 'verilog-typedef-regexp 'safe-local-variable 'stringp) |
| 857 | 857 | ||
| 858 | (defcustom verilog-mode-hook 'verilog-set-compile-command | 858 | (defcustom verilog-mode-hook 'verilog-set-compile-command |
| 859 | "*Hook (List of functions) run after verilog mode is loaded." | 859 | "*Hook run after Verilog mode is loaded." |
| 860 | :type 'hook | 860 | :type 'hook |
| 861 | :group 'verilog-mode) | 861 | :group 'verilog-mode) |
| 862 | 862 | ||
| @@ -893,7 +893,7 @@ For example, \"_t$\" matches typedefs named with _t, as in the C language." | |||
| 893 | (defvar verilog-imenu-generic-expression | 893 | (defvar verilog-imenu-generic-expression |
| 894 | '((nil "^\\s-*\\(\\(m\\(odule\\|acromodule\\)\\)\\|primitive\\)\\s-+\\([a-zA-Z0-9_.:]+\\)" 4) | 894 | '((nil "^\\s-*\\(\\(m\\(odule\\|acromodule\\)\\)\\|primitive\\)\\s-+\\([a-zA-Z0-9_.:]+\\)" 4) |
| 895 | ("*Vars*" "^\\s-*\\(reg\\|wire\\)\\s-+\\(\\|\\[[^]]+\\]\\s-+\\)\\([A-Za-z0-9_]+\\)" 3)) | 895 | ("*Vars*" "^\\s-*\\(reg\\|wire\\)\\s-+\\(\\|\\[[^]]+\\]\\s-+\\)\\([A-Za-z0-9_]+\\)" 3)) |
| 896 | "Imenu expression for Verilog-mode. See `imenu-generic-expression'.") | 896 | "Imenu expression for Verilog mode. See `imenu-generic-expression'.") |
| 897 | 897 | ||
| 898 | ;; | 898 | ;; |
| 899 | ;; provide a verilog-header function. | 899 | ;; provide a verilog-header function. |
| @@ -905,12 +905,12 @@ If nil, in European format (e.g. 17.09.1997). The brain-dead American | |||
| 905 | format (e.g. 09/17/1997) is not supported.") | 905 | format (e.g. 09/17/1997) is not supported.") |
| 906 | 906 | ||
| 907 | (defvar verilog-company nil | 907 | (defvar verilog-company nil |
| 908 | "*Default name of Company for verilog header. | 908 | "*Default name of Company for Verilog header. |
| 909 | If set will become buffer local.") | 909 | If set will become buffer local.") |
| 910 | (make-variable-buffer-local 'verilog-company) | 910 | (make-variable-buffer-local 'verilog-company) |
| 911 | 911 | ||
| 912 | (defvar verilog-project nil | 912 | (defvar verilog-project nil |
| 913 | "*Default name of Project for verilog header. | 913 | "*Default name of Project for Verilog header. |
| 914 | If set will become buffer local.") | 914 | If set will become buffer local.") |
| 915 | (make-variable-buffer-local 'verilog-project) | 915 | (make-variable-buffer-local 'verilog-project) |
| 916 | 916 | ||
| @@ -993,14 +993,14 @@ If set will become buffer local.") | |||
| 993 | ) | 993 | ) |
| 994 | ("Move" | 994 | ("Move" |
| 995 | ,(if (featurep 'xemacs) | 995 | ,(if (featurep 'xemacs) |
| 996 | (progn | 996 | (progn |
| 997 | ["Beginning of function" verilog-beg-of-defun t] | 997 | ["Beginning of function" verilog-beg-of-defun t] |
| 998 | ["End of function" verilog-end-of-defun t] | 998 | ["End of function" verilog-end-of-defun t] |
| 999 | ["Mark function" verilog-mark-defun t]) | 999 | ["Mark function" verilog-mark-defun t]) |
| 1000 | ["Beginning of function" beginning-of-defun t] | 1000 | ["Beginning of function" beginning-of-defun t] |
| 1001 | ["End of function" end-of-defun t] | 1001 | ["End of function" end-of-defun t] |
| 1002 | ["Mark function" mark-defun t]) | 1002 | ["Mark function" mark-defun t]) |
| 1003 | 1003 | ||
| 1004 | ["Goto function/module" verilog-goto-defun t] | 1004 | ["Goto function/module" verilog-goto-defun t] |
| 1005 | ["Move to beginning of block" electric-verilog-backward-sexp t] | 1005 | ["Move to beginning of block" electric-verilog-backward-sexp t] |
| 1006 | ["Move to end of block" electric-verilog-forward-sexp t] | 1006 | ["Move to end of block" electric-verilog-forward-sexp t] |
| @@ -1059,7 +1059,7 @@ If set will become buffer local.") | |||
| 1059 | ["Customize Verilog Mode..." verilog-customize t] | 1059 | ["Customize Verilog Mode..." verilog-customize t] |
| 1060 | ["Customize Verilog Fonts & Colors" verilog-font-customize t] | 1060 | ["Customize Verilog Fonts & Colors" verilog-font-customize t] |
| 1061 | ) | 1061 | ) |
| 1062 | "Emacs menu for VERILOG mode." | 1062 | "Emacs menu for Verilog mode." |
| 1063 | ) | 1063 | ) |
| 1064 | (defvar verilog-statement-menu | 1064 | (defvar verilog-statement-menu |
| 1065 | '("Statements" | 1065 | '("Statements" |
| @@ -1200,7 +1200,7 @@ so there may be a large up front penalty for the first search." | |||
| 1200 | 1200 | ||
| 1201 | ;; compilation program | 1201 | ;; compilation program |
| 1202 | (defun verilog-set-compile-command () | 1202 | (defun verilog-set-compile-command () |
| 1203 | "Function to compute shell command to compile verilog. | 1203 | "Function to compute shell command to compile Verilog. |
| 1204 | 1204 | ||
| 1205 | This reads `verilog-tool' and sets `compile-command'. This specifies the | 1205 | This reads `verilog-tool' and sets `compile-command'. This specifies the |
| 1206 | program that executes when you type \\[compile] or | 1206 | program that executes when you type \\[compile] or |
| @@ -1221,8 +1221,8 @@ In the former case, the path to the current buffer is concat'ed to the | |||
| 1221 | value of `verilog-tool'; in the later, the path to the current buffer is | 1221 | value of `verilog-tool'; in the later, the path to the current buffer is |
| 1222 | substituted for the %s. | 1222 | substituted for the %s. |
| 1223 | 1223 | ||
| 1224 | Where __FILE__ appears in the string, the buffer-file-name of the current | 1224 | Where __FILE__ appears in the string, the `buffer-file-name' of the |
| 1225 | buffer, without the directory portion, will be substituted." | 1225 | current buffer, without the directory portion, will be substituted." |
| 1226 | (interactive) | 1226 | (interactive) |
| 1227 | (cond | 1227 | (cond |
| 1228 | ((or (file-exists-p "makefile") ;If there is a makefile, use it | 1228 | ((or (file-exists-p "makefile") ;If there is a makefile, use it |
| @@ -1754,7 +1754,7 @@ find the errors." | |||
| 1754 | (modify-syntax-entry ?* ". 23" table) | 1754 | (modify-syntax-entry ?* ". 23" table) |
| 1755 | (modify-syntax-entry ?\n "> b" table)) | 1755 | (modify-syntax-entry ?\n "> b" table)) |
| 1756 | table) | 1756 | table) |
| 1757 | "Syntax table used in `verilog-mode' buffers.") | 1757 | "Syntax table used in Verilog mode buffers.") |
| 1758 | 1758 | ||
| 1759 | (defvar verilog-font-lock-keywords nil | 1759 | (defvar verilog-font-lock-keywords nil |
| 1760 | "Default highlighting for Verilog mode.") | 1760 | "Default highlighting for Verilog mode.") |
| @@ -1993,7 +1993,7 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 1993 | (verilog-backward-sexp)) | 1993 | (verilog-backward-sexp)) |
| 1994 | 1994 | ||
| 1995 | (defun electric-verilog-forward-sexp () | 1995 | (defun electric-verilog-forward-sexp () |
| 1996 | "Move backward over a sexp." | 1996 | "Move forward over a sexp." |
| 1997 | (interactive) | 1997 | (interactive) |
| 1998 | ;; before that see if we are in a comment | 1998 | ;; before that see if we are in a comment |
| 1999 | (verilog-forward-sexp)) | 1999 | (verilog-forward-sexp)) |
| @@ -2213,9 +2213,10 @@ Variables controlling indentation/edit style: | |||
| 2213 | Set to 0 to get them list right under containing block. | 2213 | Set to 0 to get them list right under containing block. |
| 2214 | `verilog-indent-level-behavioral' (default 3) | 2214 | `verilog-indent-level-behavioral' (default 3) |
| 2215 | Indentation of first begin in a task or function block | 2215 | Indentation of first begin in a task or function block |
| 2216 | Set to 0 to get such code to lined up underneath the task or function keyword | 2216 | Set to 0 to get such code to lined up underneath the task or |
| 2217 | function keyword. | ||
| 2217 | `verilog-indent-level-directive' (default 1) | 2218 | `verilog-indent-level-directive' (default 1) |
| 2218 | Indentation of `ifdef/`endif blocks | 2219 | Indentation of `ifdef/`endif blocks. |
| 2219 | `verilog-cexp-indent' (default 1) | 2220 | `verilog-cexp-indent' (default 1) |
| 2220 | Indentation of Verilog statements broken across lines i.e.: | 2221 | Indentation of Verilog statements broken across lines i.e.: |
| 2221 | if (a) | 2222 | if (a) |
| @@ -2226,13 +2227,13 @@ Variables controlling indentation/edit style: | |||
| 2226 | Non-nil means automatically newline after semicolons and the punctuation | 2227 | Non-nil means automatically newline after semicolons and the punctuation |
| 2227 | mark after an end. | 2228 | mark after an end. |
| 2228 | `verilog-auto-indent-on-newline' (default t) | 2229 | `verilog-auto-indent-on-newline' (default t) |
| 2229 | Non-nil means automatically indent line after newline | 2230 | Non-nil means automatically indent line after newline. |
| 2230 | `verilog-tab-always-indent' (default t) | 2231 | `verilog-tab-always-indent' (default t) |
| 2231 | Non-nil means TAB in Verilog mode should always reindent the current line, | 2232 | Non-nil means TAB in Verilog mode should always reindent the current line, |
| 2232 | regardless of where in the line point is when the TAB command is used. | 2233 | regardless of where in the line point is when the TAB command is used. |
| 2233 | `verilog-indent-begin-after-if' (default t) | 2234 | `verilog-indent-begin-after-if' (default t) |
| 2234 | Non-nil means to indent begin statements following a preceding | 2235 | Non-nil means to indent begin statements following a preceding |
| 2235 | if, else, while, for and repeat statements, if any. otherwise, | 2236 | if, else, while, for and repeat statements, if any. Otherwise, |
| 2236 | the begin is lined up with the preceding token. If t, you get: | 2237 | the begin is lined up with the preceding token. If t, you get: |
| 2237 | if (a) | 2238 | if (a) |
| 2238 | begin // amount of indent based on `verilog-cexp-indent' | 2239 | begin // amount of indent based on `verilog-cexp-indent' |
| @@ -2367,7 +2368,7 @@ Key bindings specific to `verilog-mode-map' are: | |||
| 2367 | (add-hook 'font-lock-after-fontify-buffer-hook 'verilog-colorize-include-files-buffer t t) ; not in emacs 20 | 2368 | (add-hook 'font-lock-after-fontify-buffer-hook 'verilog-colorize-include-files-buffer t t) ; not in emacs 20 |
| 2368 | (add-hook 'after-change-functions 'verilog-colorize-include-files t t) | 2369 | (add-hook 'after-change-functions 'verilog-colorize-include-files t t) |
| 2369 | 2370 | ||
| 2370 | ;; Tell imenu how to handle verilog. | 2371 | ;; Tell imenu how to handle Verilog. |
| 2371 | (make-local-variable 'imenu-generic-expression) | 2372 | (make-local-variable 'imenu-generic-expression) |
| 2372 | (setq imenu-generic-expression verilog-imenu-generic-expression) | 2373 | (setq imenu-generic-expression verilog-imenu-generic-expression) |
| 2373 | ;; hideshow support | 2374 | ;; hideshow support |
| @@ -2639,7 +2640,7 @@ following code fragment: | |||
| 2639 | (verilog-insert-1 "%3.3d" max)) | 2640 | (verilog-insert-1 "%3.3d" max)) |
| 2640 | 2641 | ||
| 2641 | (defun verilog-mark-defun () | 2642 | (defun verilog-mark-defun () |
| 2642 | "Mark the current verilog function (or procedure). | 2643 | "Mark the current Verilog function (or procedure). |
| 2643 | This puts the mark at the end, and point at the beginning." | 2644 | This puts the mark at the end, and point at the beginning." |
| 2644 | (interactive) | 2645 | (interactive) |
| 2645 | (when (featurep 'xemacs) | 2646 | (when (featurep 'xemacs) |
| @@ -2872,8 +2873,8 @@ With ARG, first kill any existing labels." | |||
| 2872 | pos))) | 2873 | pos))) |
| 2873 | 2874 | ||
| 2874 | (defun verilog-in-case-region-p () | 2875 | (defun verilog-in-case-region-p () |
| 2875 | "Return TRUE if in a case region; | 2876 | "Return true if in a case region. |
| 2876 | more specifically, point @ in the line foo : @ begin" | 2877 | More specifically, point @ in the line foo : @ begin" |
| 2877 | (interactive) | 2878 | (interactive) |
| 2878 | (save-excursion | 2879 | (save-excursion |
| 2879 | (if (and | 2880 | (if (and |
| @@ -2898,10 +2899,9 @@ more specifically, point @ in the line foo : @ begin" | |||
| 2898 | (t | 2899 | (t |
| 2899 | (throw 'found (= nest 0))))))) | 2900 | (throw 'found (= nest 0))))))) |
| 2900 | nil))) | 2901 | nil))) |
| 2901 | |||
| 2902 | (defun verilog-in-struct-region-p () | 2902 | (defun verilog-in-struct-region-p () |
| 2903 | "Return TRUE if in a struct region; | 2903 | "Return true if in a struct region. |
| 2904 | more specifically, in a list after a struct|union keyword" | 2904 | More specifically, in a list after a struct|union keyword." |
| 2905 | (interactive) | 2905 | (interactive) |
| 2906 | (save-excursion | 2906 | (save-excursion |
| 2907 | (let* ((state (parse-partial-sexp (point-min) (point))) | 2907 | (let* ((state (parse-partial-sexp (point-min) (point))) |
| @@ -2912,8 +2912,8 @@ more specifically, in a list after a struct|union keyword" | |||
| 2912 | (looking-at "\\<typedef\\>?\\s-*\\<struct\\|union\\>")))))) | 2912 | (looking-at "\\<typedef\\>?\\s-*\\<struct\\|union\\>")))))) |
| 2913 | 2913 | ||
| 2914 | (defun verilog-in-generate-region-p () | 2914 | (defun verilog-in-generate-region-p () |
| 2915 | "Return TRUE if in a generate region; | 2915 | "Return true if in a generate region. |
| 2916 | more specifically, after a generate and before an endgenerate" | 2916 | More specifically, after a generate and before an endgenerate." |
| 2917 | (interactive) | 2917 | (interactive) |
| 2918 | (let ((lim (save-excursion (verilog-beg-of-defun) (point))) | 2918 | (let ((lim (save-excursion (verilog-beg-of-defun) (point))) |
| 2919 | (nest 1)) | 2919 | (nest 1)) |
| @@ -3037,7 +3037,8 @@ With KILL-EXISTING-COMMENT, remove what was there before. | |||
| 3037 | Insert `// case: 7 ' or `// NAME ' on this line if appropriate. | 3037 | Insert `// case: 7 ' or `// NAME ' on this line if appropriate. |
| 3038 | Insert `// case expr ' if this line ends a case block. | 3038 | Insert `// case expr ' if this line ends a case block. |
| 3039 | Insert `// ifdef FOO ' if this line ends code conditional on FOO. | 3039 | Insert `// ifdef FOO ' if this line ends code conditional on FOO. |
| 3040 | Insert `// NAME ' if this line ends a function, task, module, primitive or interface named NAME." | 3040 | Insert `// NAME ' if this line ends a function, task, module, |
| 3041 | primitive or interface named NAME." | ||
| 3041 | (save-excursion | 3042 | (save-excursion |
| 3042 | (cond | 3043 | (cond |
| 3043 | (; Comment close preprocessor directives | 3044 | (; Comment close preprocessor directives |
| @@ -3382,7 +3383,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3382 | )))))))))) | 3383 | )))))))))) |
| 3383 | 3384 | ||
| 3384 | (defun verilog-get-expr() | 3385 | (defun verilog-get-expr() |
| 3385 | "Grab expression at point, e.g, case ( a | b & (c ^d))" | 3386 | "Grab expression at point, e.g, case ( a | b & (c ^d))." |
| 3386 | (let* ((b (progn | 3387 | (let* ((b (progn |
| 3387 | (verilog-forward-syntactic-ws) | 3388 | (verilog-forward-syntactic-ws) |
| 3388 | (skip-chars-forward " \t") | 3389 | (skip-chars-forward " \t") |
| @@ -3497,7 +3498,7 @@ Useful for creating tri's and other expanded fields." | |||
| 3497 | ))))) | 3498 | ))))) |
| 3498 | 3499 | ||
| 3499 | (defun verilog-strip-comments () | 3500 | (defun verilog-strip-comments () |
| 3500 | "Strip all comments from the verilog code." | 3501 | "Strip all comments from the Verilog code." |
| 3501 | (interactive) | 3502 | (interactive) |
| 3502 | (goto-char (point-min)) | 3503 | (goto-char (point-min)) |
| 3503 | (while (re-search-forward "//" nil t) | 3504 | (while (re-search-forward "//" nil t) |
| @@ -3518,7 +3519,7 @@ Useful for creating tri's and other expanded fields." | |||
| 3518 | (delete-region bpt (point)))))) | 3519 | (delete-region bpt (point)))))) |
| 3519 | 3520 | ||
| 3520 | (defun verilog-one-line () | 3521 | (defun verilog-one-line () |
| 3521 | "Convert structural verilog instances to occupy one line." | 3522 | "Convert structural Verilog instances to occupy one line." |
| 3522 | (interactive) | 3523 | (interactive) |
| 3523 | (goto-char (point-min)) | 3524 | (goto-char (point-min)) |
| 3524 | (while (re-search-forward "\\([^;]\\)[ \t]*\n[ \t]*" nil t) | 3525 | (while (re-search-forward "\\([^;]\\)[ \t]*\n[ \t]*" nil t) |
| @@ -3543,7 +3544,7 @@ For example: | |||
| 3543 | becomes a comment for the appropriate tool. | 3544 | becomes a comment for the appropriate tool. |
| 3544 | 3545 | ||
| 3545 | The first word of the `compile-command' or `verilog-linter' | 3546 | The first word of the `compile-command' or `verilog-linter' |
| 3546 | variables are used to determine which product is being used. | 3547 | variables is used to determine which product is being used. |
| 3547 | 3548 | ||
| 3548 | See \\[verilog-surelint-off] and \\[verilog-verilint-off]." | 3549 | See \\[verilog-surelint-off] and \\[verilog-verilint-off]." |
| 3549 | (interactive) | 3550 | (interactive) |
| @@ -3693,7 +3694,7 @@ This lets programs calling batch mode to easily extract error messages." | |||
| 3693 | 3694 | ||
| 3694 | (defun verilog-batch-auto () | 3695 | (defun verilog-batch-auto () |
| 3695 | "For use with --batch, perform automatic expansions as a stand-alone tool. | 3696 | "For use with --batch, perform automatic expansions as a stand-alone tool. |
| 3696 | This sets up the appropriate Verilog-Mode environment, updates automatics | 3697 | This sets up the appropriate Verilog mode environment, updates automatics |
| 3697 | with \\[verilog-auto] on all command-line files, and saves the buffers. | 3698 | with \\[verilog-auto] on all command-line files, and saves the buffers. |
| 3698 | For proper results, multiple filenames need to be passed on the command | 3699 | For proper results, multiple filenames need to be passed on the command |
| 3699 | line in bottom-up order." | 3700 | line in bottom-up order." |
| @@ -3703,7 +3704,7 @@ line in bottom-up order." | |||
| 3703 | 3704 | ||
| 3704 | (defun verilog-batch-delete-auto () | 3705 | (defun verilog-batch-delete-auto () |
| 3705 | "For use with --batch, perform automatic deletion as a stand-alone tool. | 3706 | "For use with --batch, perform automatic deletion as a stand-alone tool. |
| 3706 | This sets up the appropriate Verilog-Mode environment, deletes automatics | 3707 | This sets up the appropriate Verilog mode environment, deletes automatics |
| 3707 | with \\[verilog-delete-auto] on all command-line files, and saves the buffers." | 3708 | with \\[verilog-delete-auto] on all command-line files, and saves the buffers." |
| 3708 | (unless noninteractive | 3709 | (unless noninteractive |
| 3709 | (error "Use verilog-batch-delete-auto only with --batch")) ;; Otherwise we'd mess up buffer modes | 3710 | (error "Use verilog-batch-delete-auto only with --batch")) ;; Otherwise we'd mess up buffer modes |
| @@ -3711,7 +3712,7 @@ with \\[verilog-delete-auto] on all command-line files, and saves the buffers." | |||
| 3711 | 3712 | ||
| 3712 | (defun verilog-batch-inject-auto () | 3713 | (defun verilog-batch-inject-auto () |
| 3713 | "For use with --batch, perform automatic injection as a stand-alone tool. | 3714 | "For use with --batch, perform automatic injection as a stand-alone tool. |
| 3714 | This sets up the appropriate Verilog-Mode environment, injects new automatics | 3715 | This sets up the appropriate Verilog mode environment, injects new automatics |
| 3715 | with \\[verilog-inject-auto] on all command-line files, and saves the buffers. | 3716 | with \\[verilog-inject-auto] on all command-line files, and saves the buffers. |
| 3716 | For proper results, multiple filenames need to be passed on the command | 3717 | For proper results, multiple filenames need to be passed on the command |
| 3717 | line in bottom-up order." | 3718 | line in bottom-up order." |
| @@ -3721,7 +3722,7 @@ line in bottom-up order." | |||
| 3721 | 3722 | ||
| 3722 | (defun verilog-batch-indent () | 3723 | (defun verilog-batch-indent () |
| 3723 | "For use with --batch, reindent an a entire file as a stand-alone tool. | 3724 | "For use with --batch, reindent an a entire file as a stand-alone tool. |
| 3724 | This sets up the appropriate Verilog-Mode environment, calls | 3725 | This sets up the appropriate Verilog mode environment, calls |
| 3725 | \\[verilog-indent-buffer] on all command-line files, and saves the buffers." | 3726 | \\[verilog-indent-buffer] on all command-line files, and saves the buffers." |
| 3726 | (unless noninteractive | 3727 | (unless noninteractive |
| 3727 | (error "Use verilog-batch-indent only with --batch")) ;; Otherwise we'd mess up buffer modes | 3728 | (error "Use verilog-batch-indent only with --batch")) ;; Otherwise we'd mess up buffer modes |
| @@ -3764,8 +3765,8 @@ Set point to where line starts. Limit search to point LIM." | |||
| 3764 | (defun verilog-calculate-indent () | 3765 | (defun verilog-calculate-indent () |
| 3765 | "Calculate the indent of the current Verilog line. | 3766 | "Calculate the indent of the current Verilog line. |
| 3766 | Examine previous lines. Once a line is found that is definitive as to the | 3767 | Examine previous lines. Once a line is found that is definitive as to the |
| 3767 | type of the current line, return that lines' indent level and its | 3768 | type of the current line, return that lines' indent level and its type. |
| 3768 | type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)." | 3769 | Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)." |
| 3769 | (save-excursion | 3770 | (save-excursion |
| 3770 | (let* ((starting_position (point)) | 3771 | (let* ((starting_position (point)) |
| 3771 | (par 0) | 3772 | (par 0) |
| @@ -4017,8 +4018,8 @@ of the appropriate enclosing block." | |||
| 4017 | (setq nest 0)))))) | 4018 | (setq nest 0)))))) |
| 4018 | 4019 | ||
| 4019 | (defun verilog-leap-to-head () | 4020 | (defun verilog-leap-to-head () |
| 4020 | "Move point to the head of this block; jump from end to matching begin, | 4021 | "Move point to the head of this block. |
| 4021 | from endcase to matching case, and so on." | 4022 | Jump from end to matching begin, from endcase to matching case, and so on." |
| 4022 | (let ((reg nil) | 4023 | (let ((reg nil) |
| 4023 | snest | 4024 | snest |
| 4024 | (nest 1)) | 4025 | (nest 1)) |
| @@ -4097,7 +4098,7 @@ from endcase to matching case, and so on." | |||
| 4097 | 4098 | ||
| 4098 | (defun verilog-continued-line () | 4099 | (defun verilog-continued-line () |
| 4099 | "Return true if this is a continued line. | 4100 | "Return true if this is a continued line. |
| 4100 | Set point to where line starts" | 4101 | Set point to where line starts." |
| 4101 | (let ((continued 't)) | 4102 | (let ((continued 't)) |
| 4102 | (if (eq 0 (forward-line -1)) | 4103 | (if (eq 0 (forward-line -1)) |
| 4103 | (progn | 4104 | (progn |
| @@ -4596,7 +4597,7 @@ Only look at a few lines to determine indent level." | |||
| 4596 | )) | 4597 | )) |
| 4597 | 4598 | ||
| 4598 | (defun verilog-current-indent-level () | 4599 | (defun verilog-current-indent-level () |
| 4599 | "Return the indent-level the current statement has." | 4600 | "Return the indent-level of the current statement." |
| 4600 | (save-excursion | 4601 | (save-excursion |
| 4601 | (let (par-pos) | 4602 | (let (par-pos) |
| 4602 | (beginning-of-line) | 4603 | (beginning-of-line) |
| @@ -4609,7 +4610,7 @@ Only look at a few lines to determine indent level." | |||
| 4609 | (current-column)))) | 4610 | (current-column)))) |
| 4610 | 4611 | ||
| 4611 | (defun verilog-case-indent-level () | 4612 | (defun verilog-case-indent-level () |
| 4612 | "Return the indent-level the current statement has. | 4613 | "Return the indent-level of the current statement. |
| 4613 | Do not count named blocks or case-statements." | 4614 | Do not count named blocks or case-statements." |
| 4614 | (save-excursion | 4615 | (save-excursion |
| 4615 | (skip-chars-forward " \t") | 4616 | (skip-chars-forward " \t") |
| @@ -5048,15 +5049,15 @@ it displays a list of all possible completions.") | |||
| 5048 | "triand" "trior" "trireg" "wand" "wire" "wor" "xnor" "xor" | 5049 | "triand" "trior" "trireg" "wand" "wire" "wor" "xnor" "xor" |
| 5049 | ) | 5050 | ) |
| 5050 | "*Keywords for types used when completing a word in a declaration or parmlist. | 5051 | "*Keywords for types used when completing a word in a declaration or parmlist. |
| 5051 | \(eg. integer, real, reg...)") | 5052 | \(Eg. integer, real, reg...)") |
| 5052 | 5053 | ||
| 5053 | (defvar verilog-cpp-keywords | 5054 | (defvar verilog-cpp-keywords |
| 5054 | '("module" "macromodule" "primitive" "timescale" "define" "ifdef" "ifndef" "else" | 5055 | '("module" "macromodule" "primitive" "timescale" "define" "ifdef" "ifndef" "else" |
| 5055 | "endif") | 5056 | "endif") |
| 5056 | "*Keywords to complete when at first word of a line in declarative scope. | 5057 | "*Keywords to complete when at first word of a line in declarative scope. |
| 5057 | \(eg. initial, always, begin, assign.) | 5058 | \(Eg. initial, always, begin, assign.) |
| 5058 | The procedures and variables defined within the Verilog program | 5059 | The procedures and variables defined within the Verilog program |
| 5059 | will be completed runtime and should not be added to this list.") | 5060 | will be completed at runtime and should not be added to this list.") |
| 5060 | 5061 | ||
| 5061 | (defvar verilog-defun-keywords | 5062 | (defvar verilog-defun-keywords |
| 5062 | (append | 5063 | (append |
| @@ -5068,9 +5069,9 @@ will be completed runtime and should not be added to this list.") | |||
| 5068 | ) | 5069 | ) |
| 5069 | verilog-type-keywords) | 5070 | verilog-type-keywords) |
| 5070 | "*Keywords to complete when at first word of a line in declarative scope. | 5071 | "*Keywords to complete when at first word of a line in declarative scope. |
| 5071 | \(eg. initial, always, begin, assign.) | 5072 | \(Eg. initial, always, begin, assign.) |
| 5072 | The procedures and variables defined within the Verilog program | 5073 | The procedures and variables defined within the Verilog program |
| 5073 | will be completed runtime and should not be added to this list.") | 5074 | will be completed at runtime and should not be added to this list.") |
| 5074 | 5075 | ||
| 5075 | (defvar verilog-block-keywords | 5076 | (defvar verilog-block-keywords |
| 5076 | '( | 5077 | '( |
| @@ -5079,30 +5080,30 @@ will be completed runtime and should not be added to this list.") | |||
| 5079 | "for" "fork" "if" "join" "join_any" "join_none" "repeat" "return" | 5080 | "for" "fork" "if" "join" "join_any" "join_none" "repeat" "return" |
| 5080 | "while") | 5081 | "while") |
| 5081 | "*Keywords to complete when at first word of a line in behavioral scope. | 5082 | "*Keywords to complete when at first word of a line in behavioral scope. |
| 5082 | \(eg. begin, if, then, else, for, fork.) | 5083 | \(Eg. begin, if, then, else, for, fork.) |
| 5083 | The procedures and variables defined within the Verilog program | 5084 | The procedures and variables defined within the Verilog program |
| 5084 | will be completed runtime and should not be added to this list.") | 5085 | will be completed at runtime and should not be added to this list.") |
| 5085 | 5086 | ||
| 5086 | (defvar verilog-tf-keywords | 5087 | (defvar verilog-tf-keywords |
| 5087 | '("begin" "break" "fork" "join" "join_any" "join_none" "case" "end" "endtask" "endfunction" "if" "else" "for" "while" "repeat") | 5088 | '("begin" "break" "fork" "join" "join_any" "join_none" "case" "end" "endtask" "endfunction" "if" "else" "for" "while" "repeat") |
| 5088 | "*Keywords to complete when at first word of a line in a task or function. | 5089 | "*Keywords to complete when at first word of a line in a task or function. |
| 5089 | \(eg. begin, if, then, else, for, fork.) | 5090 | \(Eg. begin, if, then, else, for, fork.) |
| 5090 | The procedures and variables defined within the Verilog program | 5091 | The procedures and variables defined within the Verilog program |
| 5091 | will be completed runtime and should not be added to this list.") | 5092 | will be completed at runtime and should not be added to this list.") |
| 5092 | 5093 | ||
| 5093 | (defvar verilog-case-keywords | 5094 | (defvar verilog-case-keywords |
| 5094 | '("begin" "fork" "join" "join_any" "join_none" "case" "end" "endcase" "if" "else" "for" "repeat") | 5095 | '("begin" "fork" "join" "join_any" "join_none" "case" "end" "endcase" "if" "else" "for" "repeat") |
| 5095 | "*Keywords to complete when at first word of a line in case scope. | 5096 | "*Keywords to complete when at first word of a line in case scope. |
| 5096 | \(eg. begin, if, then, else, for, fork.) | 5097 | \(Eg. begin, if, then, else, for, fork.) |
| 5097 | The procedures and variables defined within the Verilog program | 5098 | The procedures and variables defined within the Verilog program |
| 5098 | will be completed runtime and should not be added to this list.") | 5099 | will be completed at runtime and should not be added to this list.") |
| 5099 | 5100 | ||
| 5100 | (defvar verilog-separator-keywords | 5101 | (defvar verilog-separator-keywords |
| 5101 | '("else" "then" "begin") | 5102 | '("else" "then" "begin") |
| 5102 | "*Keywords to complete when NOT standing at the first word of a statement. | 5103 | "*Keywords to complete when NOT standing at the first word of a statement. |
| 5103 | \(eg. else, then.) | 5104 | \(Eg. else, then.) |
| 5104 | Variables and function names defined within the | 5105 | Variables and function names defined within the Verilog program |
| 5105 | Verilog program are completed runtime and should not be added to this list.") | 5106 | will be completed at runtime and should not be added to this list.") |
| 5106 | 5107 | ||
| 5107 | (defun verilog-string-diff (str1 str2) | 5108 | (defun verilog-string-diff (str1 str2) |
| 5108 | "Return index of first letter where STR1 and STR2 differs." | 5109 | "Return index of first letter where STR1 and STR2 differs." |
| @@ -5210,11 +5211,11 @@ for matches of `str' and adding the occurrence tp `all' through point END." | |||
| 5210 | "Function passed to `completing-read', `try-completion' or `all-completions'. | 5211 | "Function passed to `completing-read', `try-completion' or `all-completions'. |
| 5211 | Called to get completion on VERILOG-STR. If VERILOG-PRED is non-nil, it | 5212 | Called to get completion on VERILOG-STR. If VERILOG-PRED is non-nil, it |
| 5212 | must be a function to be called for every match to check if this should | 5213 | must be a function to be called for every match to check if this should |
| 5213 | really be a match. If VERILOG-FLAG is t, the function returns a list of all | 5214 | really be a match. If VERILOG-FLAG is t, the function returns a list of |
| 5214 | possible completions. If VERILOG-FLAG is nil it returns a string, the | 5215 | all possible completions. If VERILOG-FLAG is nil it returns a string, |
| 5215 | longest possible completion, or t if STR is an exact match. If VERILOG-FLAG | 5216 | the longest possible completion, or t if VERILOG-STR is an exact match. |
| 5216 | is 'lambda, the function returns t if STR is an exact match, nil | 5217 | If VERILOG-FLAG is 'lambda, the function returns t if VERILOG-STR is an |
| 5217 | otherwise." | 5218 | exact match, nil otherwise." |
| 5218 | (save-excursion | 5219 | (save-excursion |
| 5219 | (let ((verilog-all nil)) | 5220 | (let ((verilog-all nil)) |
| 5220 | ;; Set buffer to use for searching labels. This should be set | 5221 | ;; Set buffer to use for searching labels. This should be set |
| @@ -5721,8 +5722,8 @@ Bound search by LIMIT. Adapted from | |||
| 5721 | (nth 3 sigs)) | 5722 | (nth 3 sigs)) |
| 5722 | 5723 | ||
| 5723 | (defun verilog-signals-not-in (in-list not-list) | 5724 | (defun verilog-signals-not-in (in-list not-list) |
| 5724 | "Return list of signals in IN-LIST that aren't also in NOT-LIST, | 5725 | "Return list of signals in IN-LIST that aren't also in NOT-LIST. |
| 5725 | and also remove any duplicates in IN-LIST. | 5726 | Also remove any duplicates in IN-LIST. |
| 5726 | Signals must be in standard (base vector) form." | 5727 | Signals must be in standard (base vector) form." |
| 5727 | (let (out-list) | 5728 | (let (out-list) |
| 5728 | (while in-list | 5729 | (while in-list |
| @@ -6113,7 +6114,7 @@ Return a array of [outputs inouts inputs wire reg assign const]." | |||
| 6113 | 6114 | ||
| 6114 | 6115 | ||
| 6115 | (defun verilog-read-sub-decls-sig (submodi comment port sig vec multidim) | 6116 | (defun verilog-read-sub-decls-sig (submodi comment port sig vec multidim) |
| 6116 | "For verilog-read-sub-decls-line, add a signal." | 6117 | "For `verilog-read-sub-decls-line', add a signal." |
| 6117 | (let (portdata) | 6118 | (let (portdata) |
| 6118 | (when sig | 6119 | (when sig |
| 6119 | (setq port (verilog-symbol-detick-denumber port)) | 6120 | (setq port (verilog-symbol-detick-denumber port)) |
| @@ -6145,7 +6146,7 @@ Return a array of [outputs inouts inputs wire reg assign const]." | |||
| 6145 | ))))) | 6146 | ))))) |
| 6146 | 6147 | ||
| 6147 | (defun verilog-read-sub-decls-line (submodi comment) | 6148 | (defun verilog-read-sub-decls-line (submodi comment) |
| 6148 | "For read-sub-decls, read lines of port defs until none match anymore. | 6149 | "For `verilog-read-sub-decls', read lines of port defs until none match anymore. |
| 6149 | Return the list of signals found, using submodi to look up each port." | 6150 | Return the list of signals found, using submodi to look up each port." |
| 6150 | (let (done port sig vec multidim) | 6151 | (let (done port sig vec multidim) |
| 6151 | (save-excursion | 6152 | (save-excursion |
| @@ -6266,7 +6267,7 @@ Outputs comments above subcell signals, for example: | |||
| 6266 | (verilog-signals-combine-bus (nreverse sigs-in)))))) | 6267 | (verilog-signals-combine-bus (nreverse sigs-in)))))) |
| 6267 | 6268 | ||
| 6268 | (defun verilog-read-inst-pins () | 6269 | (defun verilog-read-inst-pins () |
| 6269 | "Return a array of [ pins ] for the current instantiation at point. | 6270 | "Return an array of [ pins ] for the current instantiation at point. |
| 6270 | For example if declare A A (.B(SIG)) then B will be included in the list." | 6271 | For example if declare A A (.B(SIG)) then B will be included in the list." |
| 6271 | (save-excursion | 6272 | (save-excursion |
| 6272 | (let ((end-mod-point (point)) ;; presume at /*AUTOINST*/ point | 6273 | (let ((end-mod-point (point)) ;; presume at /*AUTOINST*/ point |
| @@ -6281,7 +6282,7 @@ For example if declare A A (.B(SIG)) then B will be included in the list." | |||
| 6281 | (vector pins)))) | 6282 | (vector pins)))) |
| 6282 | 6283 | ||
| 6283 | (defun verilog-read-arg-pins () | 6284 | (defun verilog-read-arg-pins () |
| 6284 | "Return a array of [ pins ] for the current argument declaration at point." | 6285 | "Return an array of [ pins ] for the current argument declaration at point." |
| 6285 | (save-excursion | 6286 | (save-excursion |
| 6286 | (let ((end-mod-point (point)) ;; presume at /*AUTOARG*/ point | 6287 | (let ((end-mod-point (point)) ;; presume at /*AUTOARG*/ point |
| 6287 | pins pin) | 6288 | pins pin) |
| @@ -6510,7 +6511,7 @@ IGNORE-NEXT is true to ignore next token, fake from inside case statement." | |||
| 6510 | (defun verilog-read-auto-template (module) | 6511 | (defun verilog-read-auto-template (module) |
| 6511 | "Look for a auto_template for the instantiation of the given MODULE. | 6512 | "Look for a auto_template for the instantiation of the given MODULE. |
| 6512 | If found returns the signal name connections. Return REGEXP and | 6513 | If found returns the signal name connections. Return REGEXP and |
| 6513 | list of ( (signal_name connection_name)... )" | 6514 | list of ( (signal_name connection_name)... )." |
| 6514 | (save-excursion | 6515 | (save-excursion |
| 6515 | ;; Find beginning | 6516 | ;; Find beginning |
| 6516 | (let ((tpl-regexp "\\([0-9]+\\)") | 6517 | (let ((tpl-regexp "\\([0-9]+\\)") |
| @@ -6726,7 +6727,7 @@ foo.v (a include): | |||
| 6726 | (defun verilog-read-signals (&optional start end) | 6727 | (defun verilog-read-signals (&optional start end) |
| 6727 | "Return a simple list of all possible signals in the file. | 6728 | "Return a simple list of all possible signals in the file. |
| 6728 | Bounded by optional region from START to END. Overly aggressive but fast. | 6729 | Bounded by optional region from START to END. Overly aggressive but fast. |
| 6729 | Some macros and such are also found and included. For dinotrace.el" | 6730 | Some macros and such are also found and included. For dinotrace.el." |
| 6730 | (let (sigs-all keywd) | 6731 | (let (sigs-all keywd) |
| 6731 | (progn;save-excursion | 6732 | (progn;save-excursion |
| 6732 | (goto-char (or start (point-min))) | 6733 | (goto-char (or start (point-min))) |
| @@ -6821,7 +6822,7 @@ Some macros and such are also found and included. For dinotrace.el" | |||
| 6821 | ;;(verilog-getopt (list "+libext+.a+.b" "+incdir+foodir" "+define+a+aval" "-f" "otherf" "-v" "library" "-y" "dir")) | 6822 | ;;(verilog-getopt (list "+libext+.a+.b" "+incdir+foodir" "+define+a+aval" "-f" "otherf" "-v" "library" "-y" "dir")) |
| 6822 | 6823 | ||
| 6823 | (defun verilog-getopt-file (filename) | 6824 | (defun verilog-getopt-file (filename) |
| 6824 | "Read verilog options from the specified FILENAME." | 6825 | "Read Verilog options from the specified FILENAME." |
| 6825 | (save-excursion | 6826 | (save-excursion |
| 6826 | (let ((fns (verilog-library-filenames filename (buffer-file-name))) | 6827 | (let ((fns (verilog-library-filenames filename (buffer-file-name))) |
| 6827 | (orig-buffer (current-buffer)) | 6828 | (orig-buffer (current-buffer)) |
| @@ -6858,7 +6859,7 @@ Some macros and such are also found and included. For dinotrace.el" | |||
| 6858 | 6859 | ||
| 6859 | (defun verilog-add-list-unique (varref object) | 6860 | (defun verilog-add-list-unique (varref object) |
| 6860 | "Append to VARREF list the given OBJECT, | 6861 | "Append to VARREF list the given OBJECT, |
| 6861 | unless it is already a member of the variable's list" | 6862 | unless it is already a member of the variable's list." |
| 6862 | (unless (member object (symbol-value varref)) | 6863 | (unless (member object (symbol-value varref)) |
| 6863 | (set varref (append (symbol-value varref) (list object)))) | 6864 | (set varref (append (symbol-value varref) (list object)))) |
| 6864 | varref) | 6865 | varref) |
| @@ -6894,7 +6895,7 @@ Allows version control to check out the file if need be." | |||
| 6894 | (string-match "^[0-9 \t]+'s?[hdxbo][0-9a-fA-F_xz? \t]*$" symbol))) | 6895 | (string-match "^[0-9 \t]+'s?[hdxbo][0-9a-fA-F_xz? \t]*$" symbol))) |
| 6895 | 6896 | ||
| 6896 | (defun verilog-symbol-detick (symbol wing-it) | 6897 | (defun verilog-symbol-detick (symbol wing-it) |
| 6897 | "Return a expanded SYMBOL name without any defines. | 6898 | "Return an expanded SYMBOL name without any defines. |
| 6898 | If the variable vh-{symbol} is defined, return that value. | 6899 | If the variable vh-{symbol} is defined, return that value. |
| 6899 | If undefined, and WING-IT, return just SYMBOL without the tick, else nil." | 6900 | If undefined, and WING-IT, return just SYMBOL without the tick, else nil." |
| 6900 | (while (and symbol (string-match "^`" symbol)) | 6901 | (while (and symbol (string-match "^`" symbol)) |
| @@ -6929,7 +6930,7 @@ If undefined, and WING-IT, return just SYMBOL without the tick, else nil." | |||
| 6929 | symbol)) | 6930 | symbol)) |
| 6930 | 6931 | ||
| 6931 | (defun verilog-symbol-detick-text (text) | 6932 | (defun verilog-symbol-detick-text (text) |
| 6932 | "Return TEXT with any without any known defines. | 6933 | "Return TEXT without any known defines. |
| 6933 | If the variable vh-{symbol} is defined, substitute that value." | 6934 | If the variable vh-{symbol} is defined, substitute that value." |
| 6934 | (let ((ok t) symbol val) | 6935 | (let ((ok t) symbol val) |
| 6935 | (while (and ok (string-match "`\\([a-zA-Z0-9_]+\\)" text)) | 6936 | (while (and ok (string-match "`\\([a-zA-Z0-9_]+\\)" text)) |
| @@ -7034,10 +7035,10 @@ Buffer-local.") | |||
| 7034 | 7035 | ||
| 7035 | (defvar verilog-modi-cache-preserve-tick nil | 7036 | (defvar verilog-modi-cache-preserve-tick nil |
| 7036 | "Modification tick after which the cache is still considered valid. | 7037 | "Modification tick after which the cache is still considered valid. |
| 7037 | Use verilog-preserve-cache's to set") | 7038 | Use `verilog-preserve-cache' to set it.") |
| 7038 | (defvar verilog-modi-cache-preserve-buffer nil | 7039 | (defvar verilog-modi-cache-preserve-buffer nil |
| 7039 | "Modification tick after which the cache is still considered valid. | 7040 | "Modification tick after which the cache is still considered valid. |
| 7040 | Use verilog-preserve-cache's to set") | 7041 | Use `verilog-preserve-cache' to set it.") |
| 7041 | 7042 | ||
| 7042 | (defun verilog-modi-current () | 7043 | (defun verilog-modi-current () |
| 7043 | "Return the modi structure for the module currently at point." | 7044 | "Return the modi structure for the module currently at point." |
| @@ -7101,7 +7102,7 @@ Return modi if successful, else print message unless IGNORE-ERROR is true." | |||
| 7101 | (aref modi 2)) | 7102 | (aref modi 2)) |
| 7102 | 7103 | ||
| 7103 | (defun verilog-modi-filename (modi) | 7104 | (defun verilog-modi-filename (modi) |
| 7104 | "Filename of MODI, or name of buffer if its never been saved." | 7105 | "Filename of MODI, or name of buffer if it's never been saved." |
| 7105 | (if (bufferp (verilog-modi-file-or-buffer modi)) | 7106 | (if (bufferp (verilog-modi-file-or-buffer modi)) |
| 7106 | (or (buffer-file-name (verilog-modi-file-or-buffer modi)) | 7107 | (or (buffer-file-name (verilog-modi-file-or-buffer modi)) |
| 7107 | (buffer-name (verilog-modi-file-or-buffer modi))) | 7108 | (buffer-name (verilog-modi-file-or-buffer modi))) |
| @@ -7113,7 +7114,7 @@ Return modi if successful, else print message unless IGNORE-ERROR is true." | |||
| 7113 | (set-buffer (if (bufferp (verilog-modi-file-or-buffer modi)) | 7114 | (set-buffer (if (bufferp (verilog-modi-file-or-buffer modi)) |
| 7114 | (verilog-modi-file-or-buffer modi) | 7115 | (verilog-modi-file-or-buffer modi) |
| 7115 | (find-file-noselect (verilog-modi-file-or-buffer modi)))) | 7116 | (find-file-noselect (verilog-modi-file-or-buffer modi)))) |
| 7116 | (or (equal major-mode `verilog-mode) ;; Put into verilog mode to get syntax | 7117 | (or (equal major-mode `verilog-mode) ;; Put into Verilog mode to get syntax |
| 7117 | (verilog-mode)) | 7118 | (verilog-mode)) |
| 7118 | (goto-char (verilog-modi-point modi))) | 7119 | (goto-char (verilog-modi-point modi))) |
| 7119 | 7120 | ||
| @@ -7412,8 +7413,8 @@ This repairs those mis-inserted by a AUTOARG." | |||
| 7412 | (forward-line 1)))) | 7413 | (forward-line 1)))) |
| 7413 | 7414 | ||
| 7414 | (defun verilog-forward-close-paren () | 7415 | (defun verilog-forward-close-paren () |
| 7415 | "Find the close parenthesis that match the current point, | 7416 | "Find the close parenthesis that match the current point. |
| 7416 | ignore other close parenthesis with matching open parens" | 7417 | Ignore other close parenthesis with matching open parens." |
| 7417 | (let ((parens 1)) | 7418 | (let ((parens 1)) |
| 7418 | (while (> parens 0) | 7419 | (while (> parens 0) |
| 7419 | (unless (verilog-re-search-forward-quick "[()]" nil t) | 7420 | (unless (verilog-re-search-forward-quick "[()]" nil t) |
| @@ -7424,8 +7425,8 @@ ignore other close parenthesis with matching open parens" | |||
| 7424 | (setq parens (1- parens))))))) | 7425 | (setq parens (1- parens))))))) |
| 7425 | 7426 | ||
| 7426 | (defun verilog-backward-open-paren () | 7427 | (defun verilog-backward-open-paren () |
| 7427 | "Find the open parenthesis that match the current point, | 7428 | "Find the open parenthesis that match the current point. |
| 7428 | ignore other open parenthesis with matching close parens" | 7429 | Ignore other open parenthesis with matching close parens." |
| 7429 | (let ((parens 1)) | 7430 | (let ((parens 1)) |
| 7430 | (while (> parens 0) | 7431 | (while (> parens 0) |
| 7431 | (unless (verilog-re-search-backward-quick "[()]" nil t) | 7432 | (unless (verilog-re-search-backward-quick "[()]" nil t) |
| @@ -7436,8 +7437,8 @@ ignore other open parenthesis with matching close parens" | |||
| 7436 | (setq parens (1- parens))))))) | 7437 | (setq parens (1- parens))))))) |
| 7437 | 7438 | ||
| 7438 | (defun verilog-backward-open-bracket () | 7439 | (defun verilog-backward-open-bracket () |
| 7439 | "Find the open bracket that match the current point, | 7440 | "Find the open bracket that match the current point. |
| 7440 | ignore other open bracket with matching close bracket" | 7441 | Ignore other open bracket with matching close bracket." |
| 7441 | (let ((parens 1)) | 7442 | (let ((parens 1)) |
| 7442 | (while (> parens 0) | 7443 | (while (> parens 0) |
| 7443 | (unless (verilog-re-search-backward-quick "[][]" nil t) | 7444 | (unless (verilog-re-search-backward-quick "[][]" nil t) |
| @@ -7552,8 +7553,8 @@ called before and after this function, respectively." | |||
| 7552 | Any always @ blocks with sensitivity lists that match computed lists will | 7553 | Any always @ blocks with sensitivity lists that match computed lists will |
| 7553 | be replaced with /*AS*/ comments. | 7554 | be replaced with /*AS*/ comments. |
| 7554 | 7555 | ||
| 7555 | Any cells will get /*AUTOINST*/ added to the end of the pin list. Pins with | 7556 | Any cells will get /*AUTOINST*/ added to the end of the pin list. |
| 7556 | have identical names will be deleted. | 7557 | Pins with have identical names will be deleted. |
| 7557 | 7558 | ||
| 7558 | Argument lists will not be deleted, /*AUTOARG*/ will only be inserted to | 7559 | Argument lists will not be deleted, /*AUTOARG*/ will only be inserted to |
| 7559 | support adding new ports. You may wish to delete older ports yourself. | 7560 | support adding new ports. You may wish to delete older ports yourself. |
| @@ -7767,9 +7768,9 @@ Typing \\[verilog-auto] will make this into: | |||
| 7767 | 7768 | ||
| 7768 | Any ports declared between the ( and /*AUTOARG*/ are presumed to be | 7769 | Any ports declared between the ( and /*AUTOARG*/ are presumed to be |
| 7769 | predeclared and are not redeclared by AUTOARG. AUTOARG will make a | 7770 | predeclared and are not redeclared by AUTOARG. AUTOARG will make a |
| 7770 | conservative guess on adding a comma for the first signal, if you have any | 7771 | conservative guess on adding a comma for the first signal, if you have |
| 7771 | ifdefs or complicated expressions before the AUTOARG you will need to | 7772 | any ifdefs or complicated expressions before the AUTOARG you will need |
| 7772 | choose the comma yourself. | 7773 | to choose the comma yourself. |
| 7773 | 7774 | ||
| 7774 | Avoid declaring ports manually, as it makes code harder to maintain." | 7775 | Avoid declaring ports manually, as it makes code harder to maintain." |
| 7775 | (save-excursion | 7776 | (save-excursion |
| @@ -7899,7 +7900,7 @@ If FOR-STAR add comment it is a .* expansion." | |||
| 7899 | "Expand SystemVerilog .* pins, as part of \\[verilog-auto]. | 7900 | "Expand SystemVerilog .* pins, as part of \\[verilog-auto]. |
| 7900 | 7901 | ||
| 7901 | If `verilog-auto-star-expand' is set, .* pins are treated if they were | 7902 | If `verilog-auto-star-expand' is set, .* pins are treated if they were |
| 7902 | AUTOINST statements, otherwise they are ignored. For safety, Verilog-Mode | 7903 | AUTOINST statements, otherwise they are ignored. For safety, Verilog mode |
| 7903 | will also ignore any .* that are not last in your pin list (this prevents | 7904 | will also ignore any .* that are not last in your pin list (this prevents |
| 7904 | it from deleting pins following the .* when it expands the AUTOINST.) | 7905 | it from deleting pins following the .* when it expands the AUTOINST.) |
| 7905 | 7906 | ||
| @@ -7935,7 +7936,7 @@ Limitations: | |||
| 7935 | 7936 | ||
| 7936 | Typedefs must match `verilog-typedef-regexp', which is disabled by default. | 7937 | Typedefs must match `verilog-typedef-regexp', which is disabled by default. |
| 7937 | 7938 | ||
| 7938 | SystemVerilog multidimmensional input/output has only experimental support. | 7939 | SystemVerilog multidimensional input/output has only experimental support. |
| 7939 | 7940 | ||
| 7940 | For example, first take the submodule inst.v: | 7941 | For example, first take the submodule inst.v: |
| 7941 | 7942 | ||
| @@ -7970,9 +7971,9 @@ Where the list of inputs and outputs came from the inst module. | |||
| 7970 | Exceptions: | 7971 | Exceptions: |
| 7971 | 7972 | ||
| 7972 | Unless you are instantiating a module multiple times, or the module is | 7973 | Unless you are instantiating a module multiple times, or the module is |
| 7973 | something trivial like a adder, DO NOT CHANGE SIGNAL NAMES ACROSS HIERARCHY. | 7974 | something trivial like an adder, DO NOT CHANGE SIGNAL NAMES ACROSS HIERARCHY. |
| 7974 | It just makes for unmaintainable code. To sanitize signal names, try | 7975 | It just makes for unmaintainable code. To sanitize signal names, try |
| 7975 | vrename from http://www.veripool.com | 7976 | vrename from http://www.veripool.com. |
| 7976 | 7977 | ||
| 7977 | When you need to violate this suggestion there are two ways to list | 7978 | When you need to violate this suggestion there are two ways to list |
| 7978 | exceptions, placing them before the AUTOINST, or using templates. | 7979 | exceptions, placing them before the AUTOINST, or using templates. |
| @@ -8001,10 +8002,10 @@ Templates: | |||
| 8001 | ); | 8002 | ); |
| 8002 | */ | 8003 | */ |
| 8003 | 8004 | ||
| 8004 | Templates go ABOVE the instantiation(s). When a instantiation is | 8005 | Templates go ABOVE the instantiation(s). When an instantiation is |
| 8005 | expanded `verilog-mode' simply searches up for the closest template. | 8006 | expanded `verilog-mode' simply searches up for the closest template. |
| 8006 | Thus you can have multiple templates for the same module, just alternate | 8007 | Thus you can have multiple templates for the same module, just alternate |
| 8007 | between the template for a instantiation and the instantiation itself. | 8008 | between the template for an instantiation and the instantiation itself. |
| 8008 | 8009 | ||
| 8009 | The module name must be the same as the name of the module in the | 8010 | The module name must be the same as the name of the module in the |
| 8010 | instantiation name, and the code \"AUTO_TEMPLATE\" must be in these exact | 8011 | instantiation name, and the code \"AUTO_TEMPLATE\" must be in these exact |
| @@ -8110,7 +8111,7 @@ Regexp Templates: | |||
| 8110 | 8111 | ||
| 8111 | .pci_req\\([0-9]+\\)_l (pci_req_jtag_[\\1]), | 8112 | .pci_req\\([0-9]+\\)_l (pci_req_jtag_[\\1]), |
| 8112 | 8113 | ||
| 8113 | will apply a Emacs style regular expression search for any port beginning | 8114 | will apply an Emacs style regular expression search for any port beginning |
| 8114 | in pci_req followed by numbers and ending in _l and connecting that to | 8115 | in pci_req followed by numbers and ending in _l and connecting that to |
| 8115 | the pci_req_jtag_[] net, with the bus subscript coming from what matches | 8116 | the pci_req_jtag_[] net, with the bus subscript coming from what matches |
| 8116 | inside the first set of \\( \\). Thus pci_req2_l becomes pci_req_jtag_[2]. | 8117 | inside the first set of \\( \\). Thus pci_req2_l becomes pci_req_jtag_[2]. |
| @@ -8139,13 +8140,13 @@ Lisp Templates: | |||
| 8139 | a leading backslash (\\\"). There are special variables defined that are | 8140 | a leading backslash (\\\"). There are special variables defined that are |
| 8140 | useful in these Lisp functions: | 8141 | useful in these Lisp functions: |
| 8141 | 8142 | ||
| 8142 | vl-name Name portion of the input/output port | 8143 | vl-name Name portion of the input/output port. |
| 8143 | vl-bits Bus bits portion of the input/output port ('[2:0]') | 8144 | vl-bits Bus bits portion of the input/output port ('[2:0]'). |
| 8144 | vl-width Width of the input/output port ('3' for [2:0]) | 8145 | vl-width Width of the input/output port ('3' for [2:0]). |
| 8145 | May be a (...) expression if bits isn't a constant. | 8146 | May be a (...) expression if bits isn't a constant. |
| 8146 | vl-dir Direction of the pin input/output/inout. | 8147 | vl-dir Direction of the pin input/output/inout. |
| 8147 | vl-cell-type Module name/type of the cell ('psm_mas') | 8148 | vl-cell-type Module name/type of the cell ('psm_mas'). |
| 8148 | vl-cell-name Instance name of the cell ('ms2m') | 8149 | vl-cell-name Instance name of the cell ('ms2m'). |
| 8149 | 8150 | ||
| 8150 | Normal Lisp variables may be used in expressions. See | 8151 | Normal Lisp variables may be used in expressions. See |
| 8151 | `verilog-read-defines' which can set vh-{definename} variables for use | 8152 | `verilog-read-defines' which can set vh-{definename} variables for use |
| @@ -8158,7 +8159,7 @@ Lisp Templates: | |||
| 8158 | functions to be defined or variables to be changed between instantiations. | 8159 | functions to be defined or variables to be changed between instantiations. |
| 8159 | 8160 | ||
| 8160 | Note that when using lisp expressions errors may occur when @ is not a | 8161 | Note that when using lisp expressions errors may occur when @ is not a |
| 8161 | number, you may need to use the standard Emacs Lisp functions | 8162 | number; you may need to use the standard Emacs Lisp functions |
| 8162 | `number-to-string' and `string-to-number'. | 8163 | `number-to-string' and `string-to-number'. |
| 8163 | 8164 | ||
| 8164 | After the evaluation is completed, @ substitution and [] substitution | 8165 | After the evaluation is completed, @ substitution and [] substitution |
| @@ -8463,9 +8464,9 @@ Limitations: | |||
| 8463 | This does NOT work on memories or SystemVerilog .name connections, | 8464 | This does NOT work on memories or SystemVerilog .name connections, |
| 8464 | declare those yourself. | 8465 | declare those yourself. |
| 8465 | 8466 | ||
| 8466 | Verilog-mode will add \"Couldn't Merge\" comments to signals it cannot | 8467 | Verilog mode will add \"Couldn't Merge\" comments to signals it cannot |
| 8467 | determine how to bus together. This occurs when you have ports with | 8468 | determine how to bus together. This occurs when you have ports with |
| 8468 | non-numeric or non-sequential bus subscripts. If Verilog-Mode | 8469 | non-numeric or non-sequential bus subscripts. If Verilog mode |
| 8469 | mis-guessed, you'll have to declare them yourself. | 8470 | mis-guessed, you'll have to declare them yourself. |
| 8470 | 8471 | ||
| 8471 | An example (see `verilog-auto-inst' for what else is going on here): | 8472 | An example (see `verilog-auto-inst' for what else is going on here): |
| @@ -8761,8 +8762,8 @@ Typing \\[verilog-auto] will make this into: | |||
| 8761 | "Expand AUTOINOUTMODULE statements, as part of \\[verilog-auto]. | 8762 | "Expand AUTOINOUTMODULE statements, as part of \\[verilog-auto]. |
| 8762 | Take input/output/inout statements from the specified module and insert | 8763 | Take input/output/inout statements from the specified module and insert |
| 8763 | into the current module. This is useful for making null templates and | 8764 | into the current module. This is useful for making null templates and |
| 8764 | shell modules which need to have identical I/O with another module. Any | 8765 | shell modules which need to have identical I/O with another module. |
| 8765 | I/O which are already defined in this module will not be redefined. | 8766 | Any I/O which are already defined in this module will not be redefined. |
| 8766 | 8767 | ||
| 8767 | Limitations: | 8768 | Limitations: |
| 8768 | If placed inside the parenthesis of a module declaration, it creates | 8769 | If placed inside the parenthesis of a module declaration, it creates |
| @@ -9170,7 +9171,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 9170 | (verilog-insert-indent "// End of automatics\n"))))) | 9171 | (verilog-insert-indent "// End of automatics\n"))))) |
| 9171 | 9172 | ||
| 9172 | (defun verilog-enum-ascii (signm elim-regexp) | 9173 | (defun verilog-enum-ascii (signm elim-regexp) |
| 9173 | "Convert a enum name SIGNM to a ascii string for insertion. | 9174 | "Convert an enum name SIGNM to an ascii string for insertion. |
| 9174 | Remove user provided prefix ELIM-REGEXP." | 9175 | Remove user provided prefix ELIM-REGEXP." |
| 9175 | (or elim-regexp (setq elim-regexp "_ DONT MATCH IT_")) | 9176 | (or elim-regexp (setq elim-regexp "_ DONT MATCH IT_")) |
| 9176 | (let ((case-fold-search t)) | 9177 | (let ((case-fold-search t)) |
| @@ -9653,7 +9654,7 @@ for sensitivity list." | |||
| 9653 | > (- verilog-indent-level-behavioral) "endgenerate" \n > ) | 9654 | > (- verilog-indent-level-behavioral) "endgenerate" \n > ) |
| 9654 | 9655 | ||
| 9655 | (define-skeleton verilog-sk-begin | 9656 | (define-skeleton verilog-sk-begin |
| 9656 | "Insert begin end block. Uses the minibuffer to prompt for name" | 9657 | "Insert begin end block. Uses the minibuffer to prompt for name." |
| 9657 | () | 9658 | () |
| 9658 | > "begin" '(verilog-sk-prompt-name) \n | 9659 | > "begin" '(verilog-sk-prompt-name) \n |
| 9659 | > _ \n | 9660 | > _ \n |
| @@ -9661,7 +9662,7 @@ for sensitivity list." | |||
| 9661 | ) | 9662 | ) |
| 9662 | 9663 | ||
| 9663 | (define-skeleton verilog-sk-fork | 9664 | (define-skeleton verilog-sk-fork |
| 9664 | "Insert an fork join block." | 9665 | "Insert a fork join block." |
| 9665 | () | 9666 | () |
| 9666 | > "fork\n" | 9667 | > "fork\n" |
| 9667 | > "begin" \n | 9668 | > "begin" \n |
| @@ -9712,7 +9713,7 @@ and the case items." | |||
| 9712 | > "end" (progn (electric-verilog-terminate-line) nil)) | 9713 | > "end" (progn (electric-verilog-terminate-line) nil)) |
| 9713 | 9714 | ||
| 9714 | (define-skeleton verilog-sk-datadef | 9715 | (define-skeleton verilog-sk-datadef |
| 9715 | "Common routine to get data definition" | 9716 | "Common routine to get data definition." |
| 9716 | () | 9717 | () |
| 9717 | '(verilog-sk-prompt-width) | -1 ("name (RET to end):" str ", ") -2 ";" \n) | 9718 | '(verilog-sk-prompt-width) | -1 ("name (RET to end):" str ", ") -2 ";" \n) |
| 9718 | 9719 | ||
| @@ -9906,7 +9907,7 @@ Clicking on the middle-mouse button loads them in a buffer (as in dired)." | |||
| 9906 | 9907 | ||
| 9907 | 9908 | ||
| 9908 | (defun verilog-colorize-include-files-buffer () | 9909 | (defun verilog-colorize-include-files-buffer () |
| 9909 | "Colorize a include file." | 9910 | "Colorize an include file." |
| 9910 | (interactive) | 9911 | (interactive) |
| 9911 | ;; delete overlays | 9912 | ;; delete overlays |
| 9912 | (let ((overlays (overlays-in (point-min) (point-max)))) | 9913 | (let ((overlays (overlays-in (point-min) (point-max)))) |
| @@ -9919,14 +9920,14 @@ Clicking on the middle-mouse button loads them in a buffer (as in dired)." | |||
| 9919 | ;; remake overlays | 9920 | ;; remake overlays |
| 9920 | (verilog-colorize-include-files (point-min) (point-max) nil)) | 9921 | (verilog-colorize-include-files (point-min) (point-max) nil)) |
| 9921 | 9922 | ||
| 9922 | ;; ffap-at-mouse isn't useful for verilog mode. It uses library paths. | 9923 | ;; ffap-at-mouse isn't useful for Verilog mode. It uses library paths. |
| 9923 | ;; so define this function to do more or less the same as ffap-at-mouse | 9924 | ;; so define this function to do more or less the same as ffap-at-mouse |
| 9924 | ;; but first resolve filename... | 9925 | ;; but first resolve filename... |
| 9925 | (defun verilog-load-file-at-mouse (event) | 9926 | (defun verilog-load-file-at-mouse (event) |
| 9926 | "Load file under button 2 click's EVENT. | 9927 | "Load file under button 2 click's EVENT. |
| 9927 | Files are checked based on `verilog-library-directories'." | 9928 | Files are checked based on `verilog-library-directories'." |
| 9928 | (interactive "@e") | 9929 | (interactive "@e") |
| 9929 | (save-excursion ;; implement a verilog specific ffap-at-mouse | 9930 | (save-excursion ;; implement a Verilog specific ffap-at-mouse |
| 9930 | (mouse-set-point event) | 9931 | (mouse-set-point event) |
| 9931 | (beginning-of-line) | 9932 | (beginning-of-line) |
| 9932 | (if (looking-at verilog-include-file-regexp) | 9933 | (if (looking-at verilog-include-file-regexp) |
| @@ -9941,14 +9942,14 @@ Files are checked based on `verilog-library-directories'." | |||
| 9941 | "File '%s' isn't readable, use shift-mouse2 to paste in this field" | 9942 | "File '%s' isn't readable, use shift-mouse2 to paste in this field" |
| 9942 | (match-string 1))))))) | 9943 | (match-string 1))))))) |
| 9943 | 9944 | ||
| 9944 | ;; ffap isn't useable for verilog mode. It uses library paths. | 9945 | ;; ffap isn't useable for Verilog mode. It uses library paths. |
| 9945 | ;; so define this function to do more or less the same as ffap | 9946 | ;; so define this function to do more or less the same as ffap |
| 9946 | ;; but first resolve filename... | 9947 | ;; but first resolve filename... |
| 9947 | (defun verilog-load-file-at-point () | 9948 | (defun verilog-load-file-at-point () |
| 9948 | "Load file under point. | 9949 | "Load file under point. |
| 9949 | Files are checked based on `verilog-library-directories'." | 9950 | Files are checked based on `verilog-library-directories'." |
| 9950 | (interactive) | 9951 | (interactive) |
| 9951 | (save-excursion ;; implement a verilog specific ffap | 9952 | (save-excursion ;; implement a Verilog specific ffap |
| 9952 | (beginning-of-line) | 9953 | (beginning-of-line) |
| 9953 | (if (looking-at verilog-include-file-regexp) | 9954 | (if (looking-at verilog-include-file-regexp) |
| 9954 | (if (and | 9955 | (if (and |
| @@ -10044,7 +10045,7 @@ You may also want to look at the Verilog-Mode FAQ, see | |||
| 10044 | http://www.veripool.com/verilog-mode-faq.html. | 10045 | http://www.veripool.com/verilog-mode-faq.html. |
| 10045 | 10046 | ||
| 10046 | To reproduce the bug, start a fresh Emacs via " invocation-name " | 10047 | To reproduce the bug, start a fresh Emacs via " invocation-name " |
| 10047 | -no-init-file -no-site-file'. In a new buffer, in verilog mode, type | 10048 | -no-init-file -no-site-file'. In a new buffer, in Verilog mode, type |
| 10048 | the code included below. | 10049 | the code included below. |
| 10049 | 10050 | ||
| 10050 | Given those lines, I expected [[Fill in here]] to happen; | 10051 | Given those lines, I expected [[Fill in here]] to happen; |