Mercurial > emacs
changeset 79799:57956dd69d3f
(top-level): Fix spacing.
(verilog-mode-version, verilog-mode-release-date): Update version
number.
(verilog-mode-release-emacs): New variable.
(compile-command, reporter-prompt-for-summary-p): Define for byte
compiler.
(verilog-startup-message-lines)
(verilog-startup-message-displayed)
(verilog-display-startup-message): Remove.
(verilog-highlight-p1800-keywords): Improve docstring.
(sigs-in, sigs-out, got-sig, got-rvalue, uses-delayed)
(vector-skip-list): Only defvar at compile time.
(verilog-highlight-translate-off, verilog-indent-level)
(verilog-indent-level-module, verilog-indent-level-declaration)
(verilog-indent-declaration-macros, verilog-indent-lists)
(verilog-indent-level-behavioral)
(verilog-indent-level-directive, verilog-cexp-indent)
(verilog-case-indent, verilog-auto-newline)
(verilog-auto-indent-on-newline, verilog-tab-always-indent)
(verilog-tab-to-comment, verilog-indent-begin-after-if)
(verilog-align-ifelse, verilog-minimum-comment-distance)
(verilog-auto-lineup, verilog-highlight-p1800-keywords)
(verilog-auto-endcomments, verilog-auto-read-includes)
(verilog-auto-star-expand, verilog-auto-star-save)
(verilog-library-flags, verilog-library-directories)
(verilog-library-files, verilog-library-extensions)
(verilog-active-low-regexp, verilog-auto-sense-include-inputs)
(verilog-auto-sense-defines-constant, verilog-auto-reset-widths)
(verilog-assignment-delay, verilog-auto-inst-vector)
(verilog-auto-inst-template-numbers)
(verilog-auto-input-ignore-regexp)
(verilog-auto-inout-ignore-regexp)
(verilog-auto-output-ignore-regexp)
(verilog-auto-unused-ignore-regexp, verilog-typedef-regexp): Add
safe-local-variable properties.
(verilog-statement-menu, verilog-company)
(verilog-re-search-forward, verilog-re-search-backward)
(verilog-error-regexp-add, verilog-end-block-re)
(verilog-emacs-features, verilog-populate-syntax-table)
(verilog-setup-dual-comments, verilog-type-font-keywords)
(verilog-inside-comment-p, electric-verilog-backward-sexp)
(verilog-backward-sexp, verilog-forward-sexp)
(verilog-font-lock-init, verilog-mode)
(electric-verilog-terminate-line, electric-verilog-semi)
(electric-verilog-tab, verilog-insert-1, )
(verilog-insert-indices, verilog-generate-numbers)
(verilog-comment-region, verilog-label-be)
(verilog-beg-of-statement, verilog-in-case-region-p)
(verilog-in-struct-region-p, verilog-in-generate-region-p)
(verilog-in-fork-region-p, verilog-backward-case-item)
(verilog-set-auto-endcomments, verilog-get-expr)
(verilog-expand-vector-internal, verilog-surelint-off)
(verilog-batch-execute-func, verilog-calculate-indent)
(verilog-calc-1, verilog-calculate-indent-directive)
(verilog-leap-to-head, verilog-continued-line)
(verilog-backward-token, verilog-backward-syntactic-ws)
(verilog-forward-syntactic-ws, verilog-backward-ws&directives)
(verilog-forward-ws&directives, verilog-at-constraint-p)
(verilog-skip-backward-comments, verilog-indent-line-relative)
(verilog-do-indent, verilog-indent-comment)
(verilog-more-comment, verilog-pretty-declarations)
(verilog-pretty-expr, verilog-just-one-space)
(verilog-indent-declaration, verilog-get-completion-decl)
(verilog-goto-defun, verilog-showscopes, verilog-header)
(verilog-signals-combine-bus, verilog-read-decls)
(verilog-read-always-signals-recurse, verilog-read-instants)
(verilog-read-auto-template, verilog-set-define)
(verilog-read-defines, verilog-read-signals, verilog-getopt)
(verilog-is-number, verilog-expand-dirnames)
(verilog-modi-lookup, verilog-modi-cache-results)
(verilog-insert-one-definition, verilog-make-width-expression)
(verilog-delete-autos-lined, verilog-auto-save-check)
(verilog-auto-arg, verilog-auto-inst-port, verilog-auto-inst)
(verilog-auto-inst-param, verilog-auto-reg)
(verilog-auto-reg-input, verilog-auto-wire, )
(verilog-auto-output, verilog-auto-output-every)
(verilog-auto-input, verilog-auto-inout)
(verilog-auto-inout-module, verilog-auto-sense)
(verilog-auto-reset, verilog-auto-tieoff, verilog-auto-unused)
(verilog-auto-ascii-enum, verilog-auto)
(verilog-sk-define-signal, verilog-mode-mouse-map)
(verilog-load-file-at-mouse, verilog-load-file-at-point)
(verilog-library-files): Cleanup spacing of )'s they should not be
on unique lines. Fix checkdoc warnings.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Wed, 09 Jan 2008 06:30:58 +0000 |
parents | b56de37b6be4 |
children | 8cc70128affa |
files | lisp/ChangeLog lisp/progmodes/verilog-mode.el |
diffstat | 2 files changed, 441 insertions(+), 514 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Wed Jan 09 04:55:19 2008 +0000 +++ b/lisp/ChangeLog Wed Jan 09 06:30:58 2008 +0000 @@ -1,3 +1,90 @@ +2008-01-09 Wilson Snyder <wsnyder@wsnyder.org> + + * progmodes/verilog-mode.el (top-level): Fix spacing. + (verilog-mode-version, verilog-mode-release-date): Update version + number. + (verilog-mode-release-emacs): New variable. + (compile-command, reporter-prompt-for-summary-p): Define for byte + compiler. + (verilog-startup-message-lines) + (verilog-startup-message-displayed) + (verilog-display-startup-message): Remove. + (verilog-highlight-p1800-keywords): Improve docstring. + (sigs-in, sigs-out, got-sig, got-rvalue, uses-delayed) + (vector-skip-list): Only defvar at compile time. + (verilog-highlight-translate-off, verilog-indent-level) + (verilog-indent-level-module, verilog-indent-level-declaration) + (verilog-indent-declaration-macros, verilog-indent-lists) + (verilog-indent-level-behavioral) + (verilog-indent-level-directive, verilog-cexp-indent) + (verilog-case-indent, verilog-auto-newline) + (verilog-auto-indent-on-newline, verilog-tab-always-indent) + (verilog-tab-to-comment, verilog-indent-begin-after-if) + (verilog-align-ifelse, verilog-minimum-comment-distance) + (verilog-auto-lineup, verilog-highlight-p1800-keywords) + (verilog-auto-endcomments, verilog-auto-read-includes) + (verilog-auto-star-expand, verilog-auto-star-save) + (verilog-library-flags, verilog-library-directories) + (verilog-library-files, verilog-library-extensions) + (verilog-active-low-regexp, verilog-auto-sense-include-inputs) + (verilog-auto-sense-defines-constant, verilog-auto-reset-widths) + (verilog-assignment-delay, verilog-auto-inst-vector) + (verilog-auto-inst-template-numbers) + (verilog-auto-input-ignore-regexp) + (verilog-auto-inout-ignore-regexp) + (verilog-auto-output-ignore-regexp) + (verilog-auto-unused-ignore-regexp, verilog-typedef-regexp): Add + safe-local-variable properties. + (verilog-statement-menu, verilog-company) + (verilog-re-search-forward, verilog-re-search-backward) + (verilog-error-regexp-add, verilog-end-block-re) + (verilog-emacs-features, verilog-populate-syntax-table) + (verilog-setup-dual-comments, verilog-type-font-keywords) + (verilog-inside-comment-p, electric-verilog-backward-sexp) + (verilog-backward-sexp, verilog-forward-sexp) + (verilog-font-lock-init, verilog-mode) + (electric-verilog-terminate-line, electric-verilog-semi) + (electric-verilog-tab, verilog-insert-1, ) + (verilog-insert-indices, verilog-generate-numbers) + (verilog-comment-region, verilog-label-be) + (verilog-beg-of-statement, verilog-in-case-region-p) + (verilog-in-struct-region-p, verilog-in-generate-region-p) + (verilog-in-fork-region-p, verilog-backward-case-item) + (verilog-set-auto-endcomments, verilog-get-expr) + (verilog-expand-vector-internal, verilog-surelint-off) + (verilog-batch-execute-func, verilog-calculate-indent) + (verilog-calc-1, verilog-calculate-indent-directive) + (verilog-leap-to-head, verilog-continued-line) + (verilog-backward-token, verilog-backward-syntactic-ws) + (verilog-forward-syntactic-ws, verilog-backward-ws&directives) + (verilog-forward-ws&directives, verilog-at-constraint-p) + (verilog-skip-backward-comments, verilog-indent-line-relative) + (verilog-do-indent, verilog-indent-comment) + (verilog-more-comment, verilog-pretty-declarations) + (verilog-pretty-expr, verilog-just-one-space) + (verilog-indent-declaration, verilog-get-completion-decl) + (verilog-goto-defun, verilog-showscopes, verilog-header) + (verilog-signals-combine-bus, verilog-read-decls) + (verilog-read-always-signals-recurse, verilog-read-instants) + (verilog-read-auto-template, verilog-set-define) + (verilog-read-defines, verilog-read-signals, verilog-getopt) + (verilog-is-number, verilog-expand-dirnames) + (verilog-modi-lookup, verilog-modi-cache-results) + (verilog-insert-one-definition, verilog-make-width-expression) + (verilog-delete-autos-lined, verilog-auto-save-check) + (verilog-auto-arg, verilog-auto-inst-port, verilog-auto-inst) + (verilog-auto-inst-param, verilog-auto-reg) + (verilog-auto-reg-input, verilog-auto-wire, ) + (verilog-auto-output, verilog-auto-output-every) + (verilog-auto-input, verilog-auto-inout) + (verilog-auto-inout-module, verilog-auto-sense) + (verilog-auto-reset, verilog-auto-tieoff, verilog-auto-unused) + (verilog-auto-ascii-enum, verilog-auto) + (verilog-sk-define-signal, verilog-mode-mouse-map) + (verilog-load-file-at-mouse, verilog-load-file-at-point) + (verilog-library-files): Cleanup spacing of )'s they should not be + on unique lines. Fix checkdoc warnings. + 2008-01-09 Glenn Morris <rgm@gnu.org> * ffap.el (ffap-string-at-point-mode-alist): Add `\' to file
--- a/lisp/progmodes/verilog-mode.el Wed Jan 09 04:55:19 2008 +0000 +++ b/lisp/progmodes/verilog-mode.el Wed Jan 09 06:30:58 2008 +0000 @@ -11,6 +11,12 @@ ;; http://www.veripool.com ;; Keywords: languages +;; This code supports Emacs 21.1 and later +;; And XEmacs 21.1 and later +;; Please do not make changes that break Emacs 21. Thanks! +;; +;; + ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify @@ -30,12 +36,12 @@ ;;; Commentary: -;; This mode borrows heavily from the Pascal-mode and the cc-mode of emacs +;; This mode borrows heavily from the Pascal-mode and the cc-mode of Emacs ;; USAGE ;; ===== -;; A major mode for editing Verilog HDL source code. When you have +;; A major mode for editing Verilog HDL source code. When you have ;; entered Verilog mode, you may get more info by pressing C-h m. You ;; may also get online help describing various functions by: C-h f ;; <Name of function you want described> @@ -44,8 +50,8 @@ ;; ======================= ;; Verilog is a rapidly evolving language, and hence this mode is -;; under continuous development. Hence this is beta code, and likely -;; has bugs. Please report any and all bugs to me at mac@verilog.com. +;; under continuous development. Hence this is beta code, and likely +;; has bugs. Please report any and all bugs to me at mac@verilog.com. ;; Please use verilog-submit-bug-report to submit a report; type C-c ;; C-b to invoke this and as a result I will have a much easier time ;; of reproducing the bug you find, and hence fixing it. @@ -55,7 +61,7 @@ ;; An older version of this mode may be already installed as a part of ;; your environment, and one method of updating would be to update -;; your emacs environment. Sometimes this is difficult for local +;; your Emacs environment. Sometimes this is difficult for local ;; political/control reasons, and hence you can always install a ;; private copy (or even a shared copy) which overrides the system ;; default. @@ -74,7 +80,7 @@ ;; If you want to customize Verilog mode to fit your needs better, ;; you may add these lines (the values of the variables presented -;; here are the defaults). Note also that if you use an emacs that +;; here are the defaults). Note also that if you use an Emacs that ;; supports custom, it's probably better to use the custom menu to ;; edit these. ;; @@ -102,15 +108,19 @@ ;; ;;; History: -;; -;; +;; +;; See commit history at http://www.veripool.com/verilog-mode.html +;; (This section is required to appease checkdoc.) + ;;; Code: ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "377" +(defconst verilog-mode-version "383" "Version of this verilog mode.") -(defconst verilog-mode-release-date "2007-12-07" - "Version of this verilog mode.") +(defconst verilog-mode-release-date "2008-01-07-GNU" + "Release date of this verilog mode.") +(defconst verilog-mode-release-emacs t + "If non-nil, this version of verilog mode was released with Emacs itself.") (defun verilog-version () "Inform caller of the version of this file." @@ -118,7 +128,10 @@ (message "Using verilog-mode version %s" verilog-mode-version)) ;; Insure we have certain packages, and deal with it if we don't +;; Be sure to note which Emacs flavor and version added each feature. (eval-when-compile + ;; The below were disabled when GNU Emacs 22 was released; + ;; perhaps some still need to be there to support Emacs 21. (when (featurep 'xemacs) (condition-case nil (require 'easymenu) @@ -181,8 +194,8 @@ result) (buffer-substring-no-properties (match-beginning num) (match-end num) - (current-buffer) - ))))) + (current-buffer))))) + ) (error nil)) (if (and (featurep 'custom) (fboundp 'custom-declare-variable)) nil ;; We've got what we needed @@ -210,6 +223,8 @@ ;; Provide a regular expression optimization routine, using regexp-opt ;; if provided by the user's elisp libraries (eval-and-compile + ;; The below were disabled when GNU Emacs 22 was released; + ;; perhaps some still need to be there to support Emacs 21. (if (featurep 'xemacs) (if (fboundp 'regexp-opt) ;; regexp-opt is defined, does it take 3 or 2 arguments? @@ -222,8 +237,7 @@ (defun verilog-regexp-opt (a b) "Deal with differing number of required arguments for `regexp-opt'. Call 'regexp-opt' on A and B." - (regexp-opt a b 't) - ) + (regexp-opt a b 't)) (error nil)) ) ((eq args 2) ;; It takes 2 @@ -290,6 +304,7 @@ you to the next lint error." :type 'string :group 'verilog-mode-actions) +;; We don't mark it safe, as it's used as a shell command (defcustom verilog-coverage "echo 'No verilog-coverage set, see \"M-x describe-variable verilog-coverage\"'" @@ -299,6 +314,7 @@ you to the next lint error." :type 'string :group 'verilog-mode-actions) +;; We don't mark it safe, as it's used as a shell command (defcustom verilog-simulator "echo 'No verilog-simulator set, see \"M-x describe-variable verilog-simulator\"'" @@ -308,6 +324,7 @@ you to the next lint error." :type 'string :group 'verilog-mode-actions) +;; We don't mark it safe, as it's used as a shell command (defcustom verilog-compiler "echo 'No verilog-compiler set, see \"M-x describe-variable verilog-compiler\"'" @@ -317,6 +334,7 @@ you to the next lint error." :type 'string :group 'verilog-mode-actions) +;; We don't mark it safe, as it's used as a shell command (defvar verilog-tool 'verilog-linter "Which tool to use for building compiler-command. @@ -336,11 +354,14 @@ entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." :type 'boolean :group 'verilog-mode-indent) +;; Note we don't use :safe, as that would break on Emacsen before 22.0. +(put 'verilog-highlight-translate-off 'safe-local-variable 'booleanp) (defcustom verilog-indent-level 3 "*Indentation of Verilog statements with respect to containing block." :group 'verilog-mode-indent :type 'integer) +(put 'verilog-indent-level 'safe-local-variable 'integerp) (defcustom verilog-indent-level-module 3 "*Indentation of Module level Verilog statements. (eg always, initial) @@ -348,12 +369,14 @@ your screen." :group 'verilog-mode-indent :type 'integer) +(put 'verilog-indent-level-module 'safe-local-variable 'integerp) (defcustom verilog-indent-level-declaration 3 "*Indentation of declarations with respect to containing block. Set to 0 to get them list right under containing block." :group 'verilog-mode-indent :type 'integer) +(put 'verilog-indent-level-declaration 'safe-local-variable 'integerp) (defcustom verilog-indent-declaration-macros nil "*How to treat macro expansions in a declaration. @@ -367,6 +390,7 @@ output c;" :group 'verilog-mode-indent :type 'boolean) +(put 'verilog-indent-declaration-macros 'safe-local-variable 'booleanp) (defcustom verilog-indent-lists t "*How to treat indenting items in a list. @@ -379,62 +403,73 @@ reset ) begin" :group 'verilog-mode-indent :type 'boolean) +(put 'verilog-indent-lists 'safe-local-variable 'booleanp) (defcustom verilog-indent-level-behavioral 3 "*Absolute indentation of first begin in a task or function block. Set to 0 to get such code to start at the left side of the screen." :group 'verilog-mode-indent :type 'integer) +(put 'verilog-indent-level-behavioral 'safe-local-variable 'integerp) (defcustom verilog-indent-level-directive 1 "*Indentation to add to each level of `ifdef declarations. Set to 0 to have all directives start at the left side of the screen." :group 'verilog-mode-indent :type 'integer) +(put 'verilog-indent-level-directive 'safe-local-variable 'integerp) (defcustom verilog-cexp-indent 2 "*Indentation of Verilog statements split across lines." :group 'verilog-mode-indent :type 'integer) +(put 'verilog-cexp-indent 'safe-local-variable 'integerp) (defcustom verilog-case-indent 2 "*Indentation for case statements." :group 'verilog-mode-indent :type 'integer) +(put 'verilog-case-indent 'safe-local-variable 'integerp) (defcustom verilog-auto-newline t "*True means automatically newline after semicolons." :group 'verilog-mode-indent :type 'boolean) +(put 'verilog-auto-newline 'safe-local-variable 'booleanp) (defcustom verilog-auto-indent-on-newline t "*True means automatically indent line after newline." :group 'verilog-mode-indent :type 'boolean) +(put 'verilog-auto-indent-on-newline 'safe-local-variable 'booleanp) (defcustom verilog-tab-always-indent t "*True means TAB should always re-indent the current line. Nil means TAB will only reindent when at the beginning of the line." :group 'verilog-mode-indent :type 'boolean) +(put 'verilog-tab-always-indent 'safe-local-variable 'booleanp) (defcustom verilog-tab-to-comment nil "*True means TAB moves to the right hand column in preparation for a comment." :group 'verilog-mode-actions :type 'boolean) +(put 'verilog-tab-to-comment 'safe-local-variable 'booleanp) (defcustom verilog-indent-begin-after-if t "*If true, indent begin statements following if, else, while, for and repeat. Otherwise, line them up." :group 'verilog-mode-indent - :type 'boolean ) + :type 'boolean) +(put 'verilog-indent-begin-after-if 'safe-local-variable 'booleanp) (defcustom verilog-align-ifelse nil "*If true, align `else' under matching `if'. Otherwise else is lined up with first character on line holding matching if." :group 'verilog-mode-indent - :type 'boolean ) + :type 'boolean) +(put 'verilog-align-ifelse 'safe-local-variable 'booleanp) (defcustom verilog-minimum-comment-distance 10 "*Minimum distance (in lines) between begin and end required before a comment. @@ -442,6 +477,7 @@ default avoids too many redundant comments in tight quarters" :group 'verilog-mode-indent :type 'integer) +(put 'verilog-minimum-comment-distance 'safe-local-variable 'integerp) (defcustom verilog-auto-lineup '(declaration) "*Algorithm for lining up statements on multiple lines. @@ -481,23 +517,26 @@ ; :group 'verilog-mode-indent - :type 'list ) + :type 'list) +(put 'verilog-auto-lineup 'safe-local-variable 'listp) (defcustom verilog-highlight-p1800-keywords nil - "*If true highlight words newly reserved by IEEE-1800 in -verilog-font-lock-p1800-face in order to gently suggest changing where -these words are used as variables to something else. Nil means highlight -these words as appropriate for the SystemVerilog IEEE-1800 standard. Note -that changing this will require restarting emacs to see the effect as font -color choices are cached by emacs" + "*True means highlight words newly reserved by IEEE-1800. +These will appear in `verilog-font-lock-p1800-face' in order to gently +suggest changing where these words are used as variables to something else. +Nil means highlight these words as appropriate for the SystemVerilog +IEEE-1800 standard. Note that changing this will require restarting Emacs +to see the effect as font color choices are cached by Emacs" :group 'verilog-mode-indent :type 'boolean) +(put 'verilog-highlight-p1800-keywords 'safe-local-variable 'booleanp) (defcustom verilog-auto-endcomments t "*True means insert a comment /* ... */ after 'end's. The name of the function or case will be set between the braces." :group 'verilog-mode-actions - :type 'boolean ) + :type 'boolean) +(put 'verilog-auto-endcomments 'safe-local-variable 'booleanp) (defcustom verilog-auto-read-includes nil "*True means to automatically read includes before AUTOs. @@ -506,7 +545,8 @@ but can result in very slow reading times if there are many or large include files." :group 'verilog-mode-actions - :type 'boolean ) + :type 'boolean) +(put 'verilog-auto-read-includes 'safe-local-variable 'booleanp) (defcustom verilog-auto-save-policy nil "*Non-nil indicates action to take when saving a Verilog buffer with AUTOs. @@ -527,6 +567,7 @@ instantiation. See also `verilog-auto-star' and `verilog-auto-star-save'." :group 'verilog-mode-actions :type 'boolean) +(put 'verilog-auto-star-expand 'safe-local-variable 'booleanp) (defcustom verilog-auto-star-save nil "*Non-nil indicates to save to disk SystemVerilog .* instance expansions. @@ -537,6 +578,7 @@ always be saved." :group 'verilog-mode-actions :type 'boolean) +(put 'verilog-auto-star-save 'safe-local-variable 'booleanp) (defvar verilog-auto-update-tick nil "Modification tick at which autos were last performed.") @@ -624,8 +666,7 @@ ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 bold t) ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 2 bold t) ) - "*Keywords to also highlight in Verilog *compilation* buffers." - ) + "*Keywords to also highlight in Verilog *compilation* buffers.") (defcustom verilog-library-flags '("") "*List of standard Verilog arguments to use for /*AUTOINST*/. @@ -656,6 +697,7 @@ See also the variables mentioned above." :group 'verilog-mode-auto :type '(repeat string)) +(put 'verilog-library-flags 'safe-local-variable 'listp) (defcustom verilog-library-directories '(".") "*List of directories when looking for files for /*AUTOINST*/. @@ -678,9 +720,11 @@ and `verilog-library-extensions'." :group 'verilog-mode-auto :type '(repeat file)) +(put 'verilog-library-directories 'safe-local-variable 'listp) (defcustom verilog-library-files '() - "*List of files to search for modules when looking for AUTOINST files. + "*List of files to search for modules. +AUTOINST will use this when it needs to resolve a module name. This is a complete path, usually to a technology file with many standard cells defined in it. @@ -698,12 +742,14 @@ See also `verilog-library-flags', `verilog-library-directories'." :group 'verilog-mode-auto :type '(repeat directory)) +(put 'verilog-library-files 'safe-local-variable 'listp) (defcustom verilog-library-extensions '(".v") "*List of extensions to use when looking for files for /*AUTOINST*/. See also `verilog-library-flags', `verilog-library-directories'." :type '(repeat string) :group 'verilog-mode-auto) +(put 'verilog-library-extensions 'safe-local-variable 'listp) (defcustom verilog-active-low-regexp nil "*If set, treat signals matching this regexp as active low. @@ -711,21 +757,24 @@ you will probably also need `verilog-auto-reset-widths' set." :group 'verilog-mode-auto :type 'string) +(put 'verilog-active-low-regexp 'safe-local-variable 'stringp) (defcustom verilog-auto-sense-include-inputs nil "*If true, AUTOSENSE should include all inputs. If nil, only inputs that are NOT output signals in the same block are included." - :type 'boolean - :group 'verilog-mode-auto) + :group 'verilog-mode-auto + :type 'boolean) +(put 'verilog-auto-sense-include-inputs 'safe-local-variable 'booleanp) (defcustom verilog-auto-sense-defines-constant nil "*If true, AUTOSENSE should assume all defines represent constants. When true, the defines will not be included in sensitivity lists. To maintain compatibility with other sites, this should be set at the bottom of each verilog file that requires it, rather than being set globally." - :type 'boolean - :group 'verilog-mode-auto) + :group 'verilog-mode-auto + :type 'boolean) +(put 'verilog-auto-sense-defines-constant 'safe-local-variable 'booleanp) (defcustom verilog-auto-reset-widths t "*If true, AUTORESET should determine the width of signals. @@ -735,11 +784,13 @@ the MSB or LSB of a signal inside a AUTORESET." :type 'boolean :group 'verilog-mode-auto) +(put 'verilog-auto-reset-widths 'safe-local-variable 'booleanp) (defcustom verilog-assignment-delay "" "*Text used for delays in delayed assignments. Add a trailing space if set." - :type 'string - :group 'verilog-mode-auto) + :group 'verilog-mode-auto + :type 'string) +(put 'verilog-assignment-delay 'safe-local-variable 'stringp) (defcustom verilog-auto-inst-vector t "*If true, when creating default ports with AUTOINST, use bus subscripts. @@ -748,7 +799,8 @@ declare the wire to have the subscripts removed.) Nil may speed up some simulators, but is less general and harder to read, so avoid." :group 'verilog-mode-auto - :type 'boolean ) + :type 'boolean) +(put 'verilog-auto-inst-vector 'safe-local-variable 'booleanp) (defcustom verilog-auto-inst-template-numbers nil "*If true, when creating templated ports with AUTOINST, add a comment. @@ -756,7 +808,8 @@ port declaration. Setting this aids in debugging, but nil is suggested for regular use to prevent large numbers of merge conflicts." :group 'verilog-mode-auto - :type 'boolean ) + :type 'boolean) +(put 'verilog-auto-inst-template-numbers 'safe-local-variable 'booleanp) (defvar verilog-auto-inst-column 40 "Column number for first part of auto-inst.") @@ -765,31 +818,36 @@ "*If set, when creating AUTOINPUT list, ignore signals matching this regexp. See the \\[verilog-faq] for examples on using this." :group 'verilog-mode-auto - :type 'string ) + :type 'string) +(put 'verilog-auto-input-ignore-regexp 'safe-local-variable 'stringp) (defcustom verilog-auto-inout-ignore-regexp nil "*If set, when creating AUTOINOUT list, ignore signals matching this regexp. See the \\[verilog-faq] for examples on using this." :group 'verilog-mode-auto - :type 'string ) + :type 'string) +(put 'verilog-auto-inout-ignore-regexp 'safe-local-variable 'stringp) (defcustom verilog-auto-output-ignore-regexp nil "*If set, when creating AUTOOUTPUT list, ignore signals matching this regexp. See the \\[verilog-faq] for examples on using this." :group 'verilog-mode-auto - :type 'string ) + :type 'string) +(put 'verilog-auto-output-ignore-regexp 'safe-local-variable 'stringp) (defcustom verilog-auto-unused-ignore-regexp nil "*If set, when creating AUTOUNUSED list, ignore signals matching this regexp. See the \\[verilog-faq] for examples on using this." :group 'verilog-mode-auto - :type 'string ) + :type 'string) +(put 'verilog-auto-unused-ignore-regexp 'safe-local-variable 'stringp) (defcustom verilog-typedef-regexp nil "*If non-nil, regular expression that matches Verilog-2001 typedef names. For example, \"_t$\" matches typedefs named with _t, as in the C language." :group 'verilog-mode-auto - :type 'string ) + :type 'string) +(put 'verilog-typedef-regexp 'safe-local-variable 'stringp) (defcustom verilog-mode-hook 'verilog-set-compile-command "*Hook (List of functions) run after verilog mode is loaded." @@ -798,33 +856,33 @@ (defcustom verilog-auto-hook nil "*Hook run after `verilog-mode' updates AUTOs." - :type 'hook - :group 'verilog-mode-auto) + :group 'verilog-mode-auto + :type 'hook) (defcustom verilog-before-auto-hook nil "*Hook run before `verilog-mode' updates AUTOs." - :type 'hook - :group 'verilog-mode-auto) + :group 'verilog-mode-auto + :type 'hook) (defcustom verilog-delete-auto-hook nil "*Hook run after `verilog-mode' deletes AUTOs." - :type 'hook - :group 'verilog-mode-auto) + :group 'verilog-mode-auto + :type 'hook) (defcustom verilog-before-delete-auto-hook nil "*Hook run before `verilog-mode' deletes AUTOs." - :type 'hook - :group 'verilog-mode-auto) + :group 'verilog-mode-auto + :type 'hook) (defcustom verilog-getopt-flags-hook nil "*Hook run after `verilog-getopt-flags' determines the Verilog option lists." - :type 'hook - :group 'verilog-mode-auto) + :group 'verilog-mode-auto + :type 'hook) (defcustom verilog-before-getopt-flags-hook nil "*Hook run before `verilog-getopt-flags' determines the Verilog option lists." - :type 'hook - :group 'verilog-mode-auto) + :group 'verilog-mode-auto + :type 'hook) (defvar verilog-imenu-generic-expression '((nil "^\\s-*\\(\\(m\\(odule\\|acromodule\\)\\)\\|primitive\\)\\s-+\\([a-zA-Z0-9_.:]+\\)" 4) @@ -843,13 +901,11 @@ (defvar verilog-company nil "*Default name of Company for verilog header. If set will become buffer local.") - (make-variable-buffer-local 'verilog-company) (defvar verilog-project nil "*Default name of Project for verilog header. If set will become buffer local.") - (make-variable-buffer-local 'verilog-project) (defvar verilog-mode-map @@ -1025,8 +1081,7 @@ ["Casex" verilog-sk-casex t] ["Casez" verilog-sk-casez t] ) - "Menu for statement templates in Verilog." - ) + "Menu for statement templates in Verilog.") (easy-menu-define verilog-menu verilog-mode-map "Menu for Verilog mode" verilog-xemacs-menu) @@ -1072,8 +1127,7 @@ (store-match-data '(nil nil)) (if BOUND (< (point) BOUND) - t) - )))) + t))))) (match-end 0)) (defsubst verilog-re-search-backward (REGEXP BOUND NOERROR) @@ -1087,8 +1141,7 @@ (store-match-data '(nil nil)) (if BOUND (> (point) BOUND) - t) - )))) + t))))) (match-end 0)) (defsubst verilog-re-search-forward-quick (regexp bound noerror) @@ -1130,6 +1183,8 @@ (save-excursion (nth 3 (parse-partial-sexp (verilog-get-beg-of-line) (point))))) +(defvar compile-command) + ;; compilation program (defun verilog-set-compile-command () "Function to compute shell command to compile verilog. @@ -1201,8 +1256,7 @@ (setq compilation-error-regexp-alist (default-value 'compilation-error-regexp-alist)) (set (make-local-variable 'compilation-error-regexp-alist) - (default-value 'compilation-error-regexp-alist)) - ))) + (default-value 'compilation-error-regexp-alist))))) (add-hook 'compilation-mode-hook 'verilog-error-regexp-add) @@ -1330,8 +1384,7 @@ "endprogram" "endsequence" "endclocking" - ) - ))) + )))) (defconst verilog-endcomment-reason-re @@ -1667,11 +1720,11 @@ (and (or (not major) (not minor)) (string-match "\\([0-9]+\\).\\([0-9]+\\)" emacs-version) (setq major (string-to-number (substring emacs-version - (match-beginning 1) - (match-end 1))) + (match-beginning 1) + (match-end 1))) minor (string-to-number (substring emacs-version - (match-beginning 2) - (match-end 2))))) + (match-beginning 2) + (match-end 2))))) (if (not (and major minor)) (error "Cannot figure out the major and minor version numbers")) ;; calculate the major version @@ -1706,8 +1759,7 @@ ;; Emacs 19.30 and beyond are known to be 1-bit ((eq flavor 'FSF) (setq comments '1-bit)) ;; Don't know what this is - (t (error "Couldn't figure out syntax table format")) - )) + (t (error "Couldn't figure out syntax table format")))) ;; Emacs 18 has no support for dual comments (setq comments 'no-dual-comments)) ;; determine whether to use old or new font lock syntax @@ -1724,8 +1776,7 @@ ;; Emacs before 19.6 had bugs (and (eq major 'v19) (eq flavor 'XEmacs) (< minor 6)) ;; Emacs 19 before 19.21 has known bugs - (and (eq major 'v19) (eq flavor 'FSF) (< minor 21)) - ) + (and (eq major 'v19) (eq flavor 'FSF) (< minor 21))) (with-output-to-temp-buffer "*verilog-mode warnings*" (print (format "The version of Emacs that you are running, %s, @@ -1785,8 +1836,7 @@ (modify-syntax-entry ?| "." table) (modify-syntax-entry ?` "w" table) (modify-syntax-entry ?_ "w" table) - (modify-syntax-entry ?\' "." table) -) + (modify-syntax-entry ?\' "." table)) (defun verilog-setup-dual-comments (table) "Set up TABLE to handle block and line style comments." @@ -1795,15 +1845,12 @@ ;; XEmacs (formerly Lucid) has the best implementation (modify-syntax-entry ?/ ". 1456" table) (modify-syntax-entry ?* ". 23" table) - (modify-syntax-entry ?\n "> b" table) - ) + (modify-syntax-entry ?\n "> b" table)) ((memq '1-bit verilog-emacs-features) ;; Emacs 19 does things differently, but we can work with it (modify-syntax-entry ?/ ". 124b" table) (modify-syntax-entry ?* ". 23" table) - (modify-syntax-entry ?\n "> b" table) - ) - )) + (modify-syntax-entry ?\n "> b" table)))) (defvar verilog-mode-syntax-table nil "Syntax table used in `verilog-mode' buffers.") @@ -1961,8 +2008,7 @@ 'font-lock-type-face)) ;; Fontify Verilog-AMS keywords (cons (concat "\\<\\(" verilog-ams-keywords "\\)\\>") - 'verilog-font-lock-ams-face) - )) + 'verilog-font-lock-ams-face))) (setq verilog-font-lock-keywords-1 (append verilog-font-lock-keywords @@ -1976,15 +2022,12 @@ (list (concat "\\<function\\>\\s-+\\(integer\\|real\\(time\\)?\\|time\\)\\s-+\\(\\sw+\\)" ) '(1 font-lock-keyword-face) - '(3 font-lock-reference-face prepend) - ) + '(3 font-lock-reference-face prepend)) '("\\<function\\>\\s-+\\(\\[[^]]+\\]\\)\\s-+\\(\\sw+\\)" (1 font-lock-keyword-face) - (2 font-lock-reference-face append) - ) + (2 font-lock-reference-face append)) '("\\<function\\>\\s-+\\(\\sw+\\)" - 1 'font-lock-reference-face append) - ))) + 1 'font-lock-reference-face append)))) (setq verilog-font-lock-keywords-2 (append verilog-font-lock-keywords-1 @@ -2002,7 +2045,6 @@ 0 font-lock-type-face append) ;; Fontify instantiation names '("\\([A-Za-z][A-Za-z0-9_]+\\)\\s-*(" 1 font-lock-function-name-face) - ))) (setq verilog-font-lock-keywords-3 @@ -2015,15 +2057,14 @@ ))))) - (defun verilog-inside-comment-p () "Check if point inside a nested comment." (save-excursion (let ((st-point (point)) hitbeg) (or (search-backward "//" (verilog-get-beg-of-line) t) (if (progn - ;; This is for tricky case //*, we keep searching if /* is - ;; proceeded by // on same line. + ;; This is for tricky case //*, we keep searching if /* + ;; is proceeded by // on same line. (while (and (setq hitbeg (search-backward "/*" nil t)) (progn @@ -2048,14 +2089,14 @@ "Move backward over a sexp." (interactive) ;; before that see if we are in a comment - (verilog-backward-sexp) -) + (verilog-backward-sexp)) + (defun electric-verilog-forward-sexp () "Move backward over a sexp." (interactive) ;; before that see if we are in a comment - (verilog-forward-sexp) -) + (verilog-forward-sexp)) + ;;;used by hs-minor-mode (defun verilog-forward-sexp-function (arg) (if (< arg 0) @@ -2067,19 +2108,16 @@ (let ((reg) (elsec 1) (found nil) - (st (point)) - ) + (st (point))) (if (not (looking-at "\\<")) (forward-word -1)) (cond - ((verilog-skip-backward-comment-or-string) - ) + ((verilog-skip-backward-comment-or-string)) ((looking-at "\\<else\\>") (setq reg (concat verilog-end-block-re "\\|\\(\\<else\\>\\)" - "\\|\\(\\<if\\>\\)" - )) + "\\|\\(\\<if\\>\\)")) (while (and (not found) (verilog-re-search-backward reg nil 'move)) (cond @@ -2094,11 +2132,7 @@ (setq elsec (1- elsec)) (if (= 0 elsec) ;; Now previous line describes syntax - (setq found 't) - )) - ) - ) - ) + (setq found 't)))))) ((looking-at verilog-end-block-re) (verilog-leap-to-head)) ((looking-at "\\(endmodule\\>\\)\\|\\(\\<endprimitive\\>\\)\\|\\(\\<endclass\\>\\)\\|\\(\\<endprogram\\>\\)\\|\\(\\<endinterface\\>\\)\\|\\(\\<endpackage\\>\\)") @@ -2120,9 +2154,7 @@ (backward-sexp 1)))) (t (goto-char st) - (backward-sexp)) - ) ;; cond - )) + (backward-sexp))))) (defun verilog-forward-sexp () (let ((reg) @@ -2132,8 +2164,7 @@ (forward-word -1)) (cond ((verilog-skip-forward-comment-or-string) - (verilog-forward-syntactic-ws) - ) + (verilog-forward-syntactic-ws)) ((looking-at verilog-beg-block-re-ordered);; begin|case|fork|class|table|specify|function|task|generate|covergroup|property|sequence|clocking (cond ((match-end 1) ; end @@ -2141,8 +2172,7 @@ (setq reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)" )) ((match-end 2) ; endcase ;; Search forward for matching case - (setq reg "\\(\\<randcase\\>\\|\\(\\<unique\\>\\s-+\\|\\<priority\\>\\s-+\\)?\\<case[xz]?\\>[^:]\\)\\|\\(\\<endcase\\>\\)" ) - ) + (setq reg "\\(\\<randcase\\>\\|\\(\\<unique\\>\\s-+\\|\\<priority\\>\\s-+\\)?\\<case[xz]?\\>[^:]\\)\\|\\(\\<endcase\\>\\)" )) ((match-end 3) ; join ;; Search forward for matching fork (setq reg "\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" )) @@ -2173,12 +2203,10 @@ ((match-end 12) ; endsequence ;; Search forward for matching sequence (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" ) - (setq md 3) ; 3 to get to endsequence in the reg above - ) + (setq md 3)) ; 3 to get to endsequence in the reg above ((match-end 13) ; endclocking ;; Search forward for matching clocking - (setq reg "\\(\\<clocking\\>\\)\\|\\(\\<endclocking\\>\\)" )) - ) + (setq reg "\\(\\<clocking\\>\\)\\|\\(\\<endclocking\\>\\)" ))) (if (forward-word 1) (catch 'skip (let ((nest 1)) @@ -2189,9 +2217,7 @@ (if (= 0 nest) ; we are out! (throw 'skip 1))) ((match-end 1) ; the opener in reg, so we are deeper now - (setq nest (1+ nest))))) - ))) - ) + (setq nest (1+ nest))))))))) ((looking-at (concat "\\(\\<\\(macro\\)?module\\>\\)\\|" "\\(\\<primitive\\>\\)\\|" @@ -2221,9 +2247,7 @@ (goto-char st) (if (= (following-char) ?\) ) (forward-char 1) - (forward-sexp 1))) - ) ;; cond - )) + (forward-sexp 1)))))) (defun verilog-declaration-beg () (verilog-re-search-backward verilog-declaration-re (bobp) t)) @@ -2238,8 +2262,7 @@ (list ;; Fontify things in translate off regions '(verilog-match-translate-off - (0 'verilog-font-lock-translate-off-face prepend)) - )))) + (0 'verilog-font-lock-translate-off-face prepend)))))) (put 'verilog-mode 'font-lock-defaults '((verilog-font-lock-keywords verilog-font-lock-keywords-1 @@ -2253,23 +2276,7 @@ ;; initialize fontification for Verilog Mode (verilog-font-lock-init) -;; start up message -(defconst verilog-startup-message-lines - '("Please use \\[verilog-submit-bug-report] to report bugs." - "Visit http://www.verilog.com to check for updates" - )) -(defvar verilog-startup-message-displayed t) -(defun verilog-display-startup-message () - (if (not verilog-startup-message-displayed) - (if (sit-for 5) - (let ((lines verilog-startup-message-lines)) - (message "verilog-mode version %s, released %s; type \\[describe-mode] for help" - verilog-mode-version verilog-mode-release-date) - (setq verilog-startup-message-displayed t) - (while (and (sit-for 4) lines) - (message (substitute-command-keys (car lines))) - (setq lines (cdr lines))))) - (message ""))) + ;; ;; ;; Mode @@ -2411,9 +2418,9 @@ (setq local-abbrev-table verilog-mode-abbrev-table) (setq verilog-mode-syntax-table (make-syntax-table)) (verilog-populate-syntax-table verilog-mode-syntax-table) - (set (make-local-variable 'beginning-of-defun-function) + (set (make-local-variable 'beginning-of-defun-function) 'verilog-beg-of-defun) - (set (make-local-variable 'end-of-defun-function) + (set (make-local-variable 'end-of-defun-function) 'verilog-end-of-defun) ;; add extra comment syntax (verilog-setup-dual-comments verilog-mode-syntax-table) @@ -2444,8 +2451,8 @@ (not (assoc "Verilog" current-menubar))) ;; (set-buffer-menubar (copy-sequence current-menubar)) (add-submenu nil verilog-xemacs-menu) - (add-submenu nil verilog-stmt-menu) - )) + (add-submenu nil verilog-stmt-menu))) + ;; Stuff for GNU emacs (set (make-local-variable 'font-lock-defaults) '((verilog-font-lock-keywords verilog-font-lock-keywords-1 @@ -2472,8 +2479,6 @@ (cons '(verilog-mode-mode "\\<begin\\>" "\\<end\\>" nil verilog-forward-sexp-function) hs-special-modes-alist))) - ;; Display version splash information. - (verilog-display-startup-message) ;; Stuff for autos (add-hook 'write-contents-hooks 'verilog-auto-save-check) ; already local @@ -2527,27 +2532,19 @@ (progn (end-of-line) (delete-horizontal-space) - 't - ) - ) - ) + 't))) ;; see if we should line up assignments (progn (if (or (memq 'all verilog-auto-lineup) (memq 'assignments verilog-auto-lineup)) - (verilog-pretty-expr) - ) - (newline) - ) - (forward-line 1) - ) + (verilog-pretty-expr)) + (newline)) + (forward-line 1)) ;; Indent next line (if verilog-auto-indent-on-newline - (verilog-indent-line)) - ) + (verilog-indent-line))) (t - (newline)) - ))) + (newline))))) (defun electric-verilog-terminate-and-indent () "Insert a newline and indent for the next statement." @@ -2565,8 +2562,7 @@ (save-excursion (beginning-of-line) (verilog-forward-ws&directives) - (verilog-indent-line) - ) + (verilog-indent-line)) (if (and verilog-auto-newline (not (verilog-parenthesis-depth))) (electric-verilog-terminate-line)))) @@ -2648,9 +2644,7 @@ (re-search-forward comment-start-skip oldpnt 'move) (goto-char (match-beginning 0)) (skip-chars-backward " \t") - (kill-region (point) oldpnt) - )))) - ) + (kill-region (point) oldpnt)))))) (progn (insert "\t")))) @@ -2690,7 +2684,7 @@ (insert " * ")) (defun verilog-insert-1 (fmt max) - "Insert integers 0 to MAX-1 according to format string FMT. + "Use format string FMT to insert integers 0 to MAX - 1. Inserts one integer per line, at the current column. Stops early if it reaches the end of the buffer." (let ((col (current-column)) @@ -2724,7 +2718,7 @@ a = b a[ 7] = b a = b a[ 8] = b" - (interactive "NMAX? ") + (interactive "NMAX: ") (verilog-insert-1 "[%3d]" max)) (defun verilog-generate-numbers (max) @@ -2744,7 +2738,7 @@ buf buf buf buf007 buf buf buf buf008" - (interactive "NMAX? ") + (interactive "NMAX: ") (verilog-insert-1 "%3.3d" max)) (defun verilog-mark-defun () @@ -2792,8 +2786,7 @@ (save-excursion (let ((s+1 (1+ start))) (while (re-search-backward "/\\*" s+1 t) - (replace-match "/-*" t t)))) - )) + (replace-match "/-*" t t)))))) (defun verilog-uncomment-region () "Uncomment a commented area; change deformed comments back to normal. @@ -2869,8 +2862,7 @@ (point-marker))) (e (progn (verilog-end-of-defun) - (point-marker))) - ) + (point-marker)))) (goto-char (marker-position b)) (if (> (- e b) 200) (message "Relabeling module...")) @@ -2885,18 +2877,15 @@ (let ((indent-str (verilog-indent-line))) (verilog-set-auto-endcomments indent-str 't) (end-of-line) - (delete-horizontal-space) - ) + (delete-horizontal-space)) (setq cnt (1+ cnt)) (if (= 9 (% cnt 10)) - (message "%d..." cnt)) - ) + (message "%d..." cnt))) (goto-char oldpos) (if (or (> (- e b) 200) (> cnt 20)) - (message "%d lines auto commented" cnt)) - )) + (message "%d lines auto commented" cnt)))) (defun verilog-beg-of-statement () "Move backward to beginning of statement." @@ -2919,15 +2908,13 @@ (looking-at verilog-extended-complete-re) (not (save-excursion (verilog-backward-token) - (looking-at verilog-extended-complete-re))) - ) + (looking-at verilog-extended-complete-re)))) (looking-at verilog-basic-complete-re) (save-excursion (verilog-backward-token) (or (looking-at verilog-end-block-re) - (looking-at verilog-preprocessor-re))) - )) + (looking-at verilog-preprocessor-re))))) (verilog-backward-syntactic-ws) (verilog-backward-token)) ;; Now point is where the previous line ended. @@ -3011,9 +2998,9 @@ (throw 'found 1)) (setq nest (1- nest))) (t - (throw 'found (= nest 0))) - )))) + (throw 'found (= nest 0))))))) nil))) + (defun verilog-in-struct-region-p () "Return TRUE if in a struct region; more specifically, in a list after a struct|union keyword" @@ -3024,20 +3011,14 @@ (if depth (progn (backward-up-list depth) (verilog-beg-of-statement) - (looking-at "\\<typedef\\>?\\s-*\\<struct\\|union\\>") - ) - ) - ) - ) - ) + (looking-at "\\<typedef\\>?\\s-*\\<struct\\|union\\>")))))) (defun verilog-in-generate-region-p () "Return TRUE if in a generate region; more specifically, after a generate and before an endgenerate" (interactive) (let ((lim (save-excursion (verilog-beg-of-defun) (point))) - (nest 1) - ) + (nest 1)) (save-excursion (while (and (/= nest 0) @@ -3046,17 +3027,14 @@ ((match-end 1) ; generate (setq nest (1- nest))) ((match-end 2) ; endgenerate - (setq nest (1+ nest))) - )) - )) + (setq nest (1+ nest))))))) (= nest 0) )) ; return nest (defun verilog-in-fork-region-p () "Return true if between a fork and join." (interactive) (let ((lim (save-excursion (verilog-beg-of-defun) (point))) - (nest 1) - ) + (nest 1)) (save-excursion (while (and (/= nest 0) @@ -3065,9 +3043,7 @@ ((match-end 1) ; fork (setq nest (1- nest))) ((match-end 2) ; join - (setq nest (1+ nest))) - )) - )) + (setq nest (1+ nest))))))) (= nest 0) )) ; return nest (defun verilog-backward-case-item (lim) @@ -3099,8 +3075,7 @@ (setq colon (1- colon))) ((match-end 3) ;; : - (setq colon (1+ colon))) - )) + (setq colon (1+ colon))))) ;; Skip back to beginning of case item (skip-chars-backward "\t ") (verilog-skip-backward-comment-or-string) @@ -3123,10 +3098,8 @@ (t (goto-char (match-end 0)) (verilog-forward-ws&directives) - (point)) - )) - (error "Malformed case item") - ))) + (point)))) + (error "Malformed case item")))) (setq str (buffer-substring b e)) (if (setq e @@ -3178,8 +3151,7 @@ (search-backward "//" (verilog-get-beg-of-line) t))))) (let ((nest 1) b e m - (else (if (match-end 2) "!" " ")) - ) + (else (if (match-end 2) "!" " "))) (end-of-line) (if kill-existing-comment (verilog-kill-existing-comment)) @@ -3199,8 +3171,7 @@ ((match-end 4) ; `ifdef (setq nest (1- nest))) ((match-end 5) ; `ifndef - (setq nest (1- nest))) - )) + (setq nest (1- nest))))) (if (match-end 0) (setq m (buffer-substring @@ -3212,15 +3183,13 @@ (point)) e (progn (skip-chars-forward "a-zA-Z0-9_") - (point) - )))) + (point))))) (if b (if (> (count-lines (point) b) verilog-minimum-comment-distance) (insert (concat " // " else m " " (buffer-substring b e)))) (progn (insert " // unmatched `else or `endif") - (ding 't)) - ))) + (ding 't))))) (; Comment close case/class/function/task/module and named block (and (looking-at "\\<end") @@ -3269,8 +3238,7 @@ (err 't) (here (point)) there - cntx - ) + cntx) (save-excursion (verilog-leap-to-head) (setq there (point)) @@ -3282,12 +3250,10 @@ (verilog-kill-existing-comment)) (delete-horizontal-space) (insert str) - (ding 't) - ) + (ding 't)) (let ((lim (save-excursion (verilog-beg-of-defun) (point))) - (here (point)) - ) + (here (point))) (cond (;-- handle named block differently (looking-at verilog-named-block-re) @@ -3336,8 +3302,7 @@ (;- else (match-end 4) (let ((nest 0) - ( reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)") - ) + ( reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)")) (catch 'skip (while (verilog-re-search-backward reg nil 'move) (cond @@ -3353,16 +3318,13 @@ (setq err nil) (setq str (verilog-get-expr)) (setq str (concat " // else: !if" str )) - (throw 'skip 1)) - ))) - )))) + (throw 'skip 1))))))))) (;- end else (match-end 5) (goto-char there) (let ((nest 0) - ( reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)") - ) + (reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)")) (catch 'skip (while (verilog-re-search-backward reg nil 'move) (cond @@ -3378,9 +3340,7 @@ (setq err nil) (setq str (verilog-get-expr)) (setq str (concat " // else: !if" str )) - (throw 'skip 1)) - ))) - )))) + (throw 'skip 1))))))))) (;- task/function/initial et cetera t @@ -3392,8 +3352,7 @@ (setq str (concat " // " cntx str ))) (;-- otherwise... - (setq str " // auto-endcomment confused ")) - )) + (setq str " // auto-endcomment confused ")))) ((and (verilog-in-case-region-p) ;-- handle case item differently @@ -3431,9 +3390,8 @@ (match-end 11) ;; of verilog-end-block-ordered-re ;;(goto-char there) (let ((nest 0) - ( reg "\\<\\(class\\)\\|\\(endclass\\)\\|\\(package\\|primitive\\|\\(macro\\)?module\\)\\>") - string - ) + (reg "\\<\\(class\\)\\|\\(endclass\\)\\|\\(package\\|primitive\\|\\(macro\\)?module\\)\\>") + string) (save-excursion (catch 'skip (while (verilog-re-search-backward reg nil 'move) @@ -3463,8 +3421,7 @@ (throw 'skip 1)))) )))) (end-of-line) - (insert (concat " // " string ))) - ) + (insert (concat " // " string )))) (;- this is end{function,generate,task,module,primitive,table,generate} ;- which can not be nested. @@ -3479,8 +3436,7 @@ (cond ((match-end 5) ;; of verilog-end-block-ordered-re (setq reg "\\(\\<function\\>\\)\\|\\(\\<\\(endfunction\\|task\\|\\(macro\\)?module\\|primitive\\)\\>\\)") - (setq width "\\(\\s-*\\(\\[[^]]*\\]\\)\\|\\(real\\(time\\)?\\)\\|\\(integer\\)\\|\\(time\\)\\)?") - ) + (setq width "\\(\\s-*\\(\\[[^]]*\\]\\)\\|\\(real\\(time\\)?\\)\\|\\(integer\\)\\|\\(time\\)\\)?")) ((match-end 6) ;; of verilog-end-block-ordered-re (setq reg "\\(\\<task\\>\\)\\|\\(\\<\\(endtask\\|function\\|\\(macro\\)?module\\|primitive\\)\\>\\)")) ((match-end 7) ;; of verilog-end-block-ordered-re @@ -3502,8 +3458,7 @@ ((match-end 15) ;; of verilog-end-block-ordered-re (setq reg "\\(\\<clocking\\>\\)\\|\\<endclocking\\>")) - (t (error "Problem in verilog-set-auto-endcomments")) - ) + (t (error "Problem in verilog-set-auto-endcomments"))) (let (b e) (save-excursion (verilog-re-search-backward reg nil 'move) @@ -3515,8 +3470,7 @@ (if (and width (looking-at width)) (progn (goto-char (match-end 0)) - (verilog-forward-ws&directives) - )) + (verilog-forward-ws&directives))) (point)) e (progn (skip-chars-forward "a-zA-Z0-9_") @@ -3577,8 +3531,7 @@ b) ('t (skip-chars-forward "^: \t\n\f") - (point) - )))) + (point))))) (str (buffer-substring b e))) (if (setq e (string-match "[ \t]*\\(\\(\n\\)\\|\\(//\\)\\|\\(/\\*\\)\\)" str)) (setq str (concat (substring str 0 e) "..."))) @@ -3601,8 +3554,8 @@ (concat "\\(.*\\)" (regexp-quote bra) "\\([0-9]*\\)\\(:[0-9]*\\|\\)\\(::[0-9---]*\\|\\)" - (regexp-quote ket) - "\\(.*\\)$") signal-string) + (regexp-quote ket) + "\\(.*\\)$") signal-string) (let* ((sig-head (match-string 1 signal-string)) (vec-start (string-to-number (match-string 2 signal-string))) (vec-end (if (= (match-beginning 3) (match-end 3)) @@ -3765,8 +3718,7 @@ ))) ((verilog-in-star-comment-p) (re-search-backward "/\*") - (insert (format " // surefire lint_off_line %6s" code )) - ) + (insert (format " // surefire lint_off_line %6s" code ))) (t (insert (format " // surefire lint_off_line %6s" code )) ))))))))) @@ -3823,11 +3775,11 @@ (setq default-major-mode `verilog-mode) ;; Ditto files already read in (mapc (lambda (buf) - (when (buffer-file-name buf) - (save-excursion - (set-buffer buf) - (verilog-mode)))) - (buffer-list)) + (when (buffer-file-name buf) + (save-excursion + (set-buffer buf) + (verilog-mode)))) + (buffer-list)) ;; Process the files (mapcar '(lambda (buf) (when (buffer-file-name buf) @@ -3943,8 +3895,7 @@ (not (verilog-in-coverage)) (verilog-in-paren)) (progn (setq par 1) - (throw 'nesting 'block)) - ) + (throw 'nesting 'block))) ;; See if we are continuing a previous line (while t @@ -4026,8 +3977,7 @@ (setq reg "\\(\\<class\\>\\)\\|\\(\\<endclass\\>\\)" )) ((match-end 12) ; covergroup ;; Search back for matching covergroup - (setq reg "\\(\\<covergroup\\>\\)\\|\\(\\<endgroup\\>\\)" )) - ) + (setq reg "\\(\\<covergroup\\>\\)\\|\\(\\<endgroup\\>\\)" ))) (catch 'skip (while (verilog-re-search-backward reg nil 'move) (cond @@ -4037,11 +3987,8 @@ (throw 'skip 1))) ((match-end 2) ; end (setq nest (1+ nest))))) - ) - )) - )))) - (throw 'nesting (verilog-calc-1)) - ) + ))))))) + (throw 'nesting (verilog-calc-1))) );; catch nesting );; type ) @@ -4058,8 +4005,8 @@ ((eq type 'defun) (list type 0)) (t - (list type (verilog-current-indent-level))))) - ))) + (list type (verilog-current-indent-level)))))))) + (defun verilog-wai () "Show matching nesting block for debugging." (interactive) @@ -4073,8 +4020,7 @@ (cond ((equal (char-after) ?\{) (if (verilog-at-constraint-p) - (throw 'nesting 'block) - )) + (throw 'nesting 'block))) ((equal (char-after) ?\}) (let ((there (verilog-at-close-constraint-p))) @@ -4133,8 +4079,7 @@ For speed, the searcher looks at the last directive, not the indent of the appropriate enclosing block." (let ((base -1) ;; Indent of the line that determines our indentation - (ind 0) ;; Relative offset caused by other directives (like `endif on same line as `else) - ) + (ind 0)) ;; Relative offset caused by other directives (like `endif on same line as `else) ;; Start at current location, scan back for another directive (save-excursion @@ -4142,8 +4087,7 @@ (while (and (< base 0) (verilog-re-search-backward verilog-directive-re nil t)) (cond ((save-excursion (skip-chars-backward " \t") (bolp)) - (setq base (current-indentation)) - )) + (setq base (current-indentation)))) (cond ((and (looking-at verilog-directive-end) (< base 0)) ;; Only matters when not at BOL (setq ind (- ind verilog-indent-level-directive))) ((and (looking-at verilog-directive-middle) (>= base 0)) ;; Only matters when at BOL @@ -4223,8 +4167,7 @@ (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" )) ((looking-at "\\<endclocking\\>") ;; 12: Search back for matching clocking - (setq reg "\\(\\<clocking\\)\\|\\(\\<endclocking\\>\\)" )) - ) + (setq reg "\\(\\<clocking\\)\\|\\(\\<endclocking\\>\\)" ))) (if reg (catch 'skip (let (sreg) @@ -4268,9 +4211,7 @@ (save-excursion (skip-chars-backward " \t") (not (bolp)))) - (setq continued (verilog-backward-token)) - ) ;; while - )) + (setq continued (verilog-backward-token))))) (setq continued nil)) continued)) @@ -4289,15 +4230,13 @@ (= (preceding-char) ?\}) (progn (backward-char) - (verilog-at-close-constraint-p)) - ) + (verilog-at-close-constraint-p))) (;-- constraint foo { a = b } ; is a complete statement. *sigh* (= (preceding-char) ?\{) (progn (backward-char) - (not (verilog-at-constraint-p))) - ) + (not (verilog-at-constraint-p)))) (;-- Could be 'case (foo)' or 'always @(bar)' which is complete ; also could be simply '@(foo)' ; or foo u1 #(a=8) @@ -4322,10 +4261,8 @@ (verilog-backward-token) (not (looking-at "\\<\\(always\\(_latch\\|_ff\\|_comb\\)?\\|initial\\|while\\)\\>")))) ((= (preceding-char) ?\#) - (backward-char) - ) - (t t)) - ))))) + (backward-char)) + (t t))))))) (;-- any of begin|initial|while are complete statements; 'begin : foo' is also complete t @@ -4346,8 +4283,7 @@ (backward-sexp) (if (looking-at verilog-nameable-item-re ) nil - t) - ) + t)) ((= (preceding-char) ?\#) (backward-char) t) @@ -4357,8 +4293,7 @@ (t (goto-char back) - t) - ))))))) + t)))))))) (defun verilog-backward-syntactic-ws (&optional bound) "Backward skip over syntactic whitespace for Emacs 19. @@ -4370,9 +4305,7 @@ (narrow-to-region bound (point)) (while (/= here (point)) (setq here (point)) - (verilog-skip-backward-comments) - ))) - )) + (verilog-skip-backward-comments)))))) t) (defun verilog-forward-syntactic-ws (&optional bound) @@ -4380,16 +4313,13 @@ Optional BOUND limits search." (save-restriction (let* ((bound (or bound (point-max))) - (here bound) - ) + (here bound)) (if (> bound (point)) (progn (narrow-to-region (point) bound) (while (/= here (point)) (setq here (point)) - (forward-comment (buffer-size)) - ))) - ))) + (forward-comment (buffer-size)))))))) (defun verilog-backward-ws&directives (&optional bound) "Backward skip over syntactic whitespace and compiler directives for Emacs 19. @@ -4423,9 +4353,7 @@ (point)) (t nil)))) - (if p (goto-char p)) - ))) - ))) + (if p (goto-char p)))))))) (defun verilog-forward-ws&directives (&optional bound) "Forward skip over syntactic whitespace and compiler directives for Emacs 19. @@ -4433,8 +4361,7 @@ (save-restriction (let* ((bound (or bound (point-max))) (here bound) - jump - ) + jump) (if (> bound (point)) (progn (let ((state @@ -4455,9 +4382,7 @@ (if (looking-at verilog-directive-re-1) (setq jump t))) (if jump - (beginning-of-line 2)) - ))) - ))) + (beginning-of-line 2)))))))) (defun verilog-in-comment-p () "Return true if in a star or // comment." @@ -4537,14 +4462,11 @@ (forward-list) (progn (backward-char 1) (verilog-backward-ws&directives) - (equal (char-before) ?\;)) - )) + (equal (char-before) ?\;)))) ;; maybe (verilog-re-search-backward "\\<constraint\\|coverpoint\\|cross\\>" nil 'move) ;; not - nil - ) - ) + nil)) (defun verilog-parenthesis-depth () "Return non zero if in parenthetical-expression." @@ -4608,8 +4530,7 @@ t) ((and (not (bobp)) (= (char-before) ?\/) - (= (char-before (1- (point))) ?\*) - ) + (= (char-before (1- (point))) ?\*)) (goto-char (- (point) 2)) t) (t @@ -4650,8 +4571,8 @@ (if (verilog-continued-line) (progn (goto-char sp) - (setq - indent-str (list 'statement (verilog-current-indent-level)))) + (setq indent-str + (list 'statement (verilog-current-indent-level)))) (goto-char sp1) (setq indent-str (list 'block (verilog-current-indent-level))))) (goto-char sp)) @@ -4701,16 +4622,13 @@ (progn (forward-char 1) (backward-up-list -1) - (skip-chars-forward " \t"))) - ) + (skip-chars-forward " \t")))) (current-column)) (progn (goto-char fst) - (+ (current-column) verilog-cexp-indent)) - )))) + (+ (current-column) verilog-cexp-indent)))))) (goto-char here) - (indent-line-to val)) - ) + (indent-line-to val))) ((= (preceding-char) ?\) ) (goto-char here) (let ((val (eval (cdr (assoc type verilog-indent-alist))))) @@ -4724,8 +4642,7 @@ (setq val (current-column)) (setq val (eval (cdr (assoc type verilog-indent-alist))))) (goto-char here) - (indent-line-to val))) - ))) + (indent-line-to val)))))) (; handle inside parenthetical expressions (eq type 'cparenexp) @@ -4737,8 +4654,7 @@ (indent-line-to val) (if (and (not (verilog-in-struct-region-p)) (looking-at verilog-declaration-re)) - (verilog-indent-declaration ind)) - )) + (verilog-indent-declaration ind)))) (;-- Handle the ends (or @@ -4774,8 +4690,8 @@ (;-- Everything else t (let ((val (eval (cdr (assoc type verilog-indent-alist))))) - (indent-line-to val))) - ) + (indent-line-to val)))) + (if (looking-at "[ \t]+$") (skip-chars-forward " \t")) indent-str ; Return indent data @@ -4823,8 +4739,7 @@ (t (save-excursion (re-search-backward "//" nil t) - (current-column))) - ))) + (current-column)))))) (indent-line-to stcol) stcol)) @@ -4843,8 +4758,7 @@ (t (save-excursion (re-search-backward "//" nil t) - (current-column))) - ))) + (current-column)))))) (progn (indent-to stcol) (if (and star @@ -4912,8 +4826,7 @@ (goto-char start) (verilog-do-indent (verilog-calculate-indent)) (verilog-forward-ws&directives) - (current-column))) - ) + (current-column)))) (goto-char end) (goto-char start) (if (> (- end start) 100) @@ -4927,15 +4840,12 @@ (verilog-forward-ws&directives) (indent-line-to base-ind) (verilog-forward-ws&directives) - (verilog-re-search-forward "[ \t\n\f]" e 'move) - ) + (verilog-re-search-forward "[ \t\n\f]" e 'move)) (t (just-one-space) - (verilog-re-search-forward "[ \t\n\f]" e 'move) - ) - ) + (verilog-re-search-forward "[ \t\n\f]" e 'move))) + ;;(forward-line) ) - ;;(forward-line)) ;; Now find biggest prefix (setq ind (verilog-get-lineup-indent start edpos)) ;; Now indent each line. @@ -4960,21 +4870,19 @@ (indent-to ind)) (progn (just-one-space) - (indent-to ind)) - ))) + (indent-to ind))))) ((verilog-continued-line-1 start) (goto-char e) (indent-line-to ind)) (t ; Must be comment or white space (goto-char e) (verilog-forward-ws&directives) - (forward-line -1)) - ) + (forward-line -1))) (forward-line 1)) (message ""))))) (defun verilog-pretty-expr (&optional myre) - "Line up expressions around point." + "Line up expressions around point, or optional regexp MYRE." (interactive "sRegular Expression: ((<|:)?=) ") (save-excursion (if (or (eq myre nil) @@ -4995,8 +4903,7 @@ (beginning-of-line) (while (and (not (looking-at (concat "^\\s-*" verilog-complete-reg))) (looking-at myre) - (not (bobp)) - ) + (not (bobp))) (setq e (point)) (verilog-backward-syntactic-ws) (beginning-of-line) @@ -5015,12 +4922,10 @@ (end-of-line) (setq e (point)) (verilog-forward-syntactic-ws) - (beginning-of-line) - ) + (beginning-of-line)) e)) (edpos (set-marker (make-marker) end)) - (ind) - ) + (ind)) (goto-char start) (verilog-do-indent (verilog-calculate-indent)) (if (> (- end start) 100) @@ -5031,8 +4936,7 @@ (beginning-of-line) (verilog-just-one-space myre) (end-of-line) - (verilog-forward-syntactic-ws) - ) + (verilog-forward-syntactic-ws)) ;; Now find biggest prefix (setq ind (verilog-get-lineup-indent-2 myre start edpos)) @@ -5049,20 +4953,16 @@ (goto-char (match-end 1)) (if (eq (char-after) ?=) (indent-to (1+ ind)) ; line up the = of the <= with surrounding = - (indent-to ind) - ) - ) + (indent-to ind))) ((verilog-continued-line-1 start) (goto-char e) (indent-line-to ind)) (t ; Must be comment or white space (goto-char e) (verilog-forward-ws&directives) - (forward-line -1)) - ) + (forward-line -1))) (forward-line 1)) - (message "") - )))) + (message ""))))) (defun verilog-just-one-space (myre) "Remove extra spaces around regular expression MYRE." @@ -5073,12 +4973,10 @@ (p2 (match-end 2))) (progn (goto-char p2) - (if (looking-at "\\s-") (just-one-space) ) + (if (looking-at "\\s-") (just-one-space)) (goto-char p1) (forward-char -1) - (if (looking-at "\\s-") (just-one-space)) - ) - )) + (if (looking-at "\\s-") (just-one-space))))) (message "")) (defun verilog-indent-declaration (baseind) @@ -5093,8 +4991,7 @@ (point))) (ind) (val) - (m1 (make-marker)) - ) + (m1 (make-marker))) (setq val (+ baseind (eval (cdr (assoc 'declaration verilog-indent-alist))))) (indent-line-to val) @@ -5125,13 +5022,11 @@ (just-one-space) (goto-char (marker-position m1)) (just-one-space) - (indent-to ind) - ) + (indent-to ind)) (if (/= (current-column) ind) (progn (just-one-space) - (indent-to ind)) - ))) + (indent-to ind))))) (if (looking-at verilog-declaration-re-2-no-macro) (let ((p (match-end 0))) (set-marker m1 p) @@ -5362,11 +5257,8 @@ (if (or (null verilog-pred) (funcall verilog-pred match)) (setq verilog-all (cons match verilog-all))))) - (forward-line 1) - ) - ) - verilog-all - ) + (forward-line 1))) + verilog-all) (defun verilog-type-completion () "Calculate all possible completions for types." @@ -5663,8 +5555,7 @@ (goto-char pt) (beginning-of-line)) pt) - (verilog-goto-defun-file label) - ))) + (verilog-goto-defun-file label)))) ;; Eliminate compile warning (eval-when-compile @@ -5680,8 +5571,7 @@ (first 1) (prevpos (point-min)) (final-context-start (make-marker)) - (regexp "\\(module\\s-+\\w+\\s-*(\\)\\|\\(\\w+\\s-+\\w+\\s-*(\\)") - ) + (regexp "\\(module\\s-+\\w+\\s-*(\\)\\|\\(\\w+\\s-+\\w+\\s-*(\\)")) (with-output-to-temp-buffer "*Occur*" (save-excursion (message (format "Searching for %s ..." regexp)) @@ -5854,8 +5744,7 @@ (search-forward "<company>") (replace-match string t t) (search-backward "<description>") - (replace-match "" t t) - ))) + (replace-match "" t t)))) ;; verilog-header Uses the verilog-insert-date function @@ -5994,8 +5883,7 @@ sv-type (verilog-sig-type sig) sv-multidim (verilog-sig-multidim sig) combo "" - buswarn "" - )) + buswarn "")) ;; Extract bus details (setq bus (verilog-sig-bits sig)) (cond ((and bus @@ -6043,16 +5931,15 @@ (if sv-highbit (concat "[" (int-to-string sv-highbit) ":" (int-to-string sv-lowbit) "]"))) - (concat sv-comment combo buswarn) - sv-memory sv-enum sv-signed sv-type sv-multidim) - out-list) - sv-name nil))) - ) + (concat sv-comment combo buswarn) + sv-memory sv-enum sv-signed sv-type sv-multidim) + out-list) + sv-name nil)))) ;; out-list)) (defun verilog-sig-tieoff (sig &optional no-width) - "Return tieoff expression for given SIGNAL, with appropriate width. + "Return tieoff expression for given SIG, with appropriate width. Ignore width if optional NO-WIDTH is set." (let* ((width (if no-width nil (verilog-sig-width sig)))) (concat @@ -6189,8 +6076,7 @@ (forward-char 1) (when (< paren sig-paren) (setq expect-signal nil)) ; ) that ends variables inside v2k arg list - t) - ))) + t)))) ((looking-at "\\s-*\\(\\[[^]]+\\]\\)") (goto-char (match-end 0)) (cond (newsig ; Memory, not just width. Patch last signal added's memory (nth 3) @@ -6272,12 +6158,15 @@ (nreverse sigs-reg) (nreverse sigs-assign) (nreverse sigs-const) - (nreverse sigs-gparam) - )))) - -(defvar sigs-in) ; Prevent compile warning -(defvar sigs-inout) ; Prevent compile warning -(defvar sigs-out) ; Prevent compile warning + (nreverse sigs-gparam))))) + +(eval-when-compile + ;; Prevent compile warnings; these are let's, not globals + ;; Do not remove the eval-when-compile + ;; - we want a error when we are debugging this code if they are refed. + (defvar sigs-in) + (defvar sigs-inout) + (defvar sigs-out)) (defsubst verilog-modi-get-decls (modi) @@ -6524,10 +6413,16 @@ (end-pt (point))) (eval-region beg-pt end-pt nil))))) -;; These are passed in a let, not global -(defvar got-sig) -(defvar got-rvalue) -(defvar uses-delayed) +(eval-when-compile + ;; Prevent compile warnings; these are let's, not globals + ;; Do not remove the eval-when-compile + ;; - we want a error when we are debugging this code if they are refed. + (defvar sigs-in) + (defvar sigs-out) + (defvar got-sig) + (defvar got-rvalue) + (defvar uses-delayed) + (defvar vector-skip-list)) (defun verilog-read-always-signals-recurse (exit-keywd rvalue ignore-next) @@ -6653,8 +6548,7 @@ (t (forward-char 1))) ;; End of non-comment token - (setq last-keywd keywd) - )) + (setq last-keywd keywd))) (skip-syntax-forward " ")) ;; Append the final pending signal (when got-sig @@ -6700,8 +6594,7 @@ (instant (match-string 2))) (if (not (member module verilog-keywords)) (setq instants-list (cons (list module instant) instants-list))))) - (forward-line 1) - )) + (forward-line 1))) instants-list)) @@ -6776,8 +6669,7 @@ (t (error "%s: AUTO_TEMPLATE parsing error: %s" (verilog-point-text) - (progn (looking-at ".*$") (match-string 0)))) - )) + (progn (looking-at ".*$") (match-string 0)))))) ;; Return (vector tpl-regexp (list tpl-sig-list tpl-wild-list))) @@ -6799,8 +6691,7 @@ (let ((enumvar (intern (concat "venum-" enumname)))) ;;(message "Define %s=%s" defname defvalue) (sleep-for 1) (make-variable-buffer-local enumvar) - (add-to-list enumvar defname))) - )) + (add-to-list enumvar defname))))) (defun verilog-read-defines (&optional filename recurse subcall) "Read `defines and parameters for the current file, or optional FILENAME. @@ -6884,8 +6775,7 @@ (while (looking-at "\\s-*,?\\s-*\\([a-zA-Z0-9_$]+\\)\\s-*=\\s-*\\([^;,]*\\),?\\s-*") (verilog-set-define (match-string-no-properties 1) (match-string-no-properties 2) origbuf enumname) (goto-char (match-end 0)) - (forward-comment 999)))) - ))) + (forward-comment 999))))))) (defun verilog-read-includes () "Read `includes for the current file. @@ -6950,8 +6840,7 @@ (or (member keywd verilog-keywords) (member keywd sigs-all) (setq sigs-all (cons keywd sigs-all)))) - (t (forward-char 1))) - ) + (t (forward-char 1)))) ;; Return list sigs-all))) @@ -7019,10 +6908,7 @@ ((string-match "^[^-+]" arg) (verilog-add-list-unique `verilog-library-files arg)) ;; Default - ignore; no warning - ) - ) - ) - ) + )))) ;;(verilog-getopt (list "+libext+.a+.b" "+incdir+foodir" "+define+a+aval" "-f" "otherf" "-v" "library" "-y" "dir")) (defun verilog-getopt-file (filename) @@ -7096,8 +6982,7 @@ "Return true if SYMBOL is number-like." (or (string-match "^[0-9 \t:]+$" symbol) (string-match "^[---]*[0-9]+$" symbol) - (string-match "^[0-9 \t]+'s?[hdxbo][0-9a-fA-F_xz? \t]*$" symbol) - )) + (string-match "^[0-9 \t]+'s?[hdxbo][0-9a-fA-F_xz? \t]*$" symbol))) (defun verilog-symbol-detick (symbol wing-it) "Return a expanded SYMBOL name without any defines. @@ -7185,13 +7070,11 @@ (setq dirfile (expand-file-name (concat (car dirfiles) rest)) dirfiles (cdr dirfiles)) (if (file-directory-p dirfile) - (setq dirlist (cons dirfile dirlist)))) - ) + (setq dirlist (cons dirfile dirlist))))) ;; Defaults (t (if (file-directory-p dirname) - (setq dirlist (cons dirname dirlist)))) - )) + (setq dirlist (cons dirname dirlist)))))) dirlist)) ;;(verilog-expand-dirnames (list "." ".." "nonexist" "../*" "/home/wsnyder/*/v")) @@ -7295,13 +7178,11 @@ "") "\n Check the verilog-library-directories variable." "\n I looked in (if not listed, doesn't exist):\n\t" - (mapconcat 'concat orig-filenames "\n\t"))))) - ) + (mapconcat 'concat orig-filenames "\n\t")))))) (setq verilog-modi-lookup-last-mod module verilog-modi-lookup-last-current current verilog-modi-lookup-last-tick (buffer-modified-tick))))) - verilog-modi-lookup-last-modi - )) + verilog-modi-lookup-last-modi)) (defsubst verilog-modi-name (modi) (aref modi 0)) @@ -7370,8 +7251,7 @@ (buffer-modified-tick) (visited-file-modtime) func-returns) - verilog-modi-cache-list))) - )) + verilog-modi-cache-list))))) ;; func-returns)) @@ -7483,7 +7363,7 @@ (funcall func)))) (defun verilog-insert-one-definition (sig type indent-pt) - "Print out a definition for SIGNAL of the given TYPE, + "Print out a definition for SIG of the given TYPE, with appropriate INDENT-PT indentation." (indent-to indent-pt) (insert type) @@ -7594,9 +7474,8 @@ (string-to-number (match-string 2 range-exp))))))) ((string-match "^\\(.*\\)\\s *:\\s *\\(.*\\)\\s *$" range-exp) (concat "(1+(" (match-string 1 range-exp) ")" - (if (equal "0" (match-string 2 range-exp)) - ;; Don't bother with -(0) - "" + (if (equal "0" (match-string 2 range-exp)) + "" ;; Don't bother with -(0) (concat "-(" (match-string 2 range-exp) ")")) ")")) (t nil))))) @@ -7621,8 +7500,7 @@ ;; End exists (end-of-line) (delete-region pt (point)) - (forward-line 1)) - )) + (forward-line 1)))) (defun verilog-forward-close-paren () "Find the close parenthesis that match the current point, @@ -7897,8 +7775,7 @@ (when (yes-or-no-p "AUTO statements not recomputed, do it now? ") (verilog-auto)) ;; Don't ask again if didn't update - (set (make-local-variable 'verilog-auto-update-tick) (buffer-modified-tick)) - )) + (set (make-local-variable 'verilog-auto-update-tick) (buffer-modified-tick)))) (when (not verilog-auto-star-save) (verilog-delete-auto-star-implicit)) nil) ;; Always return nil -- we don't write the file ourselves @@ -8008,13 +7885,11 @@ (verilog-repair-close-comma) (unless (eq (char-before) ?/ ) (insert "\n")) - (indent-to verilog-indent-level-declaration) - ))) + (indent-to verilog-indent-level-declaration)))) (defun verilog-auto-inst-port-map (port-st) nil) -(defvar vector-skip-list nil) ; Prevent compile warning (defvar vl-cell-type nil "See `verilog-auto-inst'.") ; Prevent compile warning (defvar vl-cell-name nil "See `verilog-auto-inst'.") ; Prevent compile warning (defvar vl-name nil "See `verilog-auto-inst'.") ; Prevent compile warning @@ -8025,7 +7900,8 @@ "Print out a instantiation connection for this PORT-ST. Insert to INDENT-PT, use template TPL-LIST. @ are instantiation numbers, replaced with TPL-NUM. -@\"(expression @)\" are evaluated, with @ as a variable." +@\"(expression @)\" are evaluated, with @ as a variable. +If FOR-STAR add comment it is a .* expansion." (let* ((port (verilog-sig-name port-st)) (tpl-ass (or (assoc port (car tpl-list)) (verilog-auto-inst-port-map port-st))) @@ -8072,13 +7948,11 @@ (prin1 (eval (car (read-from-string expr))) (lambda (ch) ()))))) (if (numberp value) (setq value (number-to-string value))) - value - )) + value)) (substring tpl-net (match-end 0)))))) ;; Replace @ and [] magic variables in final output (setq tpl-net (verilog-string-replace-matches "@" tpl-num nil nil tpl-net)) - (setq tpl-net (verilog-string-replace-matches "\\[\\]" vl-bits nil nil tpl-net)) - ) + (setq tpl-net (verilog-string-replace-matches "\\[\\]" vl-bits nil nil tpl-net))) (indent-to indent-pt) (insert "." port) (indent-to verilog-auto-inst-column) @@ -8462,9 +8336,7 @@ (if (search-forward ")" nil t) ;; From user, moved up a line (delete-backward-char 1)) (if (search-forward ";" nil t) ;; Don't error if user had syntax error and forgot it - (delete-backward-char 1)) - ))) - )))) + (delete-backward-char 1))))))))) (defun verilog-auto-inst-param () "Expand AUTOINSTPARAM statements, as part of \\[verilog-auto]. @@ -8566,9 +8438,7 @@ (search-forward "\n") ;; Added by inst-port (delete-backward-char 1) (if (search-forward ")" nil t) ;; From user, moved up a line - (delete-backward-char 1)) - ))) - )))) + (delete-backward-char 1))))))))) (defun verilog-auto-reg () "Expand AUTOREG statements, as part of \\[verilog-auto]. @@ -8612,15 +8482,13 @@ (verilog-modi-get-consts modi) (verilog-modi-get-gparams modi) (verilog-modi-get-sub-outputs modi) - (verilog-modi-get-sub-inouts modi) - )))) + (verilog-modi-get-sub-inouts modi))))) (forward-line 1) (when sig-list (verilog-insert-indent "// Beginning of automatic regs (for this module's undeclared outputs)\n") (verilog-insert-definition sig-list "reg" indent-pt nil) (verilog-modi-cache-add-regs modi sig-list) - (verilog-insert-indent "// End of automatics\n")) - ))) + (verilog-insert-indent "// End of automatics\n"))))) (defun verilog-auto-reg-input () "Expand AUTOREGINPUT statements, as part of \\[verilog-auto]. @@ -8665,15 +8533,13 @@ (verilog-signals-not-in (append (verilog-modi-get-sub-inputs modi) (verilog-modi-get-sub-inouts modi)) - (verilog-modi-get-signals modi) - )))) + (verilog-modi-get-signals modi))))) (forward-line 1) (when sig-list (verilog-insert-indent "// Beginning of automatic reg inputs (for undeclared instantiated-module inputs)\n") (verilog-insert-definition sig-list "reg" indent-pt nil) (verilog-modi-cache-add-regs modi sig-list) - (verilog-insert-indent "// End of automatics\n")) - ))) + (verilog-insert-indent "// End of automatics\n"))))) (defun verilog-auto-wire () "Expand AUTOWIRE statements, as part of \\[verilog-auto]. @@ -8726,8 +8592,7 @@ (verilog-signals-not-in (append (verilog-modi-get-sub-outputs modi) (verilog-modi-get-sub-inouts modi)) - (verilog-modi-get-signals modi) - )))) + (verilog-modi-get-signals modi))))) (forward-line 1) (when sig-list (verilog-insert-indent "// Beginning of automatic wires (for undeclared instantiated-module outputs)\n") @@ -8739,8 +8604,7 @@ (setq pnt (point)) (verilog-pretty-declarations) (goto-char pnt) - (verilog-pretty-expr "//"))) - ))) + (verilog-pretty-expr "//")))))) (defun verilog-auto-output () "Expand AUTOOUTPUT statements, as part of \\[verilog-auto]. @@ -8793,8 +8657,7 @@ (append (verilog-modi-get-outputs modi) (verilog-modi-get-inouts modi) (verilog-modi-get-sub-inputs modi) - (verilog-modi-get-sub-inouts modi) - )))) + (verilog-modi-get-sub-inouts modi))))) (setq sig-list (verilog-signals-not-matching-regexp sig-list verilog-auto-output-ignore-regexp)) (forward-line 1) @@ -8804,8 +8667,7 @@ (verilog-insert-definition sig-list "output" indent-pt v2k) (verilog-modi-cache-add-outputs modi sig-list) (verilog-insert-indent "// End of automatics\n")) - (when v2k (verilog-repair-close-comma)) - ))) + (when v2k (verilog-repair-close-comma))))) (defun verilog-auto-output-every () "Expand AUTOOUTPUTEVERY statements, as part of \\[verilog-auto]. @@ -8847,8 +8709,7 @@ (sig-list (verilog-signals-combine-bus (verilog-signals-not-in (verilog-modi-get-signals modi) - (verilog-modi-get-ports modi) - )))) + (verilog-modi-get-ports modi))))) (forward-line 1) (when v2k (verilog-repair-open-comma)) (when sig-list @@ -8856,8 +8717,7 @@ (verilog-insert-definition sig-list "output" indent-pt v2k) (verilog-modi-cache-add-outputs modi sig-list) (verilog-insert-indent "// End of automatics\n")) - (when v2k (verilog-repair-close-comma)) - ))) + (when v2k (verilog-repair-close-comma))))) (defun verilog-auto-input () "Expand AUTOINPUT statements, as part of \\[verilog-auto]. @@ -8913,8 +8773,7 @@ (verilog-modi-get-consts modi) (verilog-modi-get-gparams modi) (verilog-modi-get-sub-outputs modi) - (verilog-modi-get-sub-inouts modi) - )))) + (verilog-modi-get-sub-inouts modi))))) (setq sig-list (verilog-signals-not-matching-regexp sig-list verilog-auto-input-ignore-regexp)) (forward-line 1) @@ -8924,8 +8783,7 @@ (verilog-insert-definition sig-list "input" indent-pt v2k) (verilog-modi-cache-add-inputs modi sig-list) (verilog-insert-indent "// End of automatics\n")) - (when v2k (verilog-repair-close-comma)) - ))) + (when v2k (verilog-repair-close-comma))))) (defun verilog-auto-inout () "Expand AUTOINOUT statements, as part of \\[verilog-auto]. @@ -8978,8 +8836,7 @@ (verilog-modi-get-inouts modi) (verilog-modi-get-inputs modi) (verilog-modi-get-sub-inputs modi) - (verilog-modi-get-sub-outputs modi) - )))) + (verilog-modi-get-sub-outputs modi))))) (setq sig-list (verilog-signals-not-matching-regexp sig-list verilog-auto-inout-ignore-regexp)) (forward-line 1) @@ -8989,8 +8846,7 @@ (verilog-insert-definition sig-list "inout" indent-pt v2k) (verilog-modi-cache-add-inouts modi sig-list) (verilog-insert-indent "// End of automatics\n")) - (when v2k (verilog-repair-close-comma)) - ))) + (when v2k (verilog-repair-close-comma))))) (defun verilog-auto-inout-module () "Expand AUTOINOUTMODULE statements, as part of \\[verilog-auto]. @@ -9062,8 +8918,7 @@ (verilog-modi-cache-add-outputs modi sig-list-o) (verilog-modi-cache-add-inouts modi sig-list-io) (verilog-insert-indent "// End of automatics\n")) - (when v2k (verilog-repair-close-comma)) - ))))) + (when v2k (verilog-repair-close-comma))))))) (defun verilog-auto-sense-sigs (modi presense-sigs) "Return list of signals for current AUTOSENSE block." @@ -9164,8 +9019,7 @@ (not-first (insert " or "))) (insert (verilog-sig-name (car sig-list))) (setq sig-list (cdr sig-list) - not-first t)) - ))) + not-first t))))) (defun verilog-auto-reset () "Expand AUTORESET statements, as part of \\[verilog-auto]. @@ -9260,8 +9114,7 @@ ";\n") (indent-to indent-pt) (setq sig-list (cdr sig-list)))) - (insert "// End of automatics")) - ))) + (insert "// End of automatics"))))) (defun verilog-auto-tieoff () "Expand AUTOTIEOFF statements, as part of \\[verilog-auto]. @@ -9316,8 +9169,7 @@ (verilog-modi-get-consts modi) (verilog-modi-get-gparams modi) (verilog-modi-get-sub-outputs modi) - (verilog-modi-get-sub-inouts modi) - )))) + (verilog-modi-get-sub-inouts modi))))) (when sig-list (forward-line 1) (verilog-insert-indent "// Beginning of automatic tieoffs (for this module's unterminated outputs)\n") @@ -9330,8 +9182,7 @@ (insert "= " (verilog-sig-tieoff sig) ";\n") (setq sig-list (cdr sig-list)))) - (verilog-insert-indent "// End of automatics\n") - )))) + (verilog-insert-indent "// End of automatics\n"))))) (defun verilog-auto-unused () "Expand AUTOUNUSED statements, as part of \\[verilog-auto]. @@ -9395,8 +9246,7 @@ (append (verilog-modi-get-inputs modi) (verilog-modi-get-inouts modi)) (append (verilog-modi-get-sub-inputs modi) - (verilog-modi-get-sub-inouts modi) - )))) + (verilog-modi-get-sub-inouts modi))))) (setq sig-list (verilog-signals-not-matching-regexp sig-list verilog-auto-unused-ignore-regexp)) (when sig-list @@ -9408,8 +9258,7 @@ (indent-to indent-pt) (insert (verilog-sig-name sig) ",\n") (setq sig-list (cdr sig-list)))) - (verilog-insert-indent "// End of automatics\n") - )))) + (verilog-insert-indent "// End of automatics\n"))))) (defun verilog-enum-ascii (signm elim-regexp) "Convert a enum name SIGNM to a ascii string for insertion. @@ -9543,8 +9392,7 @@ (verilog-insert-indent "endcase\n") (setq indent-pt (- indent-pt verilog-indent-level)) (verilog-insert-indent "end\n" - "// End of automatics\n") - ))) + "// End of automatics\n")))) (defun verilog-auto-templated-rel () "Replace Templated relative line numbers with absolute line numbers. @@ -9694,8 +9542,7 @@ ;; Must be after all inputs outputs are generated (verilog-auto-search-do "/*AUTOARG*/" 'verilog-auto-arg) ;; Fix line numbers (comments only) - (verilog-auto-templated-rel) - ) + (verilog-auto-templated-rel)) ;; (run-hooks 'verilog-auto-hook) ;; @@ -9709,14 +9556,13 @@ ;; Unwind forms (progn ;; Restore font-lock - (when fontlocked (font-lock-mode t))) - ))) + (when fontlocked (font-lock-mode t)))))) ;; ;; Skeleton based code insertion ;; -(defvar verilog-template-map +(defvar verilog-template-map (let ((map (make-sparse-keymap))) (define-key map "a" 'verilog-sk-always) (define-key map "b" 'verilog-sk-begin) @@ -9985,16 +9831,14 @@ (defun verilog-sk-define-signal () "Insert a definition of signal under point at top of module." (interactive "*") - (let* ( - (sig-re "[a-zA-Z0-9_]*") + (let* ((sig-re "[a-zA-Z0-9_]*") (v1 (buffer-substring (save-excursion (skip-chars-backward sig-re) (point)) (save-excursion (skip-chars-forward sig-re) - (point)))) - ) + (point))))) (if (not (member v1 verilog-keywords)) (save-excursion (setq verilog-sk-signal v1) @@ -10003,10 +9847,7 @@ (verilog-forward-syntactic-ws) (verilog-sk-def-reg) (message "signal at point is %s" v1)) - (message "object at point (%s) is a keyword" v1)) - ) - ) - + (message "object at point (%s) is a keyword" v1)))) (define-skeleton verilog-sk-wire "Insert a wire definition." @@ -10109,7 +9950,7 @@ "^`include\\s-+\"\\([^\n\"]*\\)\"" "Regexp that matches the include file.") -(defvar verilog-mode-mouse-map +(defvar verilog-mode-mouse-map (let ((map (make-sparse-keymap))) ; as described in info pages, make a map (set-keymap-parent map verilog-mode-map) ;; mouse button bindings @@ -10189,8 +10030,7 @@ (progn (message "File '%s' isn't readable, use shift-mouse2 to paste in this field" - (match-string 1)))) - ))) + (match-string 1))))))) ;; ffap isn't useable for verilog mode. It uses library paths. ;; so define this function to do more or less the same as ffap @@ -10208,8 +10048,7 @@ (file-readable-p (car (verilog-library-filenames (match-string 1) (buffer-file-name))))) (find-file (car (verilog-library-filenames - (match-string 1) (buffer-file-name)))))) - )) + (match-string 1) (buffer-file-name)))))))) ;; @@ -10230,6 +10069,7 @@ (princ "\n"))) (autoload 'reporter-submit-bug-report "reporter") +(defvar reporter-prompt-for-summary-p) (defun verilog-submit-bug-report () "Submit via mail a bug report on verilog-mode.el."