aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog87
-rw-r--r--lisp/progmodes/verilog-mode.el866
2 files changed, 440 insertions, 513 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 555c941d2e4..69274fa24ff 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,90 @@
12008-01-09 Wilson Snyder <wsnyder@wsnyder.org>
2
3 * progmodes/verilog-mode.el (top-level): Fix spacing.
4 (verilog-mode-version, verilog-mode-release-date): Update version
5 number.
6 (verilog-mode-release-emacs): New variable.
7 (compile-command, reporter-prompt-for-summary-p): Define for byte
8 compiler.
9 (verilog-startup-message-lines)
10 (verilog-startup-message-displayed)
11 (verilog-display-startup-message): Remove.
12 (verilog-highlight-p1800-keywords): Improve docstring.
13 (sigs-in, sigs-out, got-sig, got-rvalue, uses-delayed)
14 (vector-skip-list): Only defvar at compile time.
15 (verilog-highlight-translate-off, verilog-indent-level)
16 (verilog-indent-level-module, verilog-indent-level-declaration)
17 (verilog-indent-declaration-macros, verilog-indent-lists)
18 (verilog-indent-level-behavioral)
19 (verilog-indent-level-directive, verilog-cexp-indent)
20 (verilog-case-indent, verilog-auto-newline)
21 (verilog-auto-indent-on-newline, verilog-tab-always-indent)
22 (verilog-tab-to-comment, verilog-indent-begin-after-if)
23 (verilog-align-ifelse, verilog-minimum-comment-distance)
24 (verilog-auto-lineup, verilog-highlight-p1800-keywords)
25 (verilog-auto-endcomments, verilog-auto-read-includes)
26 (verilog-auto-star-expand, verilog-auto-star-save)
27 (verilog-library-flags, verilog-library-directories)
28 (verilog-library-files, verilog-library-extensions)
29 (verilog-active-low-regexp, verilog-auto-sense-include-inputs)
30 (verilog-auto-sense-defines-constant, verilog-auto-reset-widths)
31 (verilog-assignment-delay, verilog-auto-inst-vector)
32 (verilog-auto-inst-template-numbers)
33 (verilog-auto-input-ignore-regexp)
34 (verilog-auto-inout-ignore-regexp)
35 (verilog-auto-output-ignore-regexp)
36 (verilog-auto-unused-ignore-regexp, verilog-typedef-regexp): Add
37 safe-local-variable properties.
38 (verilog-statement-menu, verilog-company)
39 (verilog-re-search-forward, verilog-re-search-backward)
40 (verilog-error-regexp-add, verilog-end-block-re)
41 (verilog-emacs-features, verilog-populate-syntax-table)
42 (verilog-setup-dual-comments, verilog-type-font-keywords)
43 (verilog-inside-comment-p, electric-verilog-backward-sexp)
44 (verilog-backward-sexp, verilog-forward-sexp)
45 (verilog-font-lock-init, verilog-mode)
46 (electric-verilog-terminate-line, electric-verilog-semi)
47 (electric-verilog-tab, verilog-insert-1, )
48 (verilog-insert-indices, verilog-generate-numbers)
49 (verilog-comment-region, verilog-label-be)
50 (verilog-beg-of-statement, verilog-in-case-region-p)
51 (verilog-in-struct-region-p, verilog-in-generate-region-p)
52 (verilog-in-fork-region-p, verilog-backward-case-item)
53 (verilog-set-auto-endcomments, verilog-get-expr)
54 (verilog-expand-vector-internal, verilog-surelint-off)
55 (verilog-batch-execute-func, verilog-calculate-indent)
56 (verilog-calc-1, verilog-calculate-indent-directive)
57 (verilog-leap-to-head, verilog-continued-line)
58 (verilog-backward-token, verilog-backward-syntactic-ws)
59 (verilog-forward-syntactic-ws, verilog-backward-ws&directives)
60 (verilog-forward-ws&directives, verilog-at-constraint-p)
61 (verilog-skip-backward-comments, verilog-indent-line-relative)
62 (verilog-do-indent, verilog-indent-comment)
63 (verilog-more-comment, verilog-pretty-declarations)
64 (verilog-pretty-expr, verilog-just-one-space)
65 (verilog-indent-declaration, verilog-get-completion-decl)
66 (verilog-goto-defun, verilog-showscopes, verilog-header)
67 (verilog-signals-combine-bus, verilog-read-decls)
68 (verilog-read-always-signals-recurse, verilog-read-instants)
69 (verilog-read-auto-template, verilog-set-define)
70 (verilog-read-defines, verilog-read-signals, verilog-getopt)
71 (verilog-is-number, verilog-expand-dirnames)
72 (verilog-modi-lookup, verilog-modi-cache-results)
73 (verilog-insert-one-definition, verilog-make-width-expression)
74 (verilog-delete-autos-lined, verilog-auto-save-check)
75 (verilog-auto-arg, verilog-auto-inst-port, verilog-auto-inst)
76 (verilog-auto-inst-param, verilog-auto-reg)
77 (verilog-auto-reg-input, verilog-auto-wire, )
78 (verilog-auto-output, verilog-auto-output-every)
79 (verilog-auto-input, verilog-auto-inout)
80 (verilog-auto-inout-module, verilog-auto-sense)
81 (verilog-auto-reset, verilog-auto-tieoff, verilog-auto-unused)
82 (verilog-auto-ascii-enum, verilog-auto)
83 (verilog-sk-define-signal, verilog-mode-mouse-map)
84 (verilog-load-file-at-mouse, verilog-load-file-at-point)
85 (verilog-library-files): Cleanup spacing of )'s they should not be
86 on unique lines. Fix checkdoc warnings.
87
12008-01-09 Glenn Morris <rgm@gnu.org> 882008-01-09 Glenn Morris <rgm@gnu.org>
2 89
3 * ffap.el (ffap-string-at-point-mode-alist): Add `\' to file 90 * ffap.el (ffap-string-at-point-mode-alist): Add `\' to file
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 54a3f0f6f80..59d5ea83475 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -11,6 +11,12 @@
11;; http://www.veripool.com 11;; http://www.veripool.com
12;; Keywords: languages 12;; Keywords: languages
13 13
14;; This code supports Emacs 21.1 and later
15;; And XEmacs 21.1 and later
16;; Please do not make changes that break Emacs 21. Thanks!
17;;
18;;
19
14;; This file is part of GNU Emacs. 20;; This file is part of GNU Emacs.
15 21
16;; GNU Emacs is free software; you can redistribute it and/or modify 22;; GNU Emacs is free software; you can redistribute it and/or modify
@@ -30,12 +36,12 @@
30 36
31;;; Commentary: 37;;; Commentary:
32 38
33;; This mode borrows heavily from the Pascal-mode and the cc-mode of emacs 39;; This mode borrows heavily from the Pascal-mode and the cc-mode of Emacs
34 40
35;; USAGE 41;; USAGE
36;; ===== 42;; =====
37 43
38;; A major mode for editing Verilog HDL source code. When you have 44;; A major mode for editing Verilog HDL source code. When you have
39;; entered Verilog mode, you may get more info by pressing C-h m. You 45;; entered Verilog mode, you may get more info by pressing C-h m. You
40;; may also get online help describing various functions by: C-h f 46;; may also get online help describing various functions by: C-h f
41;; <Name of function you want described> 47;; <Name of function you want described>
@@ -44,8 +50,8 @@
44;; ======================= 50;; =======================
45 51
46;; Verilog is a rapidly evolving language, and hence this mode is 52;; Verilog is a rapidly evolving language, and hence this mode is
47;; under continuous development. Hence this is beta code, and likely 53;; under continuous development. Hence this is beta code, and likely
48;; has bugs. Please report any and all bugs to me at mac@verilog.com. 54;; has bugs. Please report any and all bugs to me at mac@verilog.com.
49;; Please use verilog-submit-bug-report to submit a report; type C-c 55;; Please use verilog-submit-bug-report to submit a report; type C-c
50;; C-b to invoke this and as a result I will have a much easier time 56;; C-b to invoke this and as a result I will have a much easier time
51;; of reproducing the bug you find, and hence fixing it. 57;; of reproducing the bug you find, and hence fixing it.
@@ -55,7 +61,7 @@
55 61
56;; An older version of this mode may be already installed as a part of 62;; An older version of this mode may be already installed as a part of
57;; your environment, and one method of updating would be to update 63;; your environment, and one method of updating would be to update
58;; your emacs environment. Sometimes this is difficult for local 64;; your Emacs environment. Sometimes this is difficult for local
59;; political/control reasons, and hence you can always install a 65;; political/control reasons, and hence you can always install a
60;; private copy (or even a shared copy) which overrides the system 66;; private copy (or even a shared copy) which overrides the system
61;; default. 67;; default.
@@ -74,7 +80,7 @@
74 80
75;; If you want to customize Verilog mode to fit your needs better, 81;; If you want to customize Verilog mode to fit your needs better,
76;; you may add these lines (the values of the variables presented 82;; you may add these lines (the values of the variables presented
77;; here are the defaults). Note also that if you use an emacs that 83;; here are the defaults). Note also that if you use an Emacs that
78;; supports custom, it's probably better to use the custom menu to 84;; supports custom, it's probably better to use the custom menu to
79;; edit these. 85;; edit these.
80;; 86;;
@@ -102,15 +108,19 @@
102;; 108;;
103 109
104;;; History: 110;;; History:
105;; 111;;
106;; 112;; See commit history at http://www.veripool.com/verilog-mode.html
113;; (This section is required to appease checkdoc.)
114
107;;; Code: 115;;; Code:
108 116
109;; This variable will always hold the version number of the mode 117;; This variable will always hold the version number of the mode
110(defconst verilog-mode-version "377" 118(defconst verilog-mode-version "383"
111 "Version of this verilog mode.")
112(defconst verilog-mode-release-date "2007-12-07"
113 "Version of this verilog mode.") 119 "Version of this verilog mode.")
120(defconst verilog-mode-release-date "2008-01-07-GNU"
121 "Release date of this verilog mode.")
122(defconst verilog-mode-release-emacs t
123 "If non-nil, this version of verilog mode was released with Emacs itself.")
114 124
115(defun verilog-version () 125(defun verilog-version ()
116 "Inform caller of the version of this file." 126 "Inform caller of the version of this file."
@@ -118,7 +128,10 @@
118 (message "Using verilog-mode version %s" verilog-mode-version)) 128 (message "Using verilog-mode version %s" verilog-mode-version))
119 129
120;; Insure we have certain packages, and deal with it if we don't 130;; Insure we have certain packages, and deal with it if we don't
131;; Be sure to note which Emacs flavor and version added each feature.
121(eval-when-compile 132(eval-when-compile
133 ;; The below were disabled when GNU Emacs 22 was released;
134 ;; perhaps some still need to be there to support Emacs 21.
122 (when (featurep 'xemacs) 135 (when (featurep 'xemacs)
123 (condition-case nil 136 (condition-case nil
124 (require 'easymenu) 137 (require 'easymenu)
@@ -181,8 +194,8 @@ STRING should be given if the last search was by `string-match' on STRING."
181 result) 194 result)
182 (buffer-substring-no-properties (match-beginning num) 195 (buffer-substring-no-properties (match-beginning num)
183 (match-end num) 196 (match-end num)
184 (current-buffer) 197 (current-buffer)))))
185 ))))) 198 )
186 (error nil)) 199 (error nil))
187 (if (and (featurep 'custom) (fboundp 'custom-declare-variable)) 200 (if (and (featurep 'custom) (fboundp 'custom-declare-variable))
188 nil ;; We've got what we needed 201 nil ;; We've got what we needed
@@ -210,6 +223,8 @@ STRING should be given if the last search was by `string-match' on STRING."
210;; Provide a regular expression optimization routine, using regexp-opt 223;; Provide a regular expression optimization routine, using regexp-opt
211;; if provided by the user's elisp libraries 224;; if provided by the user's elisp libraries
212(eval-and-compile 225(eval-and-compile
226 ;; The below were disabled when GNU Emacs 22 was released;
227 ;; perhaps some still need to be there to support Emacs 21.
213 (if (featurep 'xemacs) 228 (if (featurep 'xemacs)
214 (if (fboundp 'regexp-opt) 229 (if (fboundp 'regexp-opt)
215 ;; regexp-opt is defined, does it take 3 or 2 arguments? 230 ;; regexp-opt is defined, does it take 3 or 2 arguments?
@@ -222,8 +237,7 @@ STRING should be given if the last search was by `string-match' on STRING."
222 (defun verilog-regexp-opt (a b) 237 (defun verilog-regexp-opt (a b)
223 "Deal with differing number of required arguments for `regexp-opt'. 238 "Deal with differing number of required arguments for `regexp-opt'.
224 Call 'regexp-opt' on A and B." 239 Call 'regexp-opt' on A and B."
225 (regexp-opt a b 't) 240 (regexp-opt a b 't))
226 )
227 (error nil)) 241 (error nil))
228 ) 242 )
229 ((eq args 2) ;; It takes 2 243 ((eq args 2) ;; It takes 2
@@ -290,6 +304,7 @@ you type \\[compile]. When the compile completes, \\[next-error] will take
290you to the next lint error." 304you to the next lint error."
291 :type 'string 305 :type 'string
292 :group 'verilog-mode-actions) 306 :group 'verilog-mode-actions)
307;; We don't mark it safe, as it's used as a shell command
293 308
294(defcustom verilog-coverage 309(defcustom verilog-coverage
295 "echo 'No verilog-coverage set, see \"M-x describe-variable verilog-coverage\"'" 310 "echo 'No verilog-coverage set, see \"M-x describe-variable verilog-coverage\"'"
@@ -299,6 +314,7 @@ you type \\[compile]. When the compile completes, \\[next-error] will take
299you to the next lint error." 314you to the next lint error."
300 :type 'string 315 :type 'string
301 :group 'verilog-mode-actions) 316 :group 'verilog-mode-actions)
317;; We don't mark it safe, as it's used as a shell command
302 318
303(defcustom verilog-simulator 319(defcustom verilog-simulator
304 "echo 'No verilog-simulator set, see \"M-x describe-variable verilog-simulator\"'" 320 "echo 'No verilog-simulator set, see \"M-x describe-variable verilog-simulator\"'"
@@ -308,6 +324,7 @@ you type \\[compile]. When the compile completes, \\[next-error] will take
308you to the next lint error." 324you to the next lint error."
309 :type 'string 325 :type 'string
310 :group 'verilog-mode-actions) 326 :group 'verilog-mode-actions)
327;; We don't mark it safe, as it's used as a shell command
311 328
312(defcustom verilog-compiler 329(defcustom verilog-compiler
313 "echo 'No verilog-compiler set, see \"M-x describe-variable verilog-compiler\"'" 330 "echo 'No verilog-compiler set, see \"M-x describe-variable verilog-compiler\"'"
@@ -317,6 +334,7 @@ you type \\[compile]. When the compile completes, \\[next-error] will take
317you to the next lint error." 334you to the next lint error."
318 :type 'string 335 :type 'string
319 :group 'verilog-mode-actions) 336 :group 'verilog-mode-actions)
337;; We don't mark it safe, as it's used as a shell command
320 338
321(defvar verilog-tool 'verilog-linter 339(defvar verilog-tool 'verilog-linter
322 "Which tool to use for building compiler-command. 340 "Which tool to use for building compiler-command.
@@ -336,11 +354,14 @@ Note: Activate the new setting in a Verilog buffer by re-fontifying it (menu
336entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." 354entry \"Fontify Buffer\"). XEmacs: turn off and on font locking."
337 :type 'boolean 355 :type 'boolean
338 :group 'verilog-mode-indent) 356 :group 'verilog-mode-indent)
357;; Note we don't use :safe, as that would break on Emacsen before 22.0.
358(put 'verilog-highlight-translate-off 'safe-local-variable 'booleanp)
339 359
340(defcustom verilog-indent-level 3 360(defcustom verilog-indent-level 3
341 "*Indentation of Verilog statements with respect to containing block." 361 "*Indentation of Verilog statements with respect to containing block."
342 :group 'verilog-mode-indent 362 :group 'verilog-mode-indent
343 :type 'integer) 363 :type 'integer)
364(put 'verilog-indent-level 'safe-local-variable 'integerp)
344 365
345(defcustom verilog-indent-level-module 3 366(defcustom verilog-indent-level-module 3
346 "*Indentation of Module level Verilog statements. (eg always, initial) 367 "*Indentation of Module level Verilog statements. (eg always, initial)
@@ -348,12 +369,14 @@ Set to 0 to get initial and always statements lined up on the left side of
348your screen." 369your screen."
349 :group 'verilog-mode-indent 370 :group 'verilog-mode-indent
350 :type 'integer) 371 :type 'integer)
372(put 'verilog-indent-level-module 'safe-local-variable 'integerp)
351 373
352(defcustom verilog-indent-level-declaration 3 374(defcustom verilog-indent-level-declaration 3
353 "*Indentation of declarations with respect to containing block. 375 "*Indentation of declarations with respect to containing block.
354Set to 0 to get them list right under containing block." 376Set to 0 to get them list right under containing block."
355 :group 'verilog-mode-indent 377 :group 'verilog-mode-indent
356 :type 'integer) 378 :type 'integer)
379(put 'verilog-indent-level-declaration 'safe-local-variable 'integerp)
357 380
358(defcustom verilog-indent-declaration-macros nil 381(defcustom verilog-indent-declaration-macros nil
359 "*How to treat macro expansions in a declaration. 382 "*How to treat macro expansions in a declaration.
@@ -367,6 +390,7 @@ If non nil, treat as:
367 output c;" 390 output c;"
368 :group 'verilog-mode-indent 391 :group 'verilog-mode-indent
369 :type 'boolean) 392 :type 'boolean)
393(put 'verilog-indent-declaration-macros 'safe-local-variable 'booleanp)
370 394
371(defcustom verilog-indent-lists t 395(defcustom verilog-indent-lists t
372 "*How to treat indenting items in a list. 396 "*How to treat indenting items in a list.
@@ -379,62 +403,73 @@ If nil, treat as:
379 reset ) begin" 403 reset ) begin"
380 :group 'verilog-mode-indent 404 :group 'verilog-mode-indent
381 :type 'boolean) 405 :type 'boolean)
406(put 'verilog-indent-lists 'safe-local-variable 'booleanp)
382 407
383(defcustom verilog-indent-level-behavioral 3 408(defcustom verilog-indent-level-behavioral 3
384 "*Absolute indentation of first begin in a task or function block. 409 "*Absolute indentation of first begin in a task or function block.
385Set to 0 to get such code to start at the left side of the screen." 410Set to 0 to get such code to start at the left side of the screen."
386 :group 'verilog-mode-indent 411 :group 'verilog-mode-indent
387 :type 'integer) 412 :type 'integer)
413(put 'verilog-indent-level-behavioral 'safe-local-variable 'integerp)
388 414
389(defcustom verilog-indent-level-directive 1 415(defcustom verilog-indent-level-directive 1
390 "*Indentation to add to each level of `ifdef declarations. 416 "*Indentation to add to each level of `ifdef declarations.
391Set to 0 to have all directives start at the left side of the screen." 417Set to 0 to have all directives start at the left side of the screen."
392 :group 'verilog-mode-indent 418 :group 'verilog-mode-indent
393 :type 'integer) 419 :type 'integer)
420(put 'verilog-indent-level-directive 'safe-local-variable 'integerp)
394 421
395(defcustom verilog-cexp-indent 2 422(defcustom verilog-cexp-indent 2
396 "*Indentation of Verilog statements split across lines." 423 "*Indentation of Verilog statements split across lines."
397 :group 'verilog-mode-indent 424 :group 'verilog-mode-indent
398 :type 'integer) 425 :type 'integer)
426(put 'verilog-cexp-indent 'safe-local-variable 'integerp)
399 427
400(defcustom verilog-case-indent 2 428(defcustom verilog-case-indent 2
401 "*Indentation for case statements." 429 "*Indentation for case statements."
402 :group 'verilog-mode-indent 430 :group 'verilog-mode-indent
403 :type 'integer) 431 :type 'integer)
432(put 'verilog-case-indent 'safe-local-variable 'integerp)
404 433
405(defcustom verilog-auto-newline t 434(defcustom verilog-auto-newline t
406 "*True means automatically newline after semicolons." 435 "*True means automatically newline after semicolons."
407 :group 'verilog-mode-indent 436 :group 'verilog-mode-indent
408 :type 'boolean) 437 :type 'boolean)
438(put 'verilog-auto-newline 'safe-local-variable 'booleanp)
409 439
410(defcustom verilog-auto-indent-on-newline t 440(defcustom verilog-auto-indent-on-newline t
411 "*True means automatically indent line after newline." 441 "*True means automatically indent line after newline."
412 :group 'verilog-mode-indent 442 :group 'verilog-mode-indent
413 :type 'boolean) 443 :type 'boolean)
444(put 'verilog-auto-indent-on-newline 'safe-local-variable 'booleanp)
414 445
415(defcustom verilog-tab-always-indent t 446(defcustom verilog-tab-always-indent t
416 "*True means TAB should always re-indent the current line. 447 "*True means TAB should always re-indent the current line.
417Nil means TAB will only reindent when at the beginning of the line." 448Nil means TAB will only reindent when at the beginning of the line."
418 :group 'verilog-mode-indent 449 :group 'verilog-mode-indent
419 :type 'boolean) 450 :type 'boolean)
451(put 'verilog-tab-always-indent 'safe-local-variable 'booleanp)
420 452
421(defcustom verilog-tab-to-comment nil 453(defcustom verilog-tab-to-comment nil
422 "*True means TAB moves to the right hand column in preparation for a comment." 454 "*True means TAB moves to the right hand column in preparation for a comment."
423 :group 'verilog-mode-actions 455 :group 'verilog-mode-actions
424 :type 'boolean) 456 :type 'boolean)
457(put 'verilog-tab-to-comment 'safe-local-variable 'booleanp)
425 458
426(defcustom verilog-indent-begin-after-if t 459(defcustom verilog-indent-begin-after-if t
427 "*If true, indent begin statements following if, else, while, for and repeat. 460 "*If true, indent begin statements following if, else, while, for and repeat.
428Otherwise, line them up." 461Otherwise, line them up."
429 :group 'verilog-mode-indent 462 :group 'verilog-mode-indent
430 :type 'boolean ) 463 :type 'boolean)
464(put 'verilog-indent-begin-after-if 'safe-local-variable 'booleanp)
431 465
432 466
433(defcustom verilog-align-ifelse nil 467(defcustom verilog-align-ifelse nil
434 "*If true, align `else' under matching `if'. 468 "*If true, align `else' under matching `if'.
435Otherwise else is lined up with first character on line holding matching if." 469Otherwise else is lined up with first character on line holding matching if."
436 :group 'verilog-mode-indent 470 :group 'verilog-mode-indent
437 :type 'boolean ) 471 :type 'boolean)
472(put 'verilog-align-ifelse 'safe-local-variable 'booleanp)
438 473
439(defcustom verilog-minimum-comment-distance 10 474(defcustom verilog-minimum-comment-distance 10
440 "*Minimum distance (in lines) between begin and end required before a comment. 475 "*Minimum distance (in lines) between begin and end required before a comment.
@@ -442,6 +477,7 @@ Setting this variable to zero results in every end acquiring a comment; the
442default avoids too many redundant comments in tight quarters" 477default avoids too many redundant comments in tight quarters"
443 :group 'verilog-mode-indent 478 :group 'verilog-mode-indent
444 :type 'integer) 479 :type 'integer)
480(put 'verilog-minimum-comment-distance 'safe-local-variable 'integerp)
445 481
446(defcustom verilog-auto-lineup '(declaration) 482(defcustom verilog-auto-lineup '(declaration)
447 "*Algorithm for lining up statements on multiple lines. 483 "*Algorithm for lining up statements on multiple lines.
@@ -481,23 +517,26 @@ would become
481; 517;
482 518
483 :group 'verilog-mode-indent 519 :group 'verilog-mode-indent
484 :type 'list ) 520 :type 'list)
521(put 'verilog-auto-lineup 'safe-local-variable 'listp)
485 522
486(defcustom verilog-highlight-p1800-keywords nil 523(defcustom verilog-highlight-p1800-keywords nil
487 "*If true highlight words newly reserved by IEEE-1800 in 524 "*True means highlight words newly reserved by IEEE-1800.
488verilog-font-lock-p1800-face in order to gently suggest changing where 525These will appear in `verilog-font-lock-p1800-face' in order to gently
489these words are used as variables to something else. Nil means highlight 526suggest changing where these words are used as variables to something else.
490these words as appropriate for the SystemVerilog IEEE-1800 standard. Note 527Nil means highlight these words as appropriate for the SystemVerilog
491that changing this will require restarting emacs to see the effect as font 528IEEE-1800 standard. Note that changing this will require restarting Emacs
492color choices are cached by emacs" 529to see the effect as font color choices are cached by Emacs"
493 :group 'verilog-mode-indent 530 :group 'verilog-mode-indent
494 :type 'boolean) 531 :type 'boolean)
532(put 'verilog-highlight-p1800-keywords 'safe-local-variable 'booleanp)
495 533
496(defcustom verilog-auto-endcomments t 534(defcustom verilog-auto-endcomments t
497 "*True means insert a comment /* ... */ after 'end's. 535 "*True means insert a comment /* ... */ after 'end's.
498The name of the function or case will be set between the braces." 536The name of the function or case will be set between the braces."
499 :group 'verilog-mode-actions 537 :group 'verilog-mode-actions
500 :type 'boolean ) 538 :type 'boolean)
539(put 'verilog-auto-endcomments 'safe-local-variable 'booleanp)
501 540
502(defcustom verilog-auto-read-includes nil 541(defcustom verilog-auto-read-includes nil
503 "*True means to automatically read includes before AUTOs. 542 "*True means to automatically read includes before AUTOs.
@@ -506,7 +545,8 @@ each AUTO expansion. This makes it easier to embed defines and includes,
506but can result in very slow reading times if there are many or large 545but can result in very slow reading times if there are many or large
507include files." 546include files."
508 :group 'verilog-mode-actions 547 :group 'verilog-mode-actions
509 :type 'boolean ) 548 :type 'boolean)
549(put 'verilog-auto-read-includes 'safe-local-variable 'booleanp)
510 550
511(defcustom verilog-auto-save-policy nil 551(defcustom verilog-auto-save-policy nil
512 "*Non-nil indicates action to take when saving a Verilog buffer with AUTOs. 552 "*Non-nil indicates action to take when saving a Verilog buffer with AUTOs.
@@ -527,6 +567,7 @@ They will be expanded in the same way as if there was a AUTOINST in the
527instantiation. See also `verilog-auto-star' and `verilog-auto-star-save'." 567instantiation. See also `verilog-auto-star' and `verilog-auto-star-save'."
528 :group 'verilog-mode-actions 568 :group 'verilog-mode-actions
529 :type 'boolean) 569 :type 'boolean)
570(put 'verilog-auto-star-expand 'safe-local-variable 'booleanp)
530 571
531(defcustom verilog-auto-star-save nil 572(defcustom verilog-auto-star-save nil
532 "*Non-nil indicates to save to disk SystemVerilog .* instance expansions. 573 "*Non-nil indicates to save to disk SystemVerilog .* instance expansions.
@@ -537,6 +578,7 @@ Instead of setting this, you may want to use /*AUTOINST*/, which will
537always be saved." 578always be saved."
538 :group 'verilog-mode-actions 579 :group 'verilog-mode-actions
539 :type 'boolean) 580 :type 'boolean)
581(put 'verilog-auto-star-save 'safe-local-variable 'booleanp)
540 582
541(defvar verilog-auto-update-tick nil 583(defvar verilog-auto-update-tick nil
542 "Modification tick at which autos were last performed.") 584 "Modification tick at which autos were last performed.")
@@ -624,8 +666,7 @@ always be saved."
624 ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 bold t) 666 ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 bold t)
625 ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 2 bold t) 667 ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 2 bold t)
626 ) 668 )
627 "*Keywords to also highlight in Verilog *compilation* buffers." 669 "*Keywords to also highlight in Verilog *compilation* buffers.")
628 )
629 670
630(defcustom verilog-library-flags '("") 671(defcustom verilog-library-flags '("")
631 "*List of standard Verilog arguments to use for /*AUTOINST*/. 672 "*List of standard Verilog arguments to use for /*AUTOINST*/.
@@ -656,6 +697,7 @@ have problems, use \\[find-alternate-file] RET to have these take effect.
656See also the variables mentioned above." 697See also the variables mentioned above."
657 :group 'verilog-mode-auto 698 :group 'verilog-mode-auto
658 :type '(repeat string)) 699 :type '(repeat string))
700(put 'verilog-library-flags 'safe-local-variable 'listp)
659 701
660(defcustom verilog-library-directories '(".") 702(defcustom verilog-library-directories '(".")
661 "*List of directories when looking for files for /*AUTOINST*/. 703 "*List of directories when looking for files for /*AUTOINST*/.
@@ -678,9 +720,11 @@ See also `verilog-library-flags', `verilog-library-files'
678and `verilog-library-extensions'." 720and `verilog-library-extensions'."
679 :group 'verilog-mode-auto 721 :group 'verilog-mode-auto
680 :type '(repeat file)) 722 :type '(repeat file))
723(put 'verilog-library-directories 'safe-local-variable 'listp)
681 724
682(defcustom verilog-library-files '() 725(defcustom verilog-library-files '()
683 "*List of files to search for modules when looking for AUTOINST files. 726 "*List of files to search for modules.
727AUTOINST will use this when it needs to resolve a module name.
684This is a complete path, usually to a technology file with many standard 728This is a complete path, usually to a technology file with many standard
685cells defined in it. 729cells defined in it.
686 730
@@ -698,12 +742,14 @@ have problems, use \\[find-alternate-file] RET to have these take effect.
698See also `verilog-library-flags', `verilog-library-directories'." 742See also `verilog-library-flags', `verilog-library-directories'."
699 :group 'verilog-mode-auto 743 :group 'verilog-mode-auto
700 :type '(repeat directory)) 744 :type '(repeat directory))
745(put 'verilog-library-files 'safe-local-variable 'listp)
701 746
702(defcustom verilog-library-extensions '(".v") 747(defcustom verilog-library-extensions '(".v")
703 "*List of extensions to use when looking for files for /*AUTOINST*/. 748 "*List of extensions to use when looking for files for /*AUTOINST*/.
704See also `verilog-library-flags', `verilog-library-directories'." 749See also `verilog-library-flags', `verilog-library-directories'."
705 :type '(repeat string) 750 :type '(repeat string)
706 :group 'verilog-mode-auto) 751 :group 'verilog-mode-auto)
752(put 'verilog-library-extensions 'safe-local-variable 'listp)
707 753
708(defcustom verilog-active-low-regexp nil 754(defcustom verilog-active-low-regexp nil
709 "*If set, treat signals matching this regexp as active low. 755 "*If set, treat signals matching this regexp as active low.
@@ -711,21 +757,24 @@ This is used for AUTORESET and AUTOTIEOFF. For proper behavior,
711you will probably also need `verilog-auto-reset-widths' set." 757you will probably also need `verilog-auto-reset-widths' set."
712 :group 'verilog-mode-auto 758 :group 'verilog-mode-auto
713 :type 'string) 759 :type 'string)
760(put 'verilog-active-low-regexp 'safe-local-variable 'stringp)
714 761
715(defcustom verilog-auto-sense-include-inputs nil 762(defcustom verilog-auto-sense-include-inputs nil
716 "*If true, AUTOSENSE should include all inputs. 763 "*If true, AUTOSENSE should include all inputs.
717If nil, only inputs that are NOT output signals in the same block are 764If nil, only inputs that are NOT output signals in the same block are
718included." 765included."
719 :type 'boolean 766 :group 'verilog-mode-auto
720 :group 'verilog-mode-auto) 767 :type 'boolean)
768(put 'verilog-auto-sense-include-inputs 'safe-local-variable 'booleanp)
721 769
722(defcustom verilog-auto-sense-defines-constant nil 770(defcustom verilog-auto-sense-defines-constant nil
723 "*If true, AUTOSENSE should assume all defines represent constants. 771 "*If true, AUTOSENSE should assume all defines represent constants.
724When true, the defines will not be included in sensitivity lists. To 772When true, the defines will not be included in sensitivity lists. To
725maintain compatibility with other sites, this should be set at the bottom 773maintain compatibility with other sites, this should be set at the bottom
726of each verilog file that requires it, rather than being set globally." 774of each verilog file that requires it, rather than being set globally."
727 :type 'boolean 775 :group 'verilog-mode-auto
728 :group 'verilog-mode-auto) 776 :type 'boolean)
777(put 'verilog-auto-sense-defines-constant 'safe-local-variable 'booleanp)
729 778
730(defcustom verilog-auto-reset-widths t 779(defcustom verilog-auto-reset-widths t
731 "*If true, AUTORESET should determine the width of signals. 780 "*If true, AUTORESET should determine the width of signals.
@@ -735,11 +784,13 @@ the constant zero. This may result in ugly code when parameters determine
735the MSB or LSB of a signal inside a AUTORESET." 784the MSB or LSB of a signal inside a AUTORESET."
736 :type 'boolean 785 :type 'boolean
737 :group 'verilog-mode-auto) 786 :group 'verilog-mode-auto)
787(put 'verilog-auto-reset-widths 'safe-local-variable 'booleanp)
738 788
739(defcustom verilog-assignment-delay "" 789(defcustom verilog-assignment-delay ""
740 "*Text used for delays in delayed assignments. Add a trailing space if set." 790 "*Text used for delays in delayed assignments. Add a trailing space if set."
741 :type 'string 791 :group 'verilog-mode-auto
742 :group 'verilog-mode-auto) 792 :type 'string)
793(put 'verilog-assignment-delay 'safe-local-variable 'stringp)
743 794
744(defcustom verilog-auto-inst-vector t 795(defcustom verilog-auto-inst-vector t
745 "*If true, when creating default ports with AUTOINST, use bus subscripts. 796 "*If true, when creating default ports with AUTOINST, use bus subscripts.
@@ -748,7 +799,8 @@ the module (AUTOWIRE signals always are subscripted, you must manually
748declare the wire to have the subscripts removed.) Nil may speed up some 799declare the wire to have the subscripts removed.) Nil may speed up some
749simulators, but is less general and harder to read, so avoid." 800simulators, but is less general and harder to read, so avoid."
750 :group 'verilog-mode-auto 801 :group 'verilog-mode-auto
751 :type 'boolean ) 802 :type 'boolean)
803(put 'verilog-auto-inst-vector 'safe-local-variable 'booleanp)
752 804
753(defcustom verilog-auto-inst-template-numbers nil 805(defcustom verilog-auto-inst-template-numbers nil
754 "*If true, when creating templated ports with AUTOINST, add a comment. 806 "*If true, when creating templated ports with AUTOINST, add a comment.
@@ -756,7 +808,8 @@ The comment will add the line number of the template that was used for that
756port declaration. Setting this aids in debugging, but nil is suggested for 808port declaration. Setting this aids in debugging, but nil is suggested for
757regular use to prevent large numbers of merge conflicts." 809regular use to prevent large numbers of merge conflicts."
758 :group 'verilog-mode-auto 810 :group 'verilog-mode-auto
759 :type 'boolean ) 811 :type 'boolean)
812(put 'verilog-auto-inst-template-numbers 'safe-local-variable 'booleanp)
760 813
761(defvar verilog-auto-inst-column 40 814(defvar verilog-auto-inst-column 40
762 "Column number for first part of auto-inst.") 815 "Column number for first part of auto-inst.")
@@ -765,31 +818,36 @@ regular use to prevent large numbers of merge conflicts."
765 "*If set, when creating AUTOINPUT list, ignore signals matching this regexp. 818 "*If set, when creating AUTOINPUT list, ignore signals matching this regexp.
766See the \\[verilog-faq] for examples on using this." 819See the \\[verilog-faq] for examples on using this."
767 :group 'verilog-mode-auto 820 :group 'verilog-mode-auto
768 :type 'string ) 821 :type 'string)
822(put 'verilog-auto-input-ignore-regexp 'safe-local-variable 'stringp)
769 823
770(defcustom verilog-auto-inout-ignore-regexp nil 824(defcustom verilog-auto-inout-ignore-regexp nil
771 "*If set, when creating AUTOINOUT list, ignore signals matching this regexp. 825 "*If set, when creating AUTOINOUT list, ignore signals matching this regexp.
772See the \\[verilog-faq] for examples on using this." 826See the \\[verilog-faq] for examples on using this."
773 :group 'verilog-mode-auto 827 :group 'verilog-mode-auto
774 :type 'string ) 828 :type 'string)
829(put 'verilog-auto-inout-ignore-regexp 'safe-local-variable 'stringp)
775 830
776(defcustom verilog-auto-output-ignore-regexp nil 831(defcustom verilog-auto-output-ignore-regexp nil
777 "*If set, when creating AUTOOUTPUT list, ignore signals matching this regexp. 832 "*If set, when creating AUTOOUTPUT list, ignore signals matching this regexp.
778See the \\[verilog-faq] for examples on using this." 833See the \\[verilog-faq] for examples on using this."
779 :group 'verilog-mode-auto 834 :group 'verilog-mode-auto
780 :type 'string ) 835 :type 'string)
836(put 'verilog-auto-output-ignore-regexp 'safe-local-variable 'stringp)
781 837
782(defcustom verilog-auto-unused-ignore-regexp nil 838(defcustom verilog-auto-unused-ignore-regexp nil
783 "*If set, when creating AUTOUNUSED list, ignore signals matching this regexp. 839 "*If set, when creating AUTOUNUSED list, ignore signals matching this regexp.
784See the \\[verilog-faq] for examples on using this." 840See the \\[verilog-faq] for examples on using this."
785 :group 'verilog-mode-auto 841 :group 'verilog-mode-auto
786 :type 'string ) 842 :type 'string)
843(put 'verilog-auto-unused-ignore-regexp 'safe-local-variable 'stringp)
787 844
788(defcustom verilog-typedef-regexp nil 845(defcustom verilog-typedef-regexp nil
789 "*If non-nil, regular expression that matches Verilog-2001 typedef names. 846 "*If non-nil, regular expression that matches Verilog-2001 typedef names.
790For example, \"_t$\" matches typedefs named with _t, as in the C language." 847For example, \"_t$\" matches typedefs named with _t, as in the C language."
791 :group 'verilog-mode-auto 848 :group 'verilog-mode-auto
792 :type 'string ) 849 :type 'string)
850(put 'verilog-typedef-regexp 'safe-local-variable 'stringp)
793 851
794(defcustom verilog-mode-hook 'verilog-set-compile-command 852(defcustom verilog-mode-hook 'verilog-set-compile-command
795 "*Hook (List of functions) run after verilog mode is loaded." 853 "*Hook (List of functions) run after verilog mode is loaded."
@@ -798,33 +856,33 @@ For example, \"_t$\" matches typedefs named with _t, as in the C language."
798 856
799(defcustom verilog-auto-hook nil 857(defcustom verilog-auto-hook nil
800 "*Hook run after `verilog-mode' updates AUTOs." 858 "*Hook run after `verilog-mode' updates AUTOs."
801 :type 'hook 859 :group 'verilog-mode-auto
802 :group 'verilog-mode-auto) 860 :type 'hook)
803 861
804(defcustom verilog-before-auto-hook nil 862(defcustom verilog-before-auto-hook nil
805 "*Hook run before `verilog-mode' updates AUTOs." 863 "*Hook run before `verilog-mode' updates AUTOs."
806 :type 'hook 864 :group 'verilog-mode-auto
807 :group 'verilog-mode-auto) 865 :type 'hook)
808 866
809(defcustom verilog-delete-auto-hook nil 867(defcustom verilog-delete-auto-hook nil
810 "*Hook run after `verilog-mode' deletes AUTOs." 868 "*Hook run after `verilog-mode' deletes AUTOs."
811 :type 'hook 869 :group 'verilog-mode-auto
812 :group 'verilog-mode-auto) 870 :type 'hook)
813 871
814(defcustom verilog-before-delete-auto-hook nil 872(defcustom verilog-before-delete-auto-hook nil
815 "*Hook run before `verilog-mode' deletes AUTOs." 873 "*Hook run before `verilog-mode' deletes AUTOs."
816 :type 'hook 874 :group 'verilog-mode-auto
817 :group 'verilog-mode-auto) 875 :type 'hook)
818 876
819(defcustom verilog-getopt-flags-hook nil 877(defcustom verilog-getopt-flags-hook nil
820 "*Hook run after `verilog-getopt-flags' determines the Verilog option lists." 878 "*Hook run after `verilog-getopt-flags' determines the Verilog option lists."
821 :type 'hook 879 :group 'verilog-mode-auto
822 :group 'verilog-mode-auto) 880 :type 'hook)
823 881
824(defcustom verilog-before-getopt-flags-hook nil 882(defcustom verilog-before-getopt-flags-hook nil
825 "*Hook run before `verilog-getopt-flags' determines the Verilog option lists." 883 "*Hook run before `verilog-getopt-flags' determines the Verilog option lists."
826 :type 'hook 884 :group 'verilog-mode-auto
827 :group 'verilog-mode-auto) 885 :type 'hook)
828 886
829(defvar verilog-imenu-generic-expression 887(defvar verilog-imenu-generic-expression
830 '((nil "^\\s-*\\(\\(m\\(odule\\|acromodule\\)\\)\\|primitive\\)\\s-+\\([a-zA-Z0-9_.:]+\\)" 4) 888 '((nil "^\\s-*\\(\\(m\\(odule\\|acromodule\\)\\)\\|primitive\\)\\s-+\\([a-zA-Z0-9_.:]+\\)" 4)
@@ -843,13 +901,11 @@ format (e.g. 09/17/1997) is not supported.")
843(defvar verilog-company nil 901(defvar verilog-company nil
844 "*Default name of Company for verilog header. 902 "*Default name of Company for verilog header.
845If set will become buffer local.") 903If set will become buffer local.")
846
847(make-variable-buffer-local 'verilog-company) 904(make-variable-buffer-local 'verilog-company)
848 905
849(defvar verilog-project nil 906(defvar verilog-project nil
850 "*Default name of Project for verilog header. 907 "*Default name of Project for verilog header.
851If set will become buffer local.") 908If set will become buffer local.")
852
853(make-variable-buffer-local 'verilog-project) 909(make-variable-buffer-local 'verilog-project)
854 910
855(defvar verilog-mode-map 911(defvar verilog-mode-map
@@ -1025,8 +1081,7 @@ If set will become buffer local.")
1025 ["Casex" verilog-sk-casex t] 1081 ["Casex" verilog-sk-casex t]
1026 ["Casez" verilog-sk-casez t] 1082 ["Casez" verilog-sk-casez t]
1027 ) 1083 )
1028 "Menu for statement templates in Verilog." 1084 "Menu for statement templates in Verilog.")
1029 )
1030 1085
1031(easy-menu-define verilog-menu verilog-mode-map "Menu for Verilog mode" 1086(easy-menu-define verilog-menu verilog-mode-map "Menu for Verilog mode"
1032 verilog-xemacs-menu) 1087 verilog-xemacs-menu)
@@ -1072,8 +1127,7 @@ will break, as the o's continuously replace. xa -> x works ok though."
1072 (store-match-data '(nil nil)) 1127 (store-match-data '(nil nil))
1073 (if BOUND 1128 (if BOUND
1074 (< (point) BOUND) 1129 (< (point) BOUND)
1075 t) 1130 t)))))
1076 ))))
1077 (match-end 0)) 1131 (match-end 0))
1078 1132
1079(defsubst verilog-re-search-backward (REGEXP BOUND NOERROR) 1133(defsubst verilog-re-search-backward (REGEXP BOUND NOERROR)
@@ -1087,8 +1141,7 @@ will break, as the o's continuously replace. xa -> x works ok though."
1087 (store-match-data '(nil nil)) 1141 (store-match-data '(nil nil))
1088 (if BOUND 1142 (if BOUND
1089 (> (point) BOUND) 1143 (> (point) BOUND)
1090 t) 1144 t)))))
1091 ))))
1092 (match-end 0)) 1145 (match-end 0))
1093 1146
1094(defsubst verilog-re-search-forward-quick (regexp bound noerror) 1147(defsubst verilog-re-search-forward-quick (regexp bound noerror)
@@ -1130,6 +1183,8 @@ so there may be a large up front penalty for the first search."
1130 (save-excursion 1183 (save-excursion
1131 (nth 3 (parse-partial-sexp (verilog-get-beg-of-line) (point))))) 1184 (nth 3 (parse-partial-sexp (verilog-get-beg-of-line) (point)))))
1132 1185
1186(defvar compile-command)
1187
1133;; compilation program 1188;; compilation program
1134(defun verilog-set-compile-command () 1189(defun verilog-set-compile-command ()
1135 "Function to compute shell command to compile verilog. 1190 "Function to compute shell command to compile verilog.
@@ -1201,8 +1256,7 @@ find the errors."
1201 (setq compilation-error-regexp-alist 1256 (setq compilation-error-regexp-alist
1202 (default-value 'compilation-error-regexp-alist)) 1257 (default-value 'compilation-error-regexp-alist))
1203 (set (make-local-variable 'compilation-error-regexp-alist) 1258 (set (make-local-variable 'compilation-error-regexp-alist)
1204 (default-value 'compilation-error-regexp-alist)) 1259 (default-value 'compilation-error-regexp-alist)))))
1205 )))
1206 1260
1207(add-hook 'compilation-mode-hook 'verilog-error-regexp-add) 1261(add-hook 'compilation-mode-hook 'verilog-error-regexp-add)
1208 1262
@@ -1330,8 +1384,7 @@ find the errors."
1330 "endprogram" 1384 "endprogram"
1331 "endsequence" 1385 "endsequence"
1332 "endclocking" 1386 "endclocking"
1333 ) 1387 ))))
1334 )))
1335 1388
1336 1389
1337(defconst verilog-endcomment-reason-re 1390(defconst verilog-endcomment-reason-re
@@ -1667,11 +1720,11 @@ find the errors."
1667 (and (or (not major) (not minor)) 1720 (and (or (not major) (not minor))
1668 (string-match "\\([0-9]+\\).\\([0-9]+\\)" emacs-version) 1721 (string-match "\\([0-9]+\\).\\([0-9]+\\)" emacs-version)
1669 (setq major (string-to-number (substring emacs-version 1722 (setq major (string-to-number (substring emacs-version
1670 (match-beginning 1) 1723 (match-beginning 1)
1671 (match-end 1))) 1724 (match-end 1)))
1672 minor (string-to-number (substring emacs-version 1725 minor (string-to-number (substring emacs-version
1673 (match-beginning 2) 1726 (match-beginning 2)
1674 (match-end 2))))) 1727 (match-end 2)))))
1675 (if (not (and major minor)) 1728 (if (not (and major minor))
1676 (error "Cannot figure out the major and minor version numbers")) 1729 (error "Cannot figure out the major and minor version numbers"))
1677 ;; calculate the major version 1730 ;; calculate the major version
@@ -1706,8 +1759,7 @@ find the errors."
1706 ;; Emacs 19.30 and beyond are known to be 1-bit 1759 ;; Emacs 19.30 and beyond are known to be 1-bit
1707 ((eq flavor 'FSF) (setq comments '1-bit)) 1760 ((eq flavor 'FSF) (setq comments '1-bit))
1708 ;; Don't know what this is 1761 ;; Don't know what this is
1709 (t (error "Couldn't figure out syntax table format")) 1762 (t (error "Couldn't figure out syntax table format"))))
1710 ))
1711 ;; Emacs 18 has no support for dual comments 1763 ;; Emacs 18 has no support for dual comments
1712 (setq comments 'no-dual-comments)) 1764 (setq comments 'no-dual-comments))
1713 ;; determine whether to use old or new font lock syntax 1765 ;; determine whether to use old or new font lock syntax
@@ -1724,8 +1776,7 @@ find the errors."
1724 ;; Emacs before 19.6 had bugs 1776 ;; Emacs before 19.6 had bugs
1725 (and (eq major 'v19) (eq flavor 'XEmacs) (< minor 6)) 1777 (and (eq major 'v19) (eq flavor 'XEmacs) (< minor 6))
1726 ;; Emacs 19 before 19.21 has known bugs 1778 ;; Emacs 19 before 19.21 has known bugs
1727 (and (eq major 'v19) (eq flavor 'FSF) (< minor 21)) 1779 (and (eq major 'v19) (eq flavor 'FSF) (< minor 21)))
1728 )
1729 (with-output-to-temp-buffer "*verilog-mode warnings*" 1780 (with-output-to-temp-buffer "*verilog-mode warnings*"
1730 (print (format 1781 (print (format
1731 "The version of Emacs that you are running, %s, 1782 "The version of Emacs that you are running, %s,
@@ -1785,8 +1836,7 @@ supported list, along with the values for this variable:
1785 (modify-syntax-entry ?| "." table) 1836 (modify-syntax-entry ?| "." table)
1786 (modify-syntax-entry ?` "w" table) 1837 (modify-syntax-entry ?` "w" table)
1787 (modify-syntax-entry ?_ "w" table) 1838 (modify-syntax-entry ?_ "w" table)
1788 (modify-syntax-entry ?\' "." table) 1839 (modify-syntax-entry ?\' "." table))
1789)
1790 1840
1791(defun verilog-setup-dual-comments (table) 1841(defun verilog-setup-dual-comments (table)
1792 "Set up TABLE to handle block and line style comments." 1842 "Set up TABLE to handle block and line style comments."
@@ -1795,15 +1845,12 @@ supported list, along with the values for this variable:
1795 ;; XEmacs (formerly Lucid) has the best implementation 1845 ;; XEmacs (formerly Lucid) has the best implementation
1796 (modify-syntax-entry ?/ ". 1456" table) 1846 (modify-syntax-entry ?/ ". 1456" table)
1797 (modify-syntax-entry ?* ". 23" table) 1847 (modify-syntax-entry ?* ". 23" table)
1798 (modify-syntax-entry ?\n "> b" table) 1848 (modify-syntax-entry ?\n "> b" table))
1799 )
1800 ((memq '1-bit verilog-emacs-features) 1849 ((memq '1-bit verilog-emacs-features)
1801 ;; Emacs 19 does things differently, but we can work with it 1850 ;; Emacs 19 does things differently, but we can work with it
1802 (modify-syntax-entry ?/ ". 124b" table) 1851 (modify-syntax-entry ?/ ". 124b" table)
1803 (modify-syntax-entry ?* ". 23" table) 1852 (modify-syntax-entry ?* ". 23" table)
1804 (modify-syntax-entry ?\n "> b" table) 1853 (modify-syntax-entry ?\n "> b" table))))
1805 )
1806 ))
1807 1854
1808(defvar verilog-mode-syntax-table nil 1855(defvar verilog-mode-syntax-table nil
1809 "Syntax table used in `verilog-mode' buffers.") 1856 "Syntax table used in `verilog-mode' buffers.")
@@ -1961,8 +2008,7 @@ See also `verilog-font-lock-extra-types'.")
1961 'font-lock-type-face)) 2008 'font-lock-type-face))
1962 ;; Fontify Verilog-AMS keywords 2009 ;; Fontify Verilog-AMS keywords
1963 (cons (concat "\\<\\(" verilog-ams-keywords "\\)\\>") 2010 (cons (concat "\\<\\(" verilog-ams-keywords "\\)\\>")
1964 'verilog-font-lock-ams-face) 2011 'verilog-font-lock-ams-face)))
1965 ))
1966 2012
1967 (setq verilog-font-lock-keywords-1 2013 (setq verilog-font-lock-keywords-1
1968 (append verilog-font-lock-keywords 2014 (append verilog-font-lock-keywords
@@ -1976,15 +2022,12 @@ See also `verilog-font-lock-extra-types'.")
1976 (list 2022 (list
1977 (concat "\\<function\\>\\s-+\\(integer\\|real\\(time\\)?\\|time\\)\\s-+\\(\\sw+\\)" ) 2023 (concat "\\<function\\>\\s-+\\(integer\\|real\\(time\\)?\\|time\\)\\s-+\\(\\sw+\\)" )
1978 '(1 font-lock-keyword-face) 2024 '(1 font-lock-keyword-face)
1979 '(3 font-lock-reference-face prepend) 2025 '(3 font-lock-reference-face prepend))
1980 )
1981 '("\\<function\\>\\s-+\\(\\[[^]]+\\]\\)\\s-+\\(\\sw+\\)" 2026 '("\\<function\\>\\s-+\\(\\[[^]]+\\]\\)\\s-+\\(\\sw+\\)"
1982 (1 font-lock-keyword-face) 2027 (1 font-lock-keyword-face)
1983 (2 font-lock-reference-face append) 2028 (2 font-lock-reference-face append))
1984 )
1985 '("\\<function\\>\\s-+\\(\\sw+\\)" 2029 '("\\<function\\>\\s-+\\(\\sw+\\)"
1986 1 'font-lock-reference-face append) 2030 1 'font-lock-reference-face append))))
1987 )))
1988 2031
1989 (setq verilog-font-lock-keywords-2 2032 (setq verilog-font-lock-keywords-2
1990 (append verilog-font-lock-keywords-1 2033 (append verilog-font-lock-keywords-1
@@ -2002,7 +2045,6 @@ See also `verilog-font-lock-extra-types'.")
2002 0 font-lock-type-face append) 2045 0 font-lock-type-face append)
2003 ;; Fontify instantiation names 2046 ;; Fontify instantiation names
2004 '("\\([A-Za-z][A-Za-z0-9_]+\\)\\s-*(" 1 font-lock-function-name-face) 2047 '("\\([A-Za-z][A-Za-z0-9_]+\\)\\s-*(" 1 font-lock-function-name-face)
2005
2006 ))) 2048 )))
2007 2049
2008 (setq verilog-font-lock-keywords-3 2050 (setq verilog-font-lock-keywords-3
@@ -2015,15 +2057,14 @@ See also `verilog-font-lock-extra-types'.")
2015 ))))) 2057 )))))
2016 2058
2017 2059
2018
2019(defun verilog-inside-comment-p () 2060(defun verilog-inside-comment-p ()
2020 "Check if point inside a nested comment." 2061 "Check if point inside a nested comment."
2021 (save-excursion 2062 (save-excursion
2022 (let ((st-point (point)) hitbeg) 2063 (let ((st-point (point)) hitbeg)
2023 (or (search-backward "//" (verilog-get-beg-of-line) t) 2064 (or (search-backward "//" (verilog-get-beg-of-line) t)
2024 (if (progn 2065 (if (progn
2025 ;; This is for tricky case //*, we keep searching if /* is 2066 ;; This is for tricky case //*, we keep searching if /*
2026 ;; proceeded by // on same line. 2067 ;; is proceeded by // on same line.
2027 (while 2068 (while
2028 (and (setq hitbeg (search-backward "/*" nil t)) 2069 (and (setq hitbeg (search-backward "/*" nil t))
2029 (progn 2070 (progn
@@ -2048,14 +2089,14 @@ Use filename, if current buffer being edited shorten to just buffer name."
2048 "Move backward over a sexp." 2089 "Move backward over a sexp."
2049 (interactive) 2090 (interactive)
2050 ;; before that see if we are in a comment 2091 ;; before that see if we are in a comment
2051 (verilog-backward-sexp) 2092 (verilog-backward-sexp))
2052) 2093
2053(defun electric-verilog-forward-sexp () 2094(defun electric-verilog-forward-sexp ()
2054 "Move backward over a sexp." 2095 "Move backward over a sexp."
2055 (interactive) 2096 (interactive)
2056 ;; before that see if we are in a comment 2097 ;; before that see if we are in a comment
2057 (verilog-forward-sexp) 2098 (verilog-forward-sexp))
2058) 2099
2059;;;used by hs-minor-mode 2100;;;used by hs-minor-mode
2060(defun verilog-forward-sexp-function (arg) 2101(defun verilog-forward-sexp-function (arg)
2061 (if (< arg 0) 2102 (if (< arg 0)
@@ -2067,19 +2108,16 @@ Use filename, if current buffer being edited shorten to just buffer name."
2067 (let ((reg) 2108 (let ((reg)
2068 (elsec 1) 2109 (elsec 1)
2069 (found nil) 2110 (found nil)
2070 (st (point)) 2111 (st (point)))
2071 )
2072 (if (not (looking-at "\\<")) 2112 (if (not (looking-at "\\<"))
2073 (forward-word -1)) 2113 (forward-word -1))
2074 (cond 2114 (cond
2075 ((verilog-skip-backward-comment-or-string) 2115 ((verilog-skip-backward-comment-or-string))
2076 )
2077 ((looking-at "\\<else\\>") 2116 ((looking-at "\\<else\\>")
2078 (setq reg (concat 2117 (setq reg (concat
2079 verilog-end-block-re 2118 verilog-end-block-re
2080 "\\|\\(\\<else\\>\\)" 2119 "\\|\\(\\<else\\>\\)"
2081 "\\|\\(\\<if\\>\\)" 2120 "\\|\\(\\<if\\>\\)"))
2082 ))
2083 (while (and (not found) 2121 (while (and (not found)
2084 (verilog-re-search-backward reg nil 'move)) 2122 (verilog-re-search-backward reg nil 'move))
2085 (cond 2123 (cond
@@ -2094,11 +2132,7 @@ Use filename, if current buffer being edited shorten to just buffer name."
2094 (setq elsec (1- elsec)) 2132 (setq elsec (1- elsec))
2095 (if (= 0 elsec) 2133 (if (= 0 elsec)
2096 ;; Now previous line describes syntax 2134 ;; Now previous line describes syntax
2097 (setq found 't) 2135 (setq found 't))))))
2098 ))
2099 )
2100 )
2101 )
2102 ((looking-at verilog-end-block-re) 2136 ((looking-at verilog-end-block-re)
2103 (verilog-leap-to-head)) 2137 (verilog-leap-to-head))
2104 ((looking-at "\\(endmodule\\>\\)\\|\\(\\<endprimitive\\>\\)\\|\\(\\<endclass\\>\\)\\|\\(\\<endprogram\\>\\)\\|\\(\\<endinterface\\>\\)\\|\\(\\<endpackage\\>\\)") 2138 ((looking-at "\\(endmodule\\>\\)\\|\\(\\<endprimitive\\>\\)\\|\\(\\<endclass\\>\\)\\|\\(\\<endprogram\\>\\)\\|\\(\\<endinterface\\>\\)\\|\\(\\<endpackage\\>\\)")
@@ -2120,9 +2154,7 @@ Use filename, if current buffer being edited shorten to just buffer name."
2120 (backward-sexp 1)))) 2154 (backward-sexp 1))))
2121 (t 2155 (t
2122 (goto-char st) 2156 (goto-char st)
2123 (backward-sexp)) 2157 (backward-sexp)))))
2124 ) ;; cond
2125 ))
2126 2158
2127(defun verilog-forward-sexp () 2159(defun verilog-forward-sexp ()
2128 (let ((reg) 2160 (let ((reg)
@@ -2132,8 +2164,7 @@ Use filename, if current buffer being edited shorten to just buffer name."
2132 (forward-word -1)) 2164 (forward-word -1))
2133 (cond 2165 (cond
2134 ((verilog-skip-forward-comment-or-string) 2166 ((verilog-skip-forward-comment-or-string)
2135 (verilog-forward-syntactic-ws) 2167 (verilog-forward-syntactic-ws))
2136 )
2137 ((looking-at verilog-beg-block-re-ordered);; begin|case|fork|class|table|specify|function|task|generate|covergroup|property|sequence|clocking 2168 ((looking-at verilog-beg-block-re-ordered);; begin|case|fork|class|table|specify|function|task|generate|covergroup|property|sequence|clocking
2138 (cond 2169 (cond
2139 ((match-end 1) ; end 2170 ((match-end 1) ; end
@@ -2141,8 +2172,7 @@ Use filename, if current buffer being edited shorten to just buffer name."
2141 (setq reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)" )) 2172 (setq reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)" ))
2142 ((match-end 2) ; endcase 2173 ((match-end 2) ; endcase
2143 ;; Search forward for matching case 2174 ;; Search forward for matching case
2144 (setq reg "\\(\\<randcase\\>\\|\\(\\<unique\\>\\s-+\\|\\<priority\\>\\s-+\\)?\\<case[xz]?\\>[^:]\\)\\|\\(\\<endcase\\>\\)" ) 2175 (setq reg "\\(\\<randcase\\>\\|\\(\\<unique\\>\\s-+\\|\\<priority\\>\\s-+\\)?\\<case[xz]?\\>[^:]\\)\\|\\(\\<endcase\\>\\)" ))
2145 )
2146 ((match-end 3) ; join 2176 ((match-end 3) ; join
2147 ;; Search forward for matching fork 2177 ;; Search forward for matching fork
2148 (setq reg "\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" )) 2178 (setq reg "\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" ))
@@ -2173,12 +2203,10 @@ Use filename, if current buffer being edited shorten to just buffer name."
2173 ((match-end 12) ; endsequence 2203 ((match-end 12) ; endsequence
2174 ;; Search forward for matching sequence 2204 ;; Search forward for matching sequence
2175 (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" ) 2205 (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" )
2176 (setq md 3) ; 3 to get to endsequence in the reg above 2206 (setq md 3)) ; 3 to get to endsequence in the reg above
2177 )
2178 ((match-end 13) ; endclocking 2207 ((match-end 13) ; endclocking
2179 ;; Search forward for matching clocking 2208 ;; Search forward for matching clocking
2180 (setq reg "\\(\\<clocking\\>\\)\\|\\(\\<endclocking\\>\\)" )) 2209 (setq reg "\\(\\<clocking\\>\\)\\|\\(\\<endclocking\\>\\)" )))
2181 )
2182 (if (forward-word 1) 2210 (if (forward-word 1)
2183 (catch 'skip 2211 (catch 'skip
2184 (let ((nest 1)) 2212 (let ((nest 1))
@@ -2189,9 +2217,7 @@ Use filename, if current buffer being edited shorten to just buffer name."
2189 (if (= 0 nest) ; we are out! 2217 (if (= 0 nest) ; we are out!
2190 (throw 'skip 1))) 2218 (throw 'skip 1)))
2191 ((match-end 1) ; the opener in reg, so we are deeper now 2219 ((match-end 1) ; the opener in reg, so we are deeper now
2192 (setq nest (1+ nest))))) 2220 (setq nest (1+ nest)))))))))
2193 )))
2194 )
2195 ((looking-at (concat 2221 ((looking-at (concat
2196 "\\(\\<\\(macro\\)?module\\>\\)\\|" 2222 "\\(\\<\\(macro\\)?module\\>\\)\\|"
2197 "\\(\\<primitive\\>\\)\\|" 2223 "\\(\\<primitive\\>\\)\\|"
@@ -2221,9 +2247,7 @@ Use filename, if current buffer being edited shorten to just buffer name."
2221 (goto-char st) 2247 (goto-char st)
2222 (if (= (following-char) ?\) ) 2248 (if (= (following-char) ?\) )
2223 (forward-char 1) 2249 (forward-char 1)
2224 (forward-sexp 1))) 2250 (forward-sexp 1))))))
2225 ) ;; cond
2226 ))
2227 2251
2228(defun verilog-declaration-beg () 2252(defun verilog-declaration-beg ()
2229 (verilog-re-search-backward verilog-declaration-re (bobp) t)) 2253 (verilog-re-search-backward verilog-declaration-re (bobp) t))
@@ -2238,8 +2262,7 @@ Use filename, if current buffer being edited shorten to just buffer name."
2238 (list 2262 (list
2239 ;; Fontify things in translate off regions 2263 ;; Fontify things in translate off regions
2240 '(verilog-match-translate-off 2264 '(verilog-match-translate-off
2241 (0 'verilog-font-lock-translate-off-face prepend)) 2265 (0 'verilog-font-lock-translate-off-face prepend))))))
2242 ))))
2243 (put 'verilog-mode 'font-lock-defaults 2266 (put 'verilog-mode 'font-lock-defaults
2244 '((verilog-font-lock-keywords 2267 '((verilog-font-lock-keywords
2245 verilog-font-lock-keywords-1 2268 verilog-font-lock-keywords-1
@@ -2253,23 +2276,7 @@ Use filename, if current buffer being edited shorten to just buffer name."
2253 2276
2254;; initialize fontification for Verilog Mode 2277;; initialize fontification for Verilog Mode
2255(verilog-font-lock-init) 2278(verilog-font-lock-init)
2256;; start up message 2279
2257(defconst verilog-startup-message-lines
2258 '("Please use \\[verilog-submit-bug-report] to report bugs."
2259 "Visit http://www.verilog.com to check for updates"
2260 ))
2261(defvar verilog-startup-message-displayed t)
2262(defun verilog-display-startup-message ()
2263 (if (not verilog-startup-message-displayed)
2264 (if (sit-for 5)
2265 (let ((lines verilog-startup-message-lines))
2266 (message "verilog-mode version %s, released %s; type \\[describe-mode] for help"
2267 verilog-mode-version verilog-mode-release-date)
2268 (setq verilog-startup-message-displayed t)
2269 (while (and (sit-for 4) lines)
2270 (message (substitute-command-keys (car lines)))
2271 (setq lines (cdr lines)))))
2272 (message "")))
2273;; 2280;;
2274;; 2281;;
2275;; Mode 2282;; Mode
@@ -2411,9 +2418,9 @@ Key bindings specific to `verilog-mode-map' are:
2411 (setq local-abbrev-table verilog-mode-abbrev-table) 2418 (setq local-abbrev-table verilog-mode-abbrev-table)
2412 (setq verilog-mode-syntax-table (make-syntax-table)) 2419 (setq verilog-mode-syntax-table (make-syntax-table))
2413 (verilog-populate-syntax-table verilog-mode-syntax-table) 2420 (verilog-populate-syntax-table verilog-mode-syntax-table)
2414 (set (make-local-variable 'beginning-of-defun-function) 2421 (set (make-local-variable 'beginning-of-defun-function)
2415 'verilog-beg-of-defun) 2422 'verilog-beg-of-defun)
2416 (set (make-local-variable 'end-of-defun-function) 2423 (set (make-local-variable 'end-of-defun-function)
2417 'verilog-end-of-defun) 2424 'verilog-end-of-defun)
2418 ;; add extra comment syntax 2425 ;; add extra comment syntax
2419 (verilog-setup-dual-comments verilog-mode-syntax-table) 2426 (verilog-setup-dual-comments verilog-mode-syntax-table)
@@ -2444,8 +2451,8 @@ Key bindings specific to `verilog-mode-map' are:
2444 (not (assoc "Verilog" current-menubar))) 2451 (not (assoc "Verilog" current-menubar)))
2445 ;; (set-buffer-menubar (copy-sequence current-menubar)) 2452 ;; (set-buffer-menubar (copy-sequence current-menubar))
2446 (add-submenu nil verilog-xemacs-menu) 2453 (add-submenu nil verilog-xemacs-menu)
2447 (add-submenu nil verilog-stmt-menu) 2454 (add-submenu nil verilog-stmt-menu)))
2448 )) 2455
2449 ;; Stuff for GNU emacs 2456 ;; Stuff for GNU emacs
2450 (set (make-local-variable 'font-lock-defaults) 2457 (set (make-local-variable 'font-lock-defaults)
2451 '((verilog-font-lock-keywords verilog-font-lock-keywords-1 2458 '((verilog-font-lock-keywords verilog-font-lock-keywords-1
@@ -2472,8 +2479,6 @@ Key bindings specific to `verilog-mode-map' are:
2472 (cons '(verilog-mode-mode "\\<begin\\>" "\\<end\\>" nil 2479 (cons '(verilog-mode-mode "\\<begin\\>" "\\<end\\>" nil
2473 verilog-forward-sexp-function) 2480 verilog-forward-sexp-function)
2474 hs-special-modes-alist))) 2481 hs-special-modes-alist)))
2475 ;; Display version splash information.
2476 (verilog-display-startup-message)
2477 2482
2478 ;; Stuff for autos 2483 ;; Stuff for autos
2479 (add-hook 'write-contents-hooks 'verilog-auto-save-check) ; already local 2484 (add-hook 'write-contents-hooks 'verilog-auto-save-check) ; already local
@@ -2527,27 +2532,19 @@ With optional ARG, remove existing end of line comments."
2527 (progn 2532 (progn
2528 (end-of-line) 2533 (end-of-line)
2529 (delete-horizontal-space) 2534 (delete-horizontal-space)
2530 't 2535 't)))
2531 )
2532 )
2533 )
2534 ;; see if we should line up assignments 2536 ;; see if we should line up assignments
2535 (progn 2537 (progn
2536 (if (or (memq 'all verilog-auto-lineup) 2538 (if (or (memq 'all verilog-auto-lineup)
2537 (memq 'assignments verilog-auto-lineup)) 2539 (memq 'assignments verilog-auto-lineup))
2538 (verilog-pretty-expr) 2540 (verilog-pretty-expr))
2539 ) 2541 (newline))
2540 (newline) 2542 (forward-line 1))
2541 )
2542 (forward-line 1)
2543 )
2544 ;; Indent next line 2543 ;; Indent next line
2545 (if verilog-auto-indent-on-newline 2544 (if verilog-auto-indent-on-newline
2546 (verilog-indent-line)) 2545 (verilog-indent-line)))
2547 )
2548 (t 2546 (t
2549 (newline)) 2547 (newline)))))
2550 )))
2551 2548
2552(defun electric-verilog-terminate-and-indent () 2549(defun electric-verilog-terminate-and-indent ()
2553 "Insert a newline and indent for the next statement." 2550 "Insert a newline and indent for the next statement."
@@ -2565,8 +2562,7 @@ With optional ARG, remove existing end of line comments."
2565 (save-excursion 2562 (save-excursion
2566 (beginning-of-line) 2563 (beginning-of-line)
2567 (verilog-forward-ws&directives) 2564 (verilog-forward-ws&directives)
2568 (verilog-indent-line) 2565 (verilog-indent-line))
2569 )
2570 (if (and verilog-auto-newline 2566 (if (and verilog-auto-newline
2571 (not (verilog-parenthesis-depth))) 2567 (not (verilog-parenthesis-depth)))
2572 (electric-verilog-terminate-line)))) 2568 (electric-verilog-terminate-line))))
@@ -2648,9 +2644,7 @@ With optional ARG, remove existing end of line comments."
2648 (re-search-forward comment-start-skip oldpnt 'move) 2644 (re-search-forward comment-start-skip oldpnt 'move)
2649 (goto-char (match-beginning 0)) 2645 (goto-char (match-beginning 0))
2650 (skip-chars-backward " \t") 2646 (skip-chars-backward " \t")
2651 (kill-region (point) oldpnt) 2647 (kill-region (point) oldpnt))))))
2652 ))))
2653 )
2654 (progn (insert "\t")))) 2648 (progn (insert "\t"))))
2655 2649
2656 2650
@@ -2690,7 +2684,7 @@ To call this from the command line, see \\[verilog-batch-indent]."
2690 (insert " * ")) 2684 (insert " * "))
2691 2685
2692(defun verilog-insert-1 (fmt max) 2686(defun verilog-insert-1 (fmt max)
2693 "Insert integers 0 to MAX-1 according to format string FMT. 2687 "Use format string FMT to insert integers 0 to MAX - 1.
2694Inserts one integer per line, at the current column. Stops early 2688Inserts one integer per line, at the current column. Stops early
2695if it reaches the end of the buffer." 2689if it reaches the end of the buffer."
2696 (let ((col (current-column)) 2690 (let ((col (current-column))
@@ -2724,7 +2718,7 @@ located after the first 'a' gives:
2724 a = b a[ 7] = b 2718 a = b a[ 7] = b
2725 a = b a[ 8] = b" 2719 a = b a[ 8] = b"
2726 2720
2727 (interactive "NMAX? ") 2721 (interactive "NMAX: ")
2728 (verilog-insert-1 "[%3d]" max)) 2722 (verilog-insert-1 "[%3d]" max))
2729 2723
2730(defun verilog-generate-numbers (max) 2724(defun verilog-generate-numbers (max)
@@ -2744,7 +2738,7 @@ following code fragment:
2744 buf buf buf buf007 2738 buf buf buf buf007
2745 buf buf buf buf008" 2739 buf buf buf buf008"
2746 2740
2747 (interactive "NMAX? ") 2741 (interactive "NMAX: ")
2748 (verilog-insert-1 "%3.3d" max)) 2742 (verilog-insert-1 "%3.3d" max))
2749 2743
2750(defun verilog-mark-defun () 2744(defun verilog-mark-defun ()
@@ -2792,8 +2786,7 @@ The commented area starts with `verilog-exclude-str-start', and ends with
2792 (save-excursion 2786 (save-excursion
2793 (let ((s+1 (1+ start))) 2787 (let ((s+1 (1+ start)))
2794 (while (re-search-backward "/\\*" s+1 t) 2788 (while (re-search-backward "/\\*" s+1 t)
2795 (replace-match "/-*" t t)))) 2789 (replace-match "/-*" t t))))))
2796 ))
2797 2790
2798(defun verilog-uncomment-region () 2791(defun verilog-uncomment-region ()
2799 "Uncomment a commented area; change deformed comments back to normal. 2792 "Uncomment a commented area; change deformed comments back to normal.
@@ -2869,8 +2862,7 @@ With ARG, first kill any existing labels."
2869 (point-marker))) 2862 (point-marker)))
2870 (e (progn 2863 (e (progn
2871 (verilog-end-of-defun) 2864 (verilog-end-of-defun)
2872 (point-marker))) 2865 (point-marker))))
2873 )
2874 (goto-char (marker-position b)) 2866 (goto-char (marker-position b))
2875 (if (> (- e b) 200) 2867 (if (> (- e b) 200)
2876 (message "Relabeling module...")) 2868 (message "Relabeling module..."))
@@ -2885,18 +2877,15 @@ With ARG, first kill any existing labels."
2885 (let ((indent-str (verilog-indent-line))) 2877 (let ((indent-str (verilog-indent-line)))
2886 (verilog-set-auto-endcomments indent-str 't) 2878 (verilog-set-auto-endcomments indent-str 't)
2887 (end-of-line) 2879 (end-of-line)
2888 (delete-horizontal-space) 2880 (delete-horizontal-space))
2889 )
2890 (setq cnt (1+ cnt)) 2881 (setq cnt (1+ cnt))
2891 (if (= 9 (% cnt 10)) 2882 (if (= 9 (% cnt 10))
2892 (message "%d..." cnt)) 2883 (message "%d..." cnt)))
2893 )
2894 (goto-char oldpos) 2884 (goto-char oldpos)
2895 (if (or 2885 (if (or
2896 (> (- e b) 200) 2886 (> (- e b) 200)
2897 (> cnt 20)) 2887 (> cnt 20))
2898 (message "%d lines auto commented" cnt)) 2888 (message "%d lines auto commented" cnt))))
2899 ))
2900 2889
2901(defun verilog-beg-of-statement () 2890(defun verilog-beg-of-statement ()
2902 "Move backward to beginning of statement." 2891 "Move backward to beginning of statement."
@@ -2919,15 +2908,13 @@ With ARG, first kill any existing labels."
2919 (looking-at verilog-extended-complete-re) 2908 (looking-at verilog-extended-complete-re)
2920 (not (save-excursion 2909 (not (save-excursion
2921 (verilog-backward-token) 2910 (verilog-backward-token)
2922 (looking-at verilog-extended-complete-re))) 2911 (looking-at verilog-extended-complete-re))))
2923 )
2924 (looking-at verilog-basic-complete-re) 2912 (looking-at verilog-basic-complete-re)
2925 (save-excursion 2913 (save-excursion
2926 (verilog-backward-token) 2914 (verilog-backward-token)
2927 (or 2915 (or
2928 (looking-at verilog-end-block-re) 2916 (looking-at verilog-end-block-re)
2929 (looking-at verilog-preprocessor-re))) 2917 (looking-at verilog-preprocessor-re)))))
2930 ))
2931 (verilog-backward-syntactic-ws) 2918 (verilog-backward-syntactic-ws)
2932 (verilog-backward-token)) 2919 (verilog-backward-token))
2933 ;; Now point is where the previous line ended. 2920 ;; Now point is where the previous line ended.
@@ -3011,9 +2998,9 @@ more specifically, point @ in the line foo : @ begin"
3011 (throw 'found 1)) 2998 (throw 'found 1))
3012 (setq nest (1- nest))) 2999 (setq nest (1- nest)))
3013 (t 3000 (t
3014 (throw 'found (= nest 0))) 3001 (throw 'found (= nest 0)))))))
3015 ))))
3016 nil))) 3002 nil)))
3003
3017(defun verilog-in-struct-region-p () 3004(defun verilog-in-struct-region-p ()
3018 "Return TRUE if in a struct region; 3005 "Return TRUE if in a struct region;
3019more specifically, in a list after a struct|union keyword" 3006more specifically, in a list after a struct|union keyword"
@@ -3024,20 +3011,14 @@ more specifically, in a list after a struct|union keyword"
3024 (if depth 3011 (if depth
3025 (progn (backward-up-list depth) 3012 (progn (backward-up-list depth)
3026 (verilog-beg-of-statement) 3013 (verilog-beg-of-statement)
3027 (looking-at "\\<typedef\\>?\\s-*\\<struct\\|union\\>") 3014 (looking-at "\\<typedef\\>?\\s-*\\<struct\\|union\\>"))))))
3028 )
3029 )
3030 )
3031 )
3032 )
3033 3015
3034(defun verilog-in-generate-region-p () 3016(defun verilog-in-generate-region-p ()
3035 "Return TRUE if in a generate region; 3017 "Return TRUE if in a generate region;
3036more specifically, after a generate and before an endgenerate" 3018more specifically, after a generate and before an endgenerate"
3037 (interactive) 3019 (interactive)
3038 (let ((lim (save-excursion (verilog-beg-of-defun) (point))) 3020 (let ((lim (save-excursion (verilog-beg-of-defun) (point)))
3039 (nest 1) 3021 (nest 1))
3040 )
3041 (save-excursion 3022 (save-excursion
3042 (while (and 3023 (while (and
3043 (/= nest 0) 3024 (/= nest 0)
@@ -3046,17 +3027,14 @@ more specifically, after a generate and before an endgenerate"
3046 ((match-end 1) ; generate 3027 ((match-end 1) ; generate
3047 (setq nest (1- nest))) 3028 (setq nest (1- nest)))
3048 ((match-end 2) ; endgenerate 3029 ((match-end 2) ; endgenerate
3049 (setq nest (1+ nest))) 3030 (setq nest (1+ nest)))))))
3050 ))
3051 ))
3052 (= nest 0) )) ; return nest 3031 (= nest 0) )) ; return nest
3053 3032
3054(defun verilog-in-fork-region-p () 3033(defun verilog-in-fork-region-p ()
3055 "Return true if between a fork and join." 3034 "Return true if between a fork and join."
3056 (interactive) 3035 (interactive)
3057 (let ((lim (save-excursion (verilog-beg-of-defun) (point))) 3036 (let ((lim (save-excursion (verilog-beg-of-defun) (point)))
3058 (nest 1) 3037 (nest 1))
3059 )
3060 (save-excursion 3038 (save-excursion
3061 (while (and 3039 (while (and
3062 (/= nest 0) 3040 (/= nest 0)
@@ -3065,9 +3043,7 @@ more specifically, after a generate and before an endgenerate"
3065 ((match-end 1) ; fork 3043 ((match-end 1) ; fork
3066 (setq nest (1- nest))) 3044 (setq nest (1- nest)))
3067 ((match-end 2) ; join 3045 ((match-end 2) ; join
3068 (setq nest (1+ nest))) 3046 (setq nest (1+ nest)))))))
3069 ))
3070 ))
3071 (= nest 0) )) ; return nest 3047 (= nest 0) )) ; return nest
3072 3048
3073(defun verilog-backward-case-item (lim) 3049(defun verilog-backward-case-item (lim)
@@ -3099,8 +3075,7 @@ Limit search to point LIM."
3099 (setq colon (1- colon))) 3075 (setq colon (1- colon)))
3100 3076
3101 ((match-end 3) ;; : 3077 ((match-end 3) ;; :
3102 (setq colon (1+ colon))) 3078 (setq colon (1+ colon)))))
3103 ))
3104 ;; Skip back to beginning of case item 3079 ;; Skip back to beginning of case item
3105 (skip-chars-backward "\t ") 3080 (skip-chars-backward "\t ")
3106 (verilog-skip-backward-comment-or-string) 3081 (verilog-skip-backward-comment-or-string)
@@ -3123,10 +3098,8 @@ Limit search to point LIM."
3123 (t 3098 (t
3124 (goto-char (match-end 0)) 3099 (goto-char (match-end 0))
3125 (verilog-forward-ws&directives) 3100 (verilog-forward-ws&directives)
3126 (point)) 3101 (point))))
3127 )) 3102 (error "Malformed case item"))))
3128 (error "Malformed case item")
3129 )))
3130 (setq str (buffer-substring b e)) 3103 (setq str (buffer-substring b e))
3131 (if 3104 (if
3132 (setq e 3105 (setq e
@@ -3178,8 +3151,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3178 (search-backward "//" (verilog-get-beg-of-line) t))))) 3151 (search-backward "//" (verilog-get-beg-of-line) t)))))
3179 (let ((nest 1) b e 3152 (let ((nest 1) b e
3180 m 3153 m
3181 (else (if (match-end 2) "!" " ")) 3154 (else (if (match-end 2) "!" " ")))
3182 )
3183 (end-of-line) 3155 (end-of-line)
3184 (if kill-existing-comment 3156 (if kill-existing-comment
3185 (verilog-kill-existing-comment)) 3157 (verilog-kill-existing-comment))
@@ -3199,8 +3171,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3199 ((match-end 4) ; `ifdef 3171 ((match-end 4) ; `ifdef
3200 (setq nest (1- nest))) 3172 (setq nest (1- nest)))
3201 ((match-end 5) ; `ifndef 3173 ((match-end 5) ; `ifndef
3202 (setq nest (1- nest))) 3174 (setq nest (1- nest)))))
3203 ))
3204 (if (match-end 0) 3175 (if (match-end 0)
3205 (setq 3176 (setq
3206 m (buffer-substring 3177 m (buffer-substring
@@ -3212,15 +3183,13 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3212 (point)) 3183 (point))
3213 e (progn 3184 e (progn
3214 (skip-chars-forward "a-zA-Z0-9_") 3185 (skip-chars-forward "a-zA-Z0-9_")
3215 (point) 3186 (point)))))
3216 ))))
3217 (if b 3187 (if b
3218 (if (> (count-lines (point) b) verilog-minimum-comment-distance) 3188 (if (> (count-lines (point) b) verilog-minimum-comment-distance)
3219 (insert (concat " // " else m " " (buffer-substring b e)))) 3189 (insert (concat " // " else m " " (buffer-substring b e))))
3220 (progn 3190 (progn
3221 (insert " // unmatched `else or `endif") 3191 (insert " // unmatched `else or `endif")
3222 (ding 't)) 3192 (ding 't)))))
3223 )))
3224 3193
3225 (; Comment close case/class/function/task/module and named block 3194 (; Comment close case/class/function/task/module and named block
3226 (and (looking-at "\\<end") 3195 (and (looking-at "\\<end")
@@ -3269,8 +3238,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3269 (err 't) 3238 (err 't)
3270 (here (point)) 3239 (here (point))
3271 there 3240 there
3272 cntx 3241 cntx)
3273 )
3274 (save-excursion 3242 (save-excursion
3275 (verilog-leap-to-head) 3243 (verilog-leap-to-head)
3276 (setq there (point)) 3244 (setq there (point))
@@ -3282,12 +3250,10 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3282 (verilog-kill-existing-comment)) 3250 (verilog-kill-existing-comment))
3283 (delete-horizontal-space) 3251 (delete-horizontal-space)
3284 (insert str) 3252 (insert str)
3285 (ding 't) 3253 (ding 't))
3286 )
3287 (let ((lim 3254 (let ((lim
3288 (save-excursion (verilog-beg-of-defun) (point))) 3255 (save-excursion (verilog-beg-of-defun) (point)))
3289 (here (point)) 3256 (here (point)))
3290 )
3291 (cond 3257 (cond
3292 (;-- handle named block differently 3258 (;-- handle named block differently
3293 (looking-at verilog-named-block-re) 3259 (looking-at verilog-named-block-re)
@@ -3336,8 +3302,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3336 (;- else 3302 (;- else
3337 (match-end 4) 3303 (match-end 4)
3338 (let ((nest 0) 3304 (let ((nest 0)
3339 ( reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)") 3305 ( reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)"))
3340 )
3341 (catch 'skip 3306 (catch 'skip
3342 (while (verilog-re-search-backward reg nil 'move) 3307 (while (verilog-re-search-backward reg nil 'move)
3343 (cond 3308 (cond
@@ -3353,16 +3318,13 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3353 (setq err nil) 3318 (setq err nil)
3354 (setq str (verilog-get-expr)) 3319 (setq str (verilog-get-expr))
3355 (setq str (concat " // else: !if" str )) 3320 (setq str (concat " // else: !if" str ))
3356 (throw 'skip 1)) 3321 (throw 'skip 1)))))))))
3357 )))
3358 ))))
3359 3322
3360 (;- end else 3323 (;- end else
3361 (match-end 5) 3324 (match-end 5)
3362 (goto-char there) 3325 (goto-char there)
3363 (let ((nest 0) 3326 (let ((nest 0)
3364 ( reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)") 3327 (reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)"))
3365 )
3366 (catch 'skip 3328 (catch 'skip
3367 (while (verilog-re-search-backward reg nil 'move) 3329 (while (verilog-re-search-backward reg nil 'move)
3368 (cond 3330 (cond
@@ -3378,9 +3340,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3378 (setq err nil) 3340 (setq err nil)
3379 (setq str (verilog-get-expr)) 3341 (setq str (verilog-get-expr))
3380 (setq str (concat " // else: !if" str )) 3342 (setq str (concat " // else: !if" str ))
3381 (throw 'skip 1)) 3343 (throw 'skip 1)))))))))
3382 )))
3383 ))))
3384 3344
3385 (;- task/function/initial et cetera 3345 (;- task/function/initial et cetera
3386 t 3346 t
@@ -3392,8 +3352,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3392 (setq str (concat " // " cntx str ))) 3352 (setq str (concat " // " cntx str )))
3393 3353
3394 (;-- otherwise... 3354 (;-- otherwise...
3395 (setq str " // auto-endcomment confused ")) 3355 (setq str " // auto-endcomment confused "))))
3396 ))
3397 3356
3398 ((and 3357 ((and
3399 (verilog-in-case-region-p) ;-- handle case item differently 3358 (verilog-in-case-region-p) ;-- handle case item differently
@@ -3431,9 +3390,8 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3431 (match-end 11) ;; of verilog-end-block-ordered-re 3390 (match-end 11) ;; of verilog-end-block-ordered-re
3432 ;;(goto-char there) 3391 ;;(goto-char there)
3433 (let ((nest 0) 3392 (let ((nest 0)
3434 ( reg "\\<\\(class\\)\\|\\(endclass\\)\\|\\(package\\|primitive\\|\\(macro\\)?module\\)\\>") 3393 (reg "\\<\\(class\\)\\|\\(endclass\\)\\|\\(package\\|primitive\\|\\(macro\\)?module\\)\\>")
3435 string 3394 string)
3436 )
3437 (save-excursion 3395 (save-excursion
3438 (catch 'skip 3396 (catch 'skip
3439 (while (verilog-re-search-backward reg nil 'move) 3397 (while (verilog-re-search-backward reg nil 'move)
@@ -3463,8 +3421,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3463 (throw 'skip 1)))) 3421 (throw 'skip 1))))
3464 )))) 3422 ))))
3465 (end-of-line) 3423 (end-of-line)
3466 (insert (concat " // " string ))) 3424 (insert (concat " // " string ))))
3467 )
3468 3425
3469 (;- this is end{function,generate,task,module,primitive,table,generate} 3426 (;- this is end{function,generate,task,module,primitive,table,generate}
3470 ;- which can not be nested. 3427 ;- which can not be nested.
@@ -3479,8 +3436,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3479 (cond 3436 (cond
3480 ((match-end 5) ;; of verilog-end-block-ordered-re 3437 ((match-end 5) ;; of verilog-end-block-ordered-re
3481 (setq reg "\\(\\<function\\>\\)\\|\\(\\<\\(endfunction\\|task\\|\\(macro\\)?module\\|primitive\\)\\>\\)") 3438 (setq reg "\\(\\<function\\>\\)\\|\\(\\<\\(endfunction\\|task\\|\\(macro\\)?module\\|primitive\\)\\>\\)")
3482 (setq width "\\(\\s-*\\(\\[[^]]*\\]\\)\\|\\(real\\(time\\)?\\)\\|\\(integer\\)\\|\\(time\\)\\)?") 3439 (setq width "\\(\\s-*\\(\\[[^]]*\\]\\)\\|\\(real\\(time\\)?\\)\\|\\(integer\\)\\|\\(time\\)\\)?"))
3483 )
3484 ((match-end 6) ;; of verilog-end-block-ordered-re 3440 ((match-end 6) ;; of verilog-end-block-ordered-re
3485 (setq reg "\\(\\<task\\>\\)\\|\\(\\<\\(endtask\\|function\\|\\(macro\\)?module\\|primitive\\)\\>\\)")) 3441 (setq reg "\\(\\<task\\>\\)\\|\\(\\<\\(endtask\\|function\\|\\(macro\\)?module\\|primitive\\)\\>\\)"))
3486 ((match-end 7) ;; of verilog-end-block-ordered-re 3442 ((match-end 7) ;; of verilog-end-block-ordered-re
@@ -3502,8 +3458,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3502 ((match-end 15) ;; of verilog-end-block-ordered-re 3458 ((match-end 15) ;; of verilog-end-block-ordered-re
3503 (setq reg "\\(\\<clocking\\>\\)\\|\\<endclocking\\>")) 3459 (setq reg "\\(\\<clocking\\>\\)\\|\\<endclocking\\>"))
3504 3460
3505 (t (error "Problem in verilog-set-auto-endcomments")) 3461 (t (error "Problem in verilog-set-auto-endcomments")))
3506 )
3507 (let (b e) 3462 (let (b e)
3508 (save-excursion 3463 (save-excursion
3509 (verilog-re-search-backward reg nil 'move) 3464 (verilog-re-search-backward reg nil 'move)
@@ -3515,8 +3470,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3515 (if (and width (looking-at width)) 3470 (if (and width (looking-at width))
3516 (progn 3471 (progn
3517 (goto-char (match-end 0)) 3472 (goto-char (match-end 0))
3518 (verilog-forward-ws&directives) 3473 (verilog-forward-ws&directives)))
3519 ))
3520 (point)) 3474 (point))
3521 e (progn 3475 e (progn
3522 (skip-chars-forward "a-zA-Z0-9_") 3476 (skip-chars-forward "a-zA-Z0-9_")
@@ -3577,8 +3531,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter
3577 b) 3531 b)
3578 ('t 3532 ('t
3579 (skip-chars-forward "^: \t\n\f") 3533 (skip-chars-forward "^: \t\n\f")
3580 (point) 3534 (point)))))
3581 ))))
3582 (str (buffer-substring b e))) 3535 (str (buffer-substring b e)))
3583 (if (setq e (string-match "[ \t]*\\(\\(\n\\)\\|\\(//\\)\\|\\(/\\*\\)\\)" str)) 3536 (if (setq e (string-match "[ \t]*\\(\\(\n\\)\\|\\(//\\)\\|\\(/\\*\\)\\)" str))
3584 (setq str (concat (substring str 0 e) "..."))) 3537 (setq str (concat (substring str 0 e) "...")))
@@ -3601,8 +3554,8 @@ Useful for creating tri's and other expanded fields."
3601 (concat "\\(.*\\)" 3554 (concat "\\(.*\\)"
3602 (regexp-quote bra) 3555 (regexp-quote bra)
3603 "\\([0-9]*\\)\\(:[0-9]*\\|\\)\\(::[0-9---]*\\|\\)" 3556 "\\([0-9]*\\)\\(:[0-9]*\\|\\)\\(::[0-9---]*\\|\\)"
3604 (regexp-quote ket) 3557 (regexp-quote ket)
3605 "\\(.*\\)$") signal-string) 3558 "\\(.*\\)$") signal-string)
3606 (let* ((sig-head (match-string 1 signal-string)) 3559 (let* ((sig-head (match-string 1 signal-string))
3607 (vec-start (string-to-number (match-string 2 signal-string))) 3560 (vec-start (string-to-number (match-string 2 signal-string)))
3608 (vec-end (if (= (match-beginning 3) (match-end 3)) 3561 (vec-end (if (= (match-beginning 3) (match-end 3))
@@ -3765,8 +3718,7 @@ becomes:
3765 ))) 3718 )))
3766 ((verilog-in-star-comment-p) 3719 ((verilog-in-star-comment-p)
3767 (re-search-backward "/\*") 3720 (re-search-backward "/\*")
3768 (insert (format " // surefire lint_off_line %6s" code )) 3721 (insert (format " // surefire lint_off_line %6s" code )))
3769 )
3770 (t 3722 (t
3771 (insert (format " // surefire lint_off_line %6s" code )) 3723 (insert (format " // surefire lint_off_line %6s" code ))
3772 ))))))))) 3724 )))))))))
@@ -3823,11 +3775,11 @@ This lets programs calling batch mode to easily extract error messages."
3823 (setq default-major-mode `verilog-mode) 3775 (setq default-major-mode `verilog-mode)
3824 ;; Ditto files already read in 3776 ;; Ditto files already read in
3825 (mapc (lambda (buf) 3777 (mapc (lambda (buf)
3826 (when (buffer-file-name buf) 3778 (when (buffer-file-name buf)
3827 (save-excursion 3779 (save-excursion
3828 (set-buffer buf) 3780 (set-buffer buf)
3829 (verilog-mode)))) 3781 (verilog-mode))))
3830 (buffer-list)) 3782 (buffer-list))
3831 ;; Process the files 3783 ;; Process the files
3832 (mapcar '(lambda (buf) 3784 (mapcar '(lambda (buf)
3833 (when (buffer-file-name buf) 3785 (when (buffer-file-name buf)
@@ -3943,8 +3895,7 @@ type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)."
3943 (not (verilog-in-coverage)) 3895 (not (verilog-in-coverage))
3944 (verilog-in-paren)) 3896 (verilog-in-paren))
3945 (progn (setq par 1) 3897 (progn (setq par 1)
3946 (throw 'nesting 'block)) 3898 (throw 'nesting 'block)))
3947 )
3948 3899
3949 ;; See if we are continuing a previous line 3900 ;; See if we are continuing a previous line
3950 (while t 3901 (while t
@@ -4026,8 +3977,7 @@ type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)."
4026 (setq reg "\\(\\<class\\>\\)\\|\\(\\<endclass\\>\\)" )) 3977 (setq reg "\\(\\<class\\>\\)\\|\\(\\<endclass\\>\\)" ))
4027 ((match-end 12) ; covergroup 3978 ((match-end 12) ; covergroup
4028 ;; Search back for matching covergroup 3979 ;; Search back for matching covergroup
4029 (setq reg "\\(\\<covergroup\\>\\)\\|\\(\\<endgroup\\>\\)" )) 3980 (setq reg "\\(\\<covergroup\\>\\)\\|\\(\\<endgroup\\>\\)" )))
4030 )
4031 (catch 'skip 3981 (catch 'skip
4032 (while (verilog-re-search-backward reg nil 'move) 3982 (while (verilog-re-search-backward reg nil 'move)
4033 (cond 3983 (cond
@@ -4037,11 +3987,8 @@ type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)."
4037 (throw 'skip 1))) 3987 (throw 'skip 1)))
4038 ((match-end 2) ; end 3988 ((match-end 2) ; end
4039 (setq nest (1+ nest))))) 3989 (setq nest (1+ nest)))))
4040 ) 3990 )))))))
4041 )) 3991 (throw 'nesting (verilog-calc-1)))
4042 ))))
4043 (throw 'nesting (verilog-calc-1))
4044 )
4045 );; catch nesting 3992 );; catch nesting
4046 );; type 3993 );; type
4047 ) 3994 )
@@ -4058,8 +4005,8 @@ type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)."
4058 ((eq type 'defun) 4005 ((eq type 'defun)
4059 (list type 0)) 4006 (list type 0))
4060 (t 4007 (t
4061 (list type (verilog-current-indent-level))))) 4008 (list type (verilog-current-indent-level))))))))
4062 ))) 4009
4063(defun verilog-wai () 4010(defun verilog-wai ()
4064 "Show matching nesting block for debugging." 4011 "Show matching nesting block for debugging."
4065 (interactive) 4012 (interactive)
@@ -4073,8 +4020,7 @@ type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)."
4073 (cond 4020 (cond
4074 ((equal (char-after) ?\{) 4021 ((equal (char-after) ?\{)
4075 (if (verilog-at-constraint-p) 4022 (if (verilog-at-constraint-p)
4076 (throw 'nesting 'block) 4023 (throw 'nesting 'block)))
4077 ))
4078 ((equal (char-after) ?\}) 4024 ((equal (char-after) ?\})
4079 4025
4080 (let ((there (verilog-at-close-constraint-p))) 4026 (let ((there (verilog-at-close-constraint-p)))
@@ -4133,8 +4079,7 @@ type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)."
4133For speed, the searcher looks at the last directive, not the indent 4079For speed, the searcher looks at the last directive, not the indent
4134of the appropriate enclosing block." 4080of the appropriate enclosing block."
4135 (let ((base -1) ;; Indent of the line that determines our indentation 4081 (let ((base -1) ;; Indent of the line that determines our indentation
4136 (ind 0) ;; Relative offset caused by other directives (like `endif on same line as `else) 4082 (ind 0)) ;; Relative offset caused by other directives (like `endif on same line as `else)
4137 )
4138 ;; Start at current location, scan back for another directive 4083 ;; Start at current location, scan back for another directive
4139 4084
4140 (save-excursion 4085 (save-excursion
@@ -4142,8 +4087,7 @@ of the appropriate enclosing block."
4142 (while (and (< base 0) 4087 (while (and (< base 0)
4143 (verilog-re-search-backward verilog-directive-re nil t)) 4088 (verilog-re-search-backward verilog-directive-re nil t))
4144 (cond ((save-excursion (skip-chars-backward " \t") (bolp)) 4089 (cond ((save-excursion (skip-chars-backward " \t") (bolp))
4145 (setq base (current-indentation)) 4090 (setq base (current-indentation))))
4146 ))
4147 (cond ((and (looking-at verilog-directive-end) (< base 0)) ;; Only matters when not at BOL 4091 (cond ((and (looking-at verilog-directive-end) (< base 0)) ;; Only matters when not at BOL
4148 (setq ind (- ind verilog-indent-level-directive))) 4092 (setq ind (- ind verilog-indent-level-directive)))
4149 ((and (looking-at verilog-directive-middle) (>= base 0)) ;; Only matters when at BOL 4093 ((and (looking-at verilog-directive-middle) (>= base 0)) ;; Only matters when at BOL
@@ -4223,8 +4167,7 @@ from endcase to matching case, and so on."
4223 (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" )) 4167 (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" ))
4224 ((looking-at "\\<endclocking\\>") 4168 ((looking-at "\\<endclocking\\>")
4225 ;; 12: Search back for matching clocking 4169 ;; 12: Search back for matching clocking
4226 (setq reg "\\(\\<clocking\\)\\|\\(\\<endclocking\\>\\)" )) 4170 (setq reg "\\(\\<clocking\\)\\|\\(\\<endclocking\\>\\)" )))
4227 )
4228 (if reg 4171 (if reg
4229 (catch 'skip 4172 (catch 'skip
4230 (let (sreg) 4173 (let (sreg)
@@ -4268,9 +4211,7 @@ Set point to where line starts"
4268 (save-excursion 4211 (save-excursion
4269 (skip-chars-backward " \t") 4212 (skip-chars-backward " \t")
4270 (not (bolp)))) 4213 (not (bolp))))
4271 (setq continued (verilog-backward-token)) 4214 (setq continued (verilog-backward-token)))))
4272 ) ;; while
4273 ))
4274 (setq continued nil)) 4215 (setq continued nil))
4275 continued)) 4216 continued))
4276 4217
@@ -4289,15 +4230,13 @@ Set point to where line starts"
4289 (= (preceding-char) ?\}) 4230 (= (preceding-char) ?\})
4290 (progn 4231 (progn
4291 (backward-char) 4232 (backward-char)
4292 (verilog-at-close-constraint-p)) 4233 (verilog-at-close-constraint-p)))
4293 )
4294 (;-- constraint foo { a = b } 4234 (;-- constraint foo { a = b }
4295 ; is a complete statement. *sigh* 4235 ; is a complete statement. *sigh*
4296 (= (preceding-char) ?\{) 4236 (= (preceding-char) ?\{)
4297 (progn 4237 (progn
4298 (backward-char) 4238 (backward-char)
4299 (not (verilog-at-constraint-p))) 4239 (not (verilog-at-constraint-p))))
4300 )
4301 (;-- Could be 'case (foo)' or 'always @(bar)' which is complete 4240 (;-- Could be 'case (foo)' or 'always @(bar)' which is complete
4302 ; also could be simply '@(foo)' 4241 ; also could be simply '@(foo)'
4303 ; or foo u1 #(a=8) 4242 ; or foo u1 #(a=8)
@@ -4322,10 +4261,8 @@ Set point to where line starts"
4322 (verilog-backward-token) 4261 (verilog-backward-token)
4323 (not (looking-at "\\<\\(always\\(_latch\\|_ff\\|_comb\\)?\\|initial\\|while\\)\\>")))) 4262 (not (looking-at "\\<\\(always\\(_latch\\|_ff\\|_comb\\)?\\|initial\\|while\\)\\>"))))
4324 ((= (preceding-char) ?\#) 4263 ((= (preceding-char) ?\#)
4325 (backward-char) 4264 (backward-char))
4326 ) 4265 (t t)))))))
4327 (t t))
4328 )))))
4329 4266
4330 (;-- any of begin|initial|while are complete statements; 'begin : foo' is also complete 4267 (;-- any of begin|initial|while are complete statements; 'begin : foo' is also complete
4331 t 4268 t
@@ -4346,8 +4283,7 @@ Set point to where line starts"
4346 (backward-sexp) 4283 (backward-sexp)
4347 (if (looking-at verilog-nameable-item-re ) 4284 (if (looking-at verilog-nameable-item-re )
4348 nil 4285 nil
4349 t) 4286 t))
4350 )
4351 ((= (preceding-char) ?\#) 4287 ((= (preceding-char) ?\#)
4352 (backward-char) 4288 (backward-char)
4353 t) 4289 t)
@@ -4357,8 +4293,7 @@ Set point to where line starts"
4357 4293
4358 (t 4294 (t
4359 (goto-char back) 4295 (goto-char back)
4360 t) 4296 t))))))))
4361 )))))))
4362 4297
4363(defun verilog-backward-syntactic-ws (&optional bound) 4298(defun verilog-backward-syntactic-ws (&optional bound)
4364 "Backward skip over syntactic whitespace for Emacs 19. 4299 "Backward skip over syntactic whitespace for Emacs 19.
@@ -4370,9 +4305,7 @@ Optional BOUND limits search."
4370 (narrow-to-region bound (point)) 4305 (narrow-to-region bound (point))
4371 (while (/= here (point)) 4306 (while (/= here (point))
4372 (setq here (point)) 4307 (setq here (point))
4373 (verilog-skip-backward-comments) 4308 (verilog-skip-backward-comments))))))
4374 )))
4375 ))
4376 t) 4309 t)
4377 4310
4378(defun verilog-forward-syntactic-ws (&optional bound) 4311(defun verilog-forward-syntactic-ws (&optional bound)
@@ -4380,16 +4313,13 @@ Optional BOUND limits search."
4380Optional BOUND limits search." 4313Optional BOUND limits search."
4381 (save-restriction 4314 (save-restriction
4382 (let* ((bound (or bound (point-max))) 4315 (let* ((bound (or bound (point-max)))
4383 (here bound) 4316 (here bound))
4384 )
4385 (if (> bound (point)) 4317 (if (> bound (point))
4386 (progn 4318 (progn
4387 (narrow-to-region (point) bound) 4319 (narrow-to-region (point) bound)
4388 (while (/= here (point)) 4320 (while (/= here (point))
4389 (setq here (point)) 4321 (setq here (point))
4390 (forward-comment (buffer-size)) 4322 (forward-comment (buffer-size))))))))
4391 )))
4392 )))
4393 4323
4394(defun verilog-backward-ws&directives (&optional bound) 4324(defun verilog-backward-ws&directives (&optional bound)
4395 "Backward skip over syntactic whitespace and compiler directives for Emacs 19. 4325 "Backward skip over syntactic whitespace and compiler directives for Emacs 19.
@@ -4423,9 +4353,7 @@ Optional BOUND limits search."
4423 (point)) 4353 (point))
4424 (t 4354 (t
4425 nil)))) 4355 nil))))
4426 (if p (goto-char p)) 4356 (if p (goto-char p))))))))
4427 )))
4428 )))
4429 4357
4430(defun verilog-forward-ws&directives (&optional bound) 4358(defun verilog-forward-ws&directives (&optional bound)
4431 "Forward skip over syntactic whitespace and compiler directives for Emacs 19. 4359 "Forward skip over syntactic whitespace and compiler directives for Emacs 19.
@@ -4433,8 +4361,7 @@ Optional BOUND limits search."
4433 (save-restriction 4361 (save-restriction
4434 (let* ((bound (or bound (point-max))) 4362 (let* ((bound (or bound (point-max)))
4435 (here bound) 4363 (here bound)
4436 jump 4364 jump)
4437 )
4438 (if (> bound (point)) 4365 (if (> bound (point))
4439 (progn 4366 (progn
4440 (let ((state 4367 (let ((state
@@ -4455,9 +4382,7 @@ Optional BOUND limits search."
4455 (if (looking-at verilog-directive-re-1) 4382 (if (looking-at verilog-directive-re-1)
4456 (setq jump t))) 4383 (setq jump t)))
4457 (if jump 4384 (if jump
4458 (beginning-of-line 2)) 4385 (beginning-of-line 2))))))))
4459 )))
4460 )))
4461 4386
4462(defun verilog-in-comment-p () 4387(defun verilog-in-comment-p ()
4463 "Return true if in a star or // comment." 4388 "Return true if in a star or // comment."
@@ -4537,14 +4462,11 @@ Optional BOUND limits search."
4537 (forward-list) 4462 (forward-list)
4538 (progn (backward-char 1) 4463 (progn (backward-char 1)
4539 (verilog-backward-ws&directives) 4464 (verilog-backward-ws&directives)
4540 (equal (char-before) ?\;)) 4465 (equal (char-before) ?\;))))
4541 ))
4542 ;; maybe 4466 ;; maybe
4543 (verilog-re-search-backward "\\<constraint\\|coverpoint\\|cross\\>" nil 'move) 4467 (verilog-re-search-backward "\\<constraint\\|coverpoint\\|cross\\>" nil 'move)
4544 ;; not 4468 ;; not
4545 nil 4469 nil))
4546 )
4547 )
4548 4470
4549(defun verilog-parenthesis-depth () 4471(defun verilog-parenthesis-depth ()
4550 "Return non zero if in parenthetical-expression." 4472 "Return non zero if in parenthetical-expression."
@@ -4608,8 +4530,7 @@ Optional BOUND limits search."
4608 t) 4530 t)
4609 ((and (not (bobp)) 4531 ((and (not (bobp))
4610 (= (char-before) ?\/) 4532 (= (char-before) ?\/)
4611 (= (char-before (1- (point))) ?\*) 4533 (= (char-before (1- (point))) ?\*))
4612 )
4613 (goto-char (- (point) 2)) 4534 (goto-char (- (point) 2))
4614 t) 4535 t)
4615 (t 4536 (t
@@ -4650,8 +4571,8 @@ Only look at a few lines to determine indent level."
4650 (if (verilog-continued-line) 4571 (if (verilog-continued-line)
4651 (progn 4572 (progn
4652 (goto-char sp) 4573 (goto-char sp)
4653 (setq 4574 (setq indent-str
4654 indent-str (list 'statement (verilog-current-indent-level)))) 4575 (list 'statement (verilog-current-indent-level))))
4655 (goto-char sp1) 4576 (goto-char sp1)
4656 (setq indent-str (list 'block (verilog-current-indent-level))))) 4577 (setq indent-str (list 'block (verilog-current-indent-level)))))
4657 (goto-char sp)) 4578 (goto-char sp))
@@ -4701,16 +4622,13 @@ Only look at a few lines to determine indent level."
4701 (progn 4622 (progn
4702 (forward-char 1) 4623 (forward-char 1)
4703 (backward-up-list -1) 4624 (backward-up-list -1)
4704 (skip-chars-forward " \t"))) 4625 (skip-chars-forward " \t"))))
4705 )
4706 (current-column)) 4626 (current-column))
4707 (progn 4627 (progn
4708 (goto-char fst) 4628 (goto-char fst)
4709 (+ (current-column) verilog-cexp-indent)) 4629 (+ (current-column) verilog-cexp-indent))))))
4710 ))))
4711 (goto-char here) 4630 (goto-char here)
4712 (indent-line-to val)) 4631 (indent-line-to val)))
4713 )
4714 ((= (preceding-char) ?\) ) 4632 ((= (preceding-char) ?\) )
4715 (goto-char here) 4633 (goto-char here)
4716 (let ((val (eval (cdr (assoc type verilog-indent-alist))))) 4634 (let ((val (eval (cdr (assoc type verilog-indent-alist)))))
@@ -4724,8 +4642,7 @@ Only look at a few lines to determine indent level."
4724 (setq val (current-column)) 4642 (setq val (current-column))
4725 (setq val (eval (cdr (assoc type verilog-indent-alist))))) 4643 (setq val (eval (cdr (assoc type verilog-indent-alist)))))
4726 (goto-char here) 4644 (goto-char here)
4727 (indent-line-to val))) 4645 (indent-line-to val))))))
4728 )))
4729 4646
4730 (; handle inside parenthetical expressions 4647 (; handle inside parenthetical expressions
4731 (eq type 'cparenexp) 4648 (eq type 'cparenexp)
@@ -4737,8 +4654,7 @@ Only look at a few lines to determine indent level."
4737 (indent-line-to val) 4654 (indent-line-to val)
4738 (if (and (not (verilog-in-struct-region-p)) 4655 (if (and (not (verilog-in-struct-region-p))
4739 (looking-at verilog-declaration-re)) 4656 (looking-at verilog-declaration-re))
4740 (verilog-indent-declaration ind)) 4657 (verilog-indent-declaration ind))))
4741 ))
4742 4658
4743 (;-- Handle the ends 4659 (;-- Handle the ends
4744 (or 4660 (or
@@ -4774,8 +4690,8 @@ Only look at a few lines to determine indent level."
4774 (;-- Everything else 4690 (;-- Everything else
4775 t 4691 t
4776 (let ((val (eval (cdr (assoc type verilog-indent-alist))))) 4692 (let ((val (eval (cdr (assoc type verilog-indent-alist)))))
4777 (indent-line-to val))) 4693 (indent-line-to val))))
4778 ) 4694
4779 (if (looking-at "[ \t]+$") 4695 (if (looking-at "[ \t]+$")
4780 (skip-chars-forward " \t")) 4696 (skip-chars-forward " \t"))
4781 indent-str ; Return indent data 4697 indent-str ; Return indent data
@@ -4823,8 +4739,7 @@ Do not count named blocks or case-statements."
4823 (t 4739 (t
4824 (save-excursion 4740 (save-excursion
4825 (re-search-backward "//" nil t) 4741 (re-search-backward "//" nil t)
4826 (current-column))) 4742 (current-column))))))
4827 )))
4828 (indent-line-to stcol) 4743 (indent-line-to stcol)
4829 stcol)) 4744 stcol))
4830 4745
@@ -4843,8 +4758,7 @@ Do not count named blocks or case-statements."
4843 (t 4758 (t
4844 (save-excursion 4759 (save-excursion
4845 (re-search-backward "//" nil t) 4760 (re-search-backward "//" nil t)
4846 (current-column))) 4761 (current-column))))))
4847 )))
4848 (progn 4762 (progn
4849 (indent-to stcol) 4763 (indent-to stcol)
4850 (if (and star 4764 (if (and star
@@ -4912,8 +4826,7 @@ ARG is ignored, for `comment-indent-function' compatibility."
4912 (goto-char start) 4826 (goto-char start)
4913 (verilog-do-indent (verilog-calculate-indent)) 4827 (verilog-do-indent (verilog-calculate-indent))
4914 (verilog-forward-ws&directives) 4828 (verilog-forward-ws&directives)
4915 (current-column))) 4829 (current-column))))
4916 )
4917 (goto-char end) 4830 (goto-char end)
4918 (goto-char start) 4831 (goto-char start)
4919 (if (> (- end start) 100) 4832 (if (> (- end start) 100)
@@ -4927,15 +4840,12 @@ ARG is ignored, for `comment-indent-function' compatibility."
4927 (verilog-forward-ws&directives) 4840 (verilog-forward-ws&directives)
4928 (indent-line-to base-ind) 4841 (indent-line-to base-ind)
4929 (verilog-forward-ws&directives) 4842 (verilog-forward-ws&directives)
4930 (verilog-re-search-forward "[ \t\n\f]" e 'move) 4843 (verilog-re-search-forward "[ \t\n\f]" e 'move))
4931 )
4932 (t 4844 (t
4933 (just-one-space) 4845 (just-one-space)
4934 (verilog-re-search-forward "[ \t\n\f]" e 'move) 4846 (verilog-re-search-forward "[ \t\n\f]" e 'move)))
4935 ) 4847 ;;(forward-line)
4936 )
4937 ) 4848 )
4938 ;;(forward-line))
4939 ;; Now find biggest prefix 4849 ;; Now find biggest prefix
4940 (setq ind (verilog-get-lineup-indent start edpos)) 4850 (setq ind (verilog-get-lineup-indent start edpos))
4941 ;; Now indent each line. 4851 ;; Now indent each line.
@@ -4960,21 +4870,19 @@ ARG is ignored, for `comment-indent-function' compatibility."
4960 (indent-to ind)) 4870 (indent-to ind))
4961 (progn 4871 (progn
4962 (just-one-space) 4872 (just-one-space)
4963 (indent-to ind)) 4873 (indent-to ind)))))
4964 )))
4965 ((verilog-continued-line-1 start) 4874 ((verilog-continued-line-1 start)
4966 (goto-char e) 4875 (goto-char e)
4967 (indent-line-to ind)) 4876 (indent-line-to ind))
4968 (t ; Must be comment or white space 4877 (t ; Must be comment or white space
4969 (goto-char e) 4878 (goto-char e)
4970 (verilog-forward-ws&directives) 4879 (verilog-forward-ws&directives)
4971 (forward-line -1)) 4880 (forward-line -1)))
4972 )
4973 (forward-line 1)) 4881 (forward-line 1))
4974 (message ""))))) 4882 (message "")))))
4975 4883
4976(defun verilog-pretty-expr (&optional myre) 4884(defun verilog-pretty-expr (&optional myre)
4977 "Line up expressions around point." 4885 "Line up expressions around point, or optional regexp MYRE."
4978 (interactive "sRegular Expression: ((<|:)?=) ") 4886 (interactive "sRegular Expression: ((<|:)?=) ")
4979 (save-excursion 4887 (save-excursion
4980 (if (or (eq myre nil) 4888 (if (or (eq myre nil)
@@ -4995,8 +4903,7 @@ ARG is ignored, for `comment-indent-function' compatibility."
4995 (beginning-of-line) 4903 (beginning-of-line)
4996 (while (and (not (looking-at (concat "^\\s-*" verilog-complete-reg))) 4904 (while (and (not (looking-at (concat "^\\s-*" verilog-complete-reg)))
4997 (looking-at myre) 4905 (looking-at myre)
4998 (not (bobp)) 4906 (not (bobp)))
4999 )
5000 (setq e (point)) 4907 (setq e (point))
5001 (verilog-backward-syntactic-ws) 4908 (verilog-backward-syntactic-ws)
5002 (beginning-of-line) 4909 (beginning-of-line)
@@ -5015,12 +4922,10 @@ ARG is ignored, for `comment-indent-function' compatibility."
5015 (end-of-line) 4922 (end-of-line)
5016 (setq e (point)) 4923 (setq e (point))
5017 (verilog-forward-syntactic-ws) 4924 (verilog-forward-syntactic-ws)
5018 (beginning-of-line) 4925 (beginning-of-line))
5019 )
5020 e)) 4926 e))
5021 (edpos (set-marker (make-marker) end)) 4927 (edpos (set-marker (make-marker) end))
5022 (ind) 4928 (ind))
5023 )
5024 (goto-char start) 4929 (goto-char start)
5025 (verilog-do-indent (verilog-calculate-indent)) 4930 (verilog-do-indent (verilog-calculate-indent))
5026 (if (> (- end start) 100) 4931 (if (> (- end start) 100)
@@ -5031,8 +4936,7 @@ ARG is ignored, for `comment-indent-function' compatibility."
5031 (beginning-of-line) 4936 (beginning-of-line)
5032 (verilog-just-one-space myre) 4937 (verilog-just-one-space myre)
5033 (end-of-line) 4938 (end-of-line)
5034 (verilog-forward-syntactic-ws) 4939 (verilog-forward-syntactic-ws))
5035 )
5036 4940
5037 ;; Now find biggest prefix 4941 ;; Now find biggest prefix
5038 (setq ind (verilog-get-lineup-indent-2 myre start edpos)) 4942 (setq ind (verilog-get-lineup-indent-2 myre start edpos))
@@ -5049,20 +4953,16 @@ ARG is ignored, for `comment-indent-function' compatibility."
5049 (goto-char (match-end 1)) 4953 (goto-char (match-end 1))
5050 (if (eq (char-after) ?=) 4954 (if (eq (char-after) ?=)
5051 (indent-to (1+ ind)) ; line up the = of the <= with surrounding = 4955 (indent-to (1+ ind)) ; line up the = of the <= with surrounding =
5052 (indent-to ind) 4956 (indent-to ind)))
5053 )
5054 )
5055 ((verilog-continued-line-1 start) 4957 ((verilog-continued-line-1 start)
5056 (goto-char e) 4958 (goto-char e)
5057 (indent-line-to ind)) 4959 (indent-line-to ind))
5058 (t ; Must be comment or white space 4960 (t ; Must be comment or white space
5059 (goto-char e) 4961 (goto-char e)
5060 (verilog-forward-ws&directives) 4962 (verilog-forward-ws&directives)
5061 (forward-line -1)) 4963 (forward-line -1)))
5062 )
5063 (forward-line 1)) 4964 (forward-line 1))
5064 (message "") 4965 (message "")))))
5065 ))))
5066 4966
5067(defun verilog-just-one-space (myre) 4967(defun verilog-just-one-space (myre)
5068 "Remove extra spaces around regular expression MYRE." 4968 "Remove extra spaces around regular expression MYRE."
@@ -5073,12 +4973,10 @@ ARG is ignored, for `comment-indent-function' compatibility."
5073 (p2 (match-end 2))) 4973 (p2 (match-end 2)))
5074 (progn 4974 (progn
5075 (goto-char p2) 4975 (goto-char p2)
5076 (if (looking-at "\\s-") (just-one-space) ) 4976 (if (looking-at "\\s-") (just-one-space))
5077 (goto-char p1) 4977 (goto-char p1)
5078 (forward-char -1) 4978 (forward-char -1)
5079 (if (looking-at "\\s-") (just-one-space)) 4979 (if (looking-at "\\s-") (just-one-space)))))
5080 )
5081 ))
5082 (message "")) 4980 (message ""))
5083 4981
5084(defun verilog-indent-declaration (baseind) 4982(defun verilog-indent-declaration (baseind)
@@ -5093,8 +4991,7 @@ BASEIND is the base indent to offset everything."
5093 (point))) 4991 (point)))
5094 (ind) 4992 (ind)
5095 (val) 4993 (val)
5096 (m1 (make-marker)) 4994 (m1 (make-marker)))
5097 )
5098 (setq val 4995 (setq val
5099 (+ baseind (eval (cdr (assoc 'declaration verilog-indent-alist))))) 4996 (+ baseind (eval (cdr (assoc 'declaration verilog-indent-alist)))))
5100 (indent-line-to val) 4997 (indent-line-to val)
@@ -5125,13 +5022,11 @@ BASEIND is the base indent to offset everything."
5125 (just-one-space) 5022 (just-one-space)
5126 (goto-char (marker-position m1)) 5023 (goto-char (marker-position m1))
5127 (just-one-space) 5024 (just-one-space)
5128 (indent-to ind) 5025 (indent-to ind))
5129 )
5130 (if (/= (current-column) ind) 5026 (if (/= (current-column) ind)
5131 (progn 5027 (progn
5132 (just-one-space) 5028 (just-one-space)
5133 (indent-to ind)) 5029 (indent-to ind)))))
5134 )))
5135 (if (looking-at verilog-declaration-re-2-no-macro) 5030 (if (looking-at verilog-declaration-re-2-no-macro)
5136 (let ((p (match-end 0))) 5031 (let ((p (match-end 0)))
5137 (set-marker m1 p) 5032 (set-marker m1 p)
@@ -5362,11 +5257,8 @@ for matches of `str' and adding the occurrence tp `all' through point END."
5362 (if (or (null verilog-pred) 5257 (if (or (null verilog-pred)
5363 (funcall verilog-pred match)) 5258 (funcall verilog-pred match))
5364 (setq verilog-all (cons match verilog-all))))) 5259 (setq verilog-all (cons match verilog-all)))))
5365 (forward-line 1) 5260 (forward-line 1)))
5366 ) 5261 verilog-all)
5367 )
5368 verilog-all
5369 )
5370 5262
5371(defun verilog-type-completion () 5263(defun verilog-type-completion ()
5372 "Calculate all possible completions for types." 5264 "Calculate all possible completions for types."
@@ -5663,8 +5555,7 @@ If search fails, other files are checked based on
5663 (goto-char pt) 5555 (goto-char pt)
5664 (beginning-of-line)) 5556 (beginning-of-line))
5665 pt) 5557 pt)
5666 (verilog-goto-defun-file label) 5558 (verilog-goto-defun-file label))))
5667 )))
5668 5559
5669;; Eliminate compile warning 5560;; Eliminate compile warning
5670(eval-when-compile 5561(eval-when-compile
@@ -5680,8 +5571,7 @@ If search fails, other files are checked based on
5680 (first 1) 5571 (first 1)
5681 (prevpos (point-min)) 5572 (prevpos (point-min))
5682 (final-context-start (make-marker)) 5573 (final-context-start (make-marker))
5683 (regexp "\\(module\\s-+\\w+\\s-*(\\)\\|\\(\\w+\\s-+\\w+\\s-*(\\)") 5574 (regexp "\\(module\\s-+\\w+\\s-*(\\)\\|\\(\\w+\\s-+\\w+\\s-*(\\)"))
5684 )
5685 (with-output-to-temp-buffer "*Occur*" 5575 (with-output-to-temp-buffer "*Occur*"
5686 (save-excursion 5576 (save-excursion
5687 (message (format "Searching for %s ..." regexp)) 5577 (message (format "Searching for %s ..." regexp))
@@ -5854,8 +5744,7 @@ Bound search by LIMIT. Adapted from
5854 (search-forward "<company>") 5744 (search-forward "<company>")
5855 (replace-match string t t) 5745 (replace-match string t t)
5856 (search-backward "<description>") 5746 (search-backward "<description>")
5857 (replace-match "" t t) 5747 (replace-match "" t t))))
5858 )))
5859 5748
5860;; verilog-header Uses the verilog-insert-date function 5749;; verilog-header Uses the verilog-insert-date function
5861 5750
@@ -5994,8 +5883,7 @@ Duplicate signals are also removed. For example A[2] and A[1] become A[2:1]."
5994 sv-type (verilog-sig-type sig) 5883 sv-type (verilog-sig-type sig)
5995 sv-multidim (verilog-sig-multidim sig) 5884 sv-multidim (verilog-sig-multidim sig)
5996 combo "" 5885 combo ""
5997 buswarn "" 5886 buswarn ""))
5998 ))
5999 ;; Extract bus details 5887 ;; Extract bus details
6000 (setq bus (verilog-sig-bits sig)) 5888 (setq bus (verilog-sig-bits sig))
6001 (cond ((and bus 5889 (cond ((and bus
@@ -6043,16 +5931,15 @@ Duplicate signals are also removed. For example A[2] and A[1] become A[2:1]."
6043 (if sv-highbit 5931 (if sv-highbit
6044 (concat "[" (int-to-string sv-highbit) ":" 5932 (concat "[" (int-to-string sv-highbit) ":"
6045 (int-to-string sv-lowbit) "]"))) 5933 (int-to-string sv-lowbit) "]")))
6046 (concat sv-comment combo buswarn) 5934 (concat sv-comment combo buswarn)
6047 sv-memory sv-enum sv-signed sv-type sv-multidim) 5935 sv-memory sv-enum sv-signed sv-type sv-multidim)
6048 out-list) 5936 out-list)
6049 sv-name nil))) 5937 sv-name nil))))
6050 )
6051 ;; 5938 ;;
6052 out-list)) 5939 out-list))
6053 5940
6054(defun verilog-sig-tieoff (sig &optional no-width) 5941(defun verilog-sig-tieoff (sig &optional no-width)
6055 "Return tieoff expression for given SIGNAL, with appropriate width. 5942 "Return tieoff expression for given SIG, with appropriate width.
6056Ignore width if optional NO-WIDTH is set." 5943Ignore width if optional NO-WIDTH is set."
6057 (let* ((width (if no-width nil (verilog-sig-width sig)))) 5944 (let* ((width (if no-width nil (verilog-sig-width sig))))
6058 (concat 5945 (concat
@@ -6189,8 +6076,7 @@ Return a array of [outputs inouts inputs wire reg assign const]."
6189 (forward-char 1) 6076 (forward-char 1)
6190 (when (< paren sig-paren) 6077 (when (< paren sig-paren)
6191 (setq expect-signal nil)) ; ) that ends variables inside v2k arg list 6078 (setq expect-signal nil)) ; ) that ends variables inside v2k arg list
6192 t) 6079 t))))
6193 )))
6194 ((looking-at "\\s-*\\(\\[[^]]+\\]\\)") 6080 ((looking-at "\\s-*\\(\\[[^]]+\\]\\)")
6195 (goto-char (match-end 0)) 6081 (goto-char (match-end 0))
6196 (cond (newsig ; Memory, not just width. Patch last signal added's memory (nth 3) 6082 (cond (newsig ; Memory, not just width. Patch last signal added's memory (nth 3)
@@ -6272,12 +6158,15 @@ Return a array of [outputs inouts inputs wire reg assign const]."
6272 (nreverse sigs-reg) 6158 (nreverse sigs-reg)
6273 (nreverse sigs-assign) 6159 (nreverse sigs-assign)
6274 (nreverse sigs-const) 6160 (nreverse sigs-const)
6275 (nreverse sigs-gparam) 6161 (nreverse sigs-gparam)))))
6276 ))))
6277 6162
6278(defvar sigs-in) ; Prevent compile warning 6163(eval-when-compile
6279(defvar sigs-inout) ; Prevent compile warning 6164 ;; Prevent compile warnings; these are let's, not globals
6280(defvar sigs-out) ; Prevent compile warning 6165 ;; Do not remove the eval-when-compile
6166 ;; - we want a error when we are debugging this code if they are refed.
6167 (defvar sigs-in)
6168 (defvar sigs-inout)
6169 (defvar sigs-out))
6281 6170
6282 6171
6283(defsubst verilog-modi-get-decls (modi) 6172(defsubst verilog-modi-get-decls (modi)
@@ -6524,10 +6413,16 @@ For example if declare A A (.B(SIG)) then B will be included in the list."
6524 (end-pt (point))) 6413 (end-pt (point)))
6525 (eval-region beg-pt end-pt nil))))) 6414 (eval-region beg-pt end-pt nil)))))
6526 6415
6527;; These are passed in a let, not global 6416(eval-when-compile
6528(defvar got-sig) 6417 ;; Prevent compile warnings; these are let's, not globals
6529(defvar got-rvalue) 6418 ;; Do not remove the eval-when-compile
6530(defvar uses-delayed) 6419 ;; - we want a error when we are debugging this code if they are refed.
6420 (defvar sigs-in)
6421 (defvar sigs-out)
6422 (defvar got-sig)
6423 (defvar got-rvalue)
6424 (defvar uses-delayed)
6425 (defvar vector-skip-list))
6531 6426
6532(defun verilog-read-always-signals-recurse 6427(defun verilog-read-always-signals-recurse
6533 (exit-keywd rvalue ignore-next) 6428 (exit-keywd rvalue ignore-next)
@@ -6653,8 +6548,7 @@ IGNORE-NEXT is true to ignore next token, fake from inside case statement."
6653 (t 6548 (t
6654 (forward-char 1))) 6549 (forward-char 1)))
6655 ;; End of non-comment token 6550 ;; End of non-comment token
6656 (setq last-keywd keywd) 6551 (setq last-keywd keywd)))
6657 ))
6658 (skip-syntax-forward " ")) 6552 (skip-syntax-forward " "))
6659 ;; Append the final pending signal 6553 ;; Append the final pending signal
6660 (when got-sig 6554 (when got-sig
@@ -6700,8 +6594,7 @@ IGNORE-NEXT is true to ignore next token, fake from inside case statement."
6700 (instant (match-string 2))) 6594 (instant (match-string 2)))
6701 (if (not (member module verilog-keywords)) 6595 (if (not (member module verilog-keywords))
6702 (setq instants-list (cons (list module instant) instants-list))))) 6596 (setq instants-list (cons (list module instant) instants-list)))))
6703 (forward-line 1) 6597 (forward-line 1)))
6704 ))
6705 instants-list)) 6598 instants-list))
6706 6599
6707 6600
@@ -6776,8 +6669,7 @@ list of ( (signal_name connection_name)... )"
6776 (t 6669 (t
6777 (error "%s: AUTO_TEMPLATE parsing error: %s" 6670 (error "%s: AUTO_TEMPLATE parsing error: %s"
6778 (verilog-point-text) 6671 (verilog-point-text)
6779 (progn (looking-at ".*$") (match-string 0)))) 6672 (progn (looking-at ".*$") (match-string 0))))))
6780 ))
6781 ;; Return 6673 ;; Return
6782 (vector tpl-regexp 6674 (vector tpl-regexp
6783 (list tpl-sig-list tpl-wild-list))) 6675 (list tpl-sig-list tpl-wild-list)))
@@ -6799,8 +6691,7 @@ Optionally associate it with the specified enumeration ENUMNAME."
6799 (let ((enumvar (intern (concat "venum-" enumname)))) 6691 (let ((enumvar (intern (concat "venum-" enumname))))
6800 ;;(message "Define %s=%s" defname defvalue) (sleep-for 1) 6692 ;;(message "Define %s=%s" defname defvalue) (sleep-for 1)
6801 (make-variable-buffer-local enumvar) 6693 (make-variable-buffer-local enumvar)
6802 (add-to-list enumvar defname))) 6694 (add-to-list enumvar defname)))))
6803 ))
6804 6695
6805(defun verilog-read-defines (&optional filename recurse subcall) 6696(defun verilog-read-defines (&optional filename recurse subcall)
6806 "Read `defines and parameters for the current file, or optional FILENAME. 6697 "Read `defines and parameters for the current file, or optional FILENAME.
@@ -6884,8 +6775,7 @@ warning message, you need to add to your .emacs file:
6884 (while (looking-at "\\s-*,?\\s-*\\([a-zA-Z0-9_$]+\\)\\s-*=\\s-*\\([^;,]*\\),?\\s-*") 6775 (while (looking-at "\\s-*,?\\s-*\\([a-zA-Z0-9_$]+\\)\\s-*=\\s-*\\([^;,]*\\),?\\s-*")
6885 (verilog-set-define (match-string-no-properties 1) (match-string-no-properties 2) origbuf enumname) 6776 (verilog-set-define (match-string-no-properties 1) (match-string-no-properties 2) origbuf enumname)
6886 (goto-char (match-end 0)) 6777 (goto-char (match-end 0))
6887 (forward-comment 999)))) 6778 (forward-comment 999)))))))
6888 )))
6889 6779
6890(defun verilog-read-includes () 6780(defun verilog-read-includes ()
6891 "Read `includes for the current file. 6781 "Read `includes for the current file.
@@ -6950,8 +6840,7 @@ Some macros and such are also found and included. For dinotrace.el"
6950 (or (member keywd verilog-keywords) 6840 (or (member keywd verilog-keywords)
6951 (member keywd sigs-all) 6841 (member keywd sigs-all)
6952 (setq sigs-all (cons keywd sigs-all)))) 6842 (setq sigs-all (cons keywd sigs-all))))
6953 (t (forward-char 1))) 6843 (t (forward-char 1))))
6954 )
6955 ;; Return list 6844 ;; Return list
6956 sigs-all))) 6845 sigs-all)))
6957 6846
@@ -7019,10 +6908,7 @@ Some macros and such are also found and included. For dinotrace.el"
7019 ((string-match "^[^-+]" arg) 6908 ((string-match "^[^-+]" arg)
7020 (verilog-add-list-unique `verilog-library-files arg)) 6909 (verilog-add-list-unique `verilog-library-files arg))
7021 ;; Default - ignore; no warning 6910 ;; Default - ignore; no warning
7022 ) 6911 ))))
7023 )
7024 )
7025 )
7026;;(verilog-getopt (list "+libext+.a+.b" "+incdir+foodir" "+define+a+aval" "-f" "otherf" "-v" "library" "-y" "dir")) 6912;;(verilog-getopt (list "+libext+.a+.b" "+incdir+foodir" "+define+a+aval" "-f" "otherf" "-v" "library" "-y" "dir"))
7027 6913
7028(defun verilog-getopt-file (filename) 6914(defun verilog-getopt-file (filename)
@@ -7096,8 +6982,7 @@ Allows version control to check out the file if need be."
7096 "Return true if SYMBOL is number-like." 6982 "Return true if SYMBOL is number-like."
7097 (or (string-match "^[0-9 \t:]+$" symbol) 6983 (or (string-match "^[0-9 \t:]+$" symbol)
7098 (string-match "^[---]*[0-9]+$" symbol) 6984 (string-match "^[---]*[0-9]+$" symbol)
7099 (string-match "^[0-9 \t]+'s?[hdxbo][0-9a-fA-F_xz? \t]*$" symbol) 6985 (string-match "^[0-9 \t]+'s?[hdxbo][0-9a-fA-F_xz? \t]*$" symbol)))
7100 ))
7101 6986
7102(defun verilog-symbol-detick (symbol wing-it) 6987(defun verilog-symbol-detick (symbol wing-it)
7103 "Return a expanded SYMBOL name without any defines. 6988 "Return a expanded SYMBOL name without any defines.
@@ -7185,13 +7070,11 @@ Or, just the existing dirnames themselves if there are no wildcards."
7185 (setq dirfile (expand-file-name (concat (car dirfiles) rest)) 7070 (setq dirfile (expand-file-name (concat (car dirfiles) rest))
7186 dirfiles (cdr dirfiles)) 7071 dirfiles (cdr dirfiles))
7187 (if (file-directory-p dirfile) 7072 (if (file-directory-p dirfile)
7188 (setq dirlist (cons dirfile dirlist)))) 7073 (setq dirlist (cons dirfile dirlist)))))
7189 )
7190 ;; Defaults 7074 ;; Defaults
7191 (t 7075 (t
7192 (if (file-directory-p dirname) 7076 (if (file-directory-p dirname)
7193 (setq dirlist (cons dirname dirlist)))) 7077 (setq dirlist (cons dirname dirlist))))))
7194 ))
7195 dirlist)) 7078 dirlist))
7196;;(verilog-expand-dirnames (list "." ".." "nonexist" "../*" "/home/wsnyder/*/v")) 7079;;(verilog-expand-dirnames (list "." ".." "nonexist" "../*" "/home/wsnyder/*/v"))
7197 7080
@@ -7295,13 +7178,11 @@ Return modi if successful, else print message unless IGNORE-ERROR is true."
7295 "") 7178 "")
7296 "\n Check the verilog-library-directories variable." 7179 "\n Check the verilog-library-directories variable."
7297 "\n I looked in (if not listed, doesn't exist):\n\t" 7180 "\n I looked in (if not listed, doesn't exist):\n\t"
7298 (mapconcat 'concat orig-filenames "\n\t"))))) 7181 (mapconcat 'concat orig-filenames "\n\t"))))))
7299 )
7300 (setq verilog-modi-lookup-last-mod module 7182 (setq verilog-modi-lookup-last-mod module
7301 verilog-modi-lookup-last-current current 7183 verilog-modi-lookup-last-current current
7302 verilog-modi-lookup-last-tick (buffer-modified-tick))))) 7184 verilog-modi-lookup-last-tick (buffer-modified-tick)))))
7303 verilog-modi-lookup-last-modi 7185 verilog-modi-lookup-last-modi))
7304 ))
7305 7186
7306(defsubst verilog-modi-name (modi) 7187(defsubst verilog-modi-name (modi)
7307 (aref modi 0)) 7188 (aref modi 0))
@@ -7370,8 +7251,7 @@ Cache the output of function so next call may have faster access."
7370 (buffer-modified-tick) 7251 (buffer-modified-tick)
7371 (visited-file-modtime) 7252 (visited-file-modtime)
7372 func-returns) 7253 func-returns)
7373 verilog-modi-cache-list))) 7254 verilog-modi-cache-list)))))
7374 ))
7375 ;; 7255 ;;
7376 func-returns)) 7256 func-returns))
7377 7257
@@ -7483,7 +7363,7 @@ and invalidating the cache."
7483 (funcall func)))) 7363 (funcall func))))
7484 7364
7485(defun verilog-insert-one-definition (sig type indent-pt) 7365(defun verilog-insert-one-definition (sig type indent-pt)
7486 "Print out a definition for SIGNAL of the given TYPE, 7366 "Print out a definition for SIG of the given TYPE,
7487with appropriate INDENT-PT indentation." 7367with appropriate INDENT-PT indentation."
7488 (indent-to indent-pt) 7368 (indent-to indent-pt)
7489 (insert type) 7369 (insert type)
@@ -7594,9 +7474,8 @@ This repairs those mis-inserted by a AUTOARG."
7594 (string-to-number (match-string 2 range-exp))))))) 7474 (string-to-number (match-string 2 range-exp)))))))
7595 ((string-match "^\\(.*\\)\\s *:\\s *\\(.*\\)\\s *$" range-exp) 7475 ((string-match "^\\(.*\\)\\s *:\\s *\\(.*\\)\\s *$" range-exp)
7596 (concat "(1+(" (match-string 1 range-exp) ")" 7476 (concat "(1+(" (match-string 1 range-exp) ")"
7597 (if (equal "0" (match-string 2 range-exp)) 7477 (if (equal "0" (match-string 2 range-exp))
7598 ;; Don't bother with -(0) 7478 "" ;; Don't bother with -(0)
7599 ""
7600 (concat "-(" (match-string 2 range-exp) ")")) 7479 (concat "-(" (match-string 2 range-exp) ")"))
7601 ")")) 7480 ")"))
7602 (t nil))))) 7481 (t nil)))))
@@ -7621,8 +7500,7 @@ This repairs those mis-inserted by a AUTOARG."
7621 ;; End exists 7500 ;; End exists
7622 (end-of-line) 7501 (end-of-line)
7623 (delete-region pt (point)) 7502 (delete-region pt (point))
7624 (forward-line 1)) 7503 (forward-line 1))))
7625 ))
7626 7504
7627(defun verilog-forward-close-paren () 7505(defun verilog-forward-close-paren ()
7628 "Find the close parenthesis that match the current point, 7506 "Find the close parenthesis that match the current point,
@@ -7897,8 +7775,7 @@ Typing \\[verilog-inject-auto] will make this into:
7897 (when (yes-or-no-p "AUTO statements not recomputed, do it now? ") 7775 (when (yes-or-no-p "AUTO statements not recomputed, do it now? ")
7898 (verilog-auto)) 7776 (verilog-auto))
7899 ;; Don't ask again if didn't update 7777 ;; Don't ask again if didn't update
7900 (set (make-local-variable 'verilog-auto-update-tick) (buffer-modified-tick)) 7778 (set (make-local-variable 'verilog-auto-update-tick) (buffer-modified-tick))))
7901 ))
7902 (when (not verilog-auto-star-save) 7779 (when (not verilog-auto-star-save)
7903 (verilog-delete-auto-star-implicit)) 7780 (verilog-delete-auto-star-implicit))
7904 nil) ;; Always return nil -- we don't write the file ourselves 7781 nil) ;; Always return nil -- we don't write the file ourselves
@@ -8008,13 +7885,11 @@ Avoid declaring ports manually, as it makes code harder to maintain."
8008 (verilog-repair-close-comma) 7885 (verilog-repair-close-comma)
8009 (unless (eq (char-before) ?/ ) 7886 (unless (eq (char-before) ?/ )
8010 (insert "\n")) 7887 (insert "\n"))
8011 (indent-to verilog-indent-level-declaration) 7888 (indent-to verilog-indent-level-declaration))))
8012 )))
8013 7889
8014(defun verilog-auto-inst-port-map (port-st) 7890(defun verilog-auto-inst-port-map (port-st)
8015 nil) 7891 nil)
8016 7892
8017(defvar vector-skip-list nil) ; Prevent compile warning
8018(defvar vl-cell-type nil "See `verilog-auto-inst'.") ; Prevent compile warning 7893(defvar vl-cell-type nil "See `verilog-auto-inst'.") ; Prevent compile warning
8019(defvar vl-cell-name nil "See `verilog-auto-inst'.") ; Prevent compile warning 7894(defvar vl-cell-name nil "See `verilog-auto-inst'.") ; Prevent compile warning
8020(defvar vl-name nil "See `verilog-auto-inst'.") ; Prevent compile warning 7895(defvar vl-name nil "See `verilog-auto-inst'.") ; Prevent compile warning
@@ -8025,7 +7900,8 @@ Avoid declaring ports manually, as it makes code harder to maintain."
8025 "Print out a instantiation connection for this PORT-ST. 7900 "Print out a instantiation connection for this PORT-ST.
8026Insert to INDENT-PT, use template TPL-LIST. 7901Insert to INDENT-PT, use template TPL-LIST.
8027@ are instantiation numbers, replaced with TPL-NUM. 7902@ are instantiation numbers, replaced with TPL-NUM.
8028@\"(expression @)\" are evaluated, with @ as a variable." 7903@\"(expression @)\" are evaluated, with @ as a variable.
7904If FOR-STAR add comment it is a .* expansion."
8029 (let* ((port (verilog-sig-name port-st)) 7905 (let* ((port (verilog-sig-name port-st))
8030 (tpl-ass (or (assoc port (car tpl-list)) 7906 (tpl-ass (or (assoc port (car tpl-list))
8031 (verilog-auto-inst-port-map port-st))) 7907 (verilog-auto-inst-port-map port-st)))
@@ -8072,13 +7948,11 @@ Insert to INDENT-PT, use template TPL-LIST.
8072 (prin1 (eval (car (read-from-string expr))) 7948 (prin1 (eval (car (read-from-string expr)))
8073 (lambda (ch) ()))))) 7949 (lambda (ch) ())))))
8074 (if (numberp value) (setq value (number-to-string value))) 7950 (if (numberp value) (setq value (number-to-string value)))
8075 value 7951 value))
8076 ))
8077 (substring tpl-net (match-end 0)))))) 7952 (substring tpl-net (match-end 0))))))
8078 ;; Replace @ and [] magic variables in final output 7953 ;; Replace @ and [] magic variables in final output
8079 (setq tpl-net (verilog-string-replace-matches "@" tpl-num nil nil tpl-net)) 7954 (setq tpl-net (verilog-string-replace-matches "@" tpl-num nil nil tpl-net))
8080 (setq tpl-net (verilog-string-replace-matches "\\[\\]" vl-bits nil nil tpl-net)) 7955 (setq tpl-net (verilog-string-replace-matches "\\[\\]" vl-bits nil nil tpl-net)))
8081 )
8082 (indent-to indent-pt) 7956 (indent-to indent-pt)
8083 (insert "." port) 7957 (insert "." port)
8084 (indent-to verilog-auto-inst-column) 7958 (indent-to verilog-auto-inst-column)
@@ -8462,9 +8336,7 @@ Lisp Templates:
8462 (if (search-forward ")" nil t) ;; From user, moved up a line 8336 (if (search-forward ")" nil t) ;; From user, moved up a line
8463 (delete-backward-char 1)) 8337 (delete-backward-char 1))
8464 (if (search-forward ";" nil t) ;; Don't error if user had syntax error and forgot it 8338 (if (search-forward ";" nil t) ;; Don't error if user had syntax error and forgot it
8465 (delete-backward-char 1)) 8339 (delete-backward-char 1)))))))))
8466 )))
8467 ))))
8468 8340
8469(defun verilog-auto-inst-param () 8341(defun verilog-auto-inst-param ()
8470 "Expand AUTOINSTPARAM statements, as part of \\[verilog-auto]. 8342 "Expand AUTOINSTPARAM statements, as part of \\[verilog-auto].
@@ -8566,9 +8438,7 @@ Templates:
8566 (search-forward "\n") ;; Added by inst-port 8438 (search-forward "\n") ;; Added by inst-port
8567 (delete-backward-char 1) 8439 (delete-backward-char 1)
8568 (if (search-forward ")" nil t) ;; From user, moved up a line 8440 (if (search-forward ")" nil t) ;; From user, moved up a line
8569 (delete-backward-char 1)) 8441 (delete-backward-char 1)))))))))
8570 )))
8571 ))))
8572 8442
8573(defun verilog-auto-reg () 8443(defun verilog-auto-reg ()
8574 "Expand AUTOREG statements, as part of \\[verilog-auto]. 8444 "Expand AUTOREG statements, as part of \\[verilog-auto].
@@ -8612,15 +8482,13 @@ Typing \\[verilog-auto] will make this into:
8612 (verilog-modi-get-consts modi) 8482 (verilog-modi-get-consts modi)
8613 (verilog-modi-get-gparams modi) 8483 (verilog-modi-get-gparams modi)
8614 (verilog-modi-get-sub-outputs modi) 8484 (verilog-modi-get-sub-outputs modi)
8615 (verilog-modi-get-sub-inouts modi) 8485 (verilog-modi-get-sub-inouts modi)))))
8616 ))))
8617 (forward-line 1) 8486 (forward-line 1)
8618 (when sig-list 8487 (when sig-list
8619 (verilog-insert-indent "// Beginning of automatic regs (for this module's undeclared outputs)\n") 8488 (verilog-insert-indent "// Beginning of automatic regs (for this module's undeclared outputs)\n")
8620 (verilog-insert-definition sig-list "reg" indent-pt nil) 8489 (verilog-insert-definition sig-list "reg" indent-pt nil)
8621 (verilog-modi-cache-add-regs modi sig-list) 8490 (verilog-modi-cache-add-regs modi sig-list)
8622 (verilog-insert-indent "// End of automatics\n")) 8491 (verilog-insert-indent "// End of automatics\n")))))
8623 )))
8624 8492
8625(defun verilog-auto-reg-input () 8493(defun verilog-auto-reg-input ()
8626 "Expand AUTOREGINPUT statements, as part of \\[verilog-auto]. 8494 "Expand AUTOREGINPUT statements, as part of \\[verilog-auto].
@@ -8665,15 +8533,13 @@ Typing \\[verilog-auto] will make this into:
8665 (verilog-signals-not-in 8533 (verilog-signals-not-in
8666 (append (verilog-modi-get-sub-inputs modi) 8534 (append (verilog-modi-get-sub-inputs modi)
8667 (verilog-modi-get-sub-inouts modi)) 8535 (verilog-modi-get-sub-inouts modi))
8668 (verilog-modi-get-signals modi) 8536 (verilog-modi-get-signals modi)))))
8669 ))))
8670 (forward-line 1) 8537 (forward-line 1)
8671 (when sig-list 8538 (when sig-list
8672 (verilog-insert-indent "// Beginning of automatic reg inputs (for undeclared instantiated-module inputs)\n") 8539 (verilog-insert-indent "// Beginning of automatic reg inputs (for undeclared instantiated-module inputs)\n")
8673 (verilog-insert-definition sig-list "reg" indent-pt nil) 8540 (verilog-insert-definition sig-list "reg" indent-pt nil)
8674 (verilog-modi-cache-add-regs modi sig-list) 8541 (verilog-modi-cache-add-regs modi sig-list)
8675 (verilog-insert-indent "// End of automatics\n")) 8542 (verilog-insert-indent "// End of automatics\n")))))
8676 )))
8677 8543
8678(defun verilog-auto-wire () 8544(defun verilog-auto-wire ()
8679 "Expand AUTOWIRE statements, as part of \\[verilog-auto]. 8545 "Expand AUTOWIRE statements, as part of \\[verilog-auto].
@@ -8726,8 +8592,7 @@ Typing \\[verilog-auto] will make this into:
8726 (verilog-signals-not-in 8592 (verilog-signals-not-in
8727 (append (verilog-modi-get-sub-outputs modi) 8593 (append (verilog-modi-get-sub-outputs modi)
8728 (verilog-modi-get-sub-inouts modi)) 8594 (verilog-modi-get-sub-inouts modi))
8729 (verilog-modi-get-signals modi) 8595 (verilog-modi-get-signals modi)))))
8730 ))))
8731 (forward-line 1) 8596 (forward-line 1)
8732 (when sig-list 8597 (when sig-list
8733 (verilog-insert-indent "// Beginning of automatic wires (for undeclared instantiated-module outputs)\n") 8598 (verilog-insert-indent "// Beginning of automatic wires (for undeclared instantiated-module outputs)\n")
@@ -8739,8 +8604,7 @@ Typing \\[verilog-auto] will make this into:
8739 (setq pnt (point)) 8604 (setq pnt (point))
8740 (verilog-pretty-declarations) 8605 (verilog-pretty-declarations)
8741 (goto-char pnt) 8606 (goto-char pnt)
8742 (verilog-pretty-expr "//"))) 8607 (verilog-pretty-expr "//"))))))
8743 )))
8744 8608
8745(defun verilog-auto-output () 8609(defun verilog-auto-output ()
8746 "Expand AUTOOUTPUT statements, as part of \\[verilog-auto]. 8610 "Expand AUTOOUTPUT statements, as part of \\[verilog-auto].
@@ -8793,8 +8657,7 @@ Typing \\[verilog-auto] will make this into:
8793 (append (verilog-modi-get-outputs modi) 8657 (append (verilog-modi-get-outputs modi)
8794 (verilog-modi-get-inouts modi) 8658 (verilog-modi-get-inouts modi)
8795 (verilog-modi-get-sub-inputs modi) 8659 (verilog-modi-get-sub-inputs modi)
8796 (verilog-modi-get-sub-inouts modi) 8660 (verilog-modi-get-sub-inouts modi)))))
8797 ))))
8798 (setq sig-list (verilog-signals-not-matching-regexp 8661 (setq sig-list (verilog-signals-not-matching-regexp
8799 sig-list verilog-auto-output-ignore-regexp)) 8662 sig-list verilog-auto-output-ignore-regexp))
8800 (forward-line 1) 8663 (forward-line 1)
@@ -8804,8 +8667,7 @@ Typing \\[verilog-auto] will make this into:
8804 (verilog-insert-definition sig-list "output" indent-pt v2k) 8667 (verilog-insert-definition sig-list "output" indent-pt v2k)
8805 (verilog-modi-cache-add-outputs modi sig-list) 8668 (verilog-modi-cache-add-outputs modi sig-list)
8806 (verilog-insert-indent "// End of automatics\n")) 8669 (verilog-insert-indent "// End of automatics\n"))
8807 (when v2k (verilog-repair-close-comma)) 8670 (when v2k (verilog-repair-close-comma)))))
8808 )))
8809 8671
8810(defun verilog-auto-output-every () 8672(defun verilog-auto-output-every ()
8811 "Expand AUTOOUTPUTEVERY statements, as part of \\[verilog-auto]. 8673 "Expand AUTOOUTPUTEVERY statements, as part of \\[verilog-auto].
@@ -8847,8 +8709,7 @@ Typing \\[verilog-auto] will make this into:
8847 (sig-list (verilog-signals-combine-bus 8709 (sig-list (verilog-signals-combine-bus
8848 (verilog-signals-not-in 8710 (verilog-signals-not-in
8849 (verilog-modi-get-signals modi) 8711 (verilog-modi-get-signals modi)
8850 (verilog-modi-get-ports modi) 8712 (verilog-modi-get-ports modi)))))
8851 ))))
8852 (forward-line 1) 8713 (forward-line 1)
8853 (when v2k (verilog-repair-open-comma)) 8714 (when v2k (verilog-repair-open-comma))
8854 (when sig-list 8715 (when sig-list
@@ -8856,8 +8717,7 @@ Typing \\[verilog-auto] will make this into:
8856 (verilog-insert-definition sig-list "output" indent-pt v2k) 8717 (verilog-insert-definition sig-list "output" indent-pt v2k)
8857 (verilog-modi-cache-add-outputs modi sig-list) 8718 (verilog-modi-cache-add-outputs modi sig-list)
8858 (verilog-insert-indent "// End of automatics\n")) 8719 (verilog-insert-indent "// End of automatics\n"))
8859 (when v2k (verilog-repair-close-comma)) 8720 (when v2k (verilog-repair-close-comma)))))
8860 )))
8861 8721
8862(defun verilog-auto-input () 8722(defun verilog-auto-input ()
8863 "Expand AUTOINPUT statements, as part of \\[verilog-auto]. 8723 "Expand AUTOINPUT statements, as part of \\[verilog-auto].
@@ -8913,8 +8773,7 @@ Typing \\[verilog-auto] will make this into:
8913 (verilog-modi-get-consts modi) 8773 (verilog-modi-get-consts modi)
8914 (verilog-modi-get-gparams modi) 8774 (verilog-modi-get-gparams modi)
8915 (verilog-modi-get-sub-outputs modi) 8775 (verilog-modi-get-sub-outputs modi)
8916 (verilog-modi-get-sub-inouts modi) 8776 (verilog-modi-get-sub-inouts modi)))))
8917 ))))
8918 (setq sig-list (verilog-signals-not-matching-regexp 8777 (setq sig-list (verilog-signals-not-matching-regexp
8919 sig-list verilog-auto-input-ignore-regexp)) 8778 sig-list verilog-auto-input-ignore-regexp))
8920 (forward-line 1) 8779 (forward-line 1)
@@ -8924,8 +8783,7 @@ Typing \\[verilog-auto] will make this into:
8924 (verilog-insert-definition sig-list "input" indent-pt v2k) 8783 (verilog-insert-definition sig-list "input" indent-pt v2k)
8925 (verilog-modi-cache-add-inputs modi sig-list) 8784 (verilog-modi-cache-add-inputs modi sig-list)
8926 (verilog-insert-indent "// End of automatics\n")) 8785 (verilog-insert-indent "// End of automatics\n"))
8927 (when v2k (verilog-repair-close-comma)) 8786 (when v2k (verilog-repair-close-comma)))))
8928 )))
8929 8787
8930(defun verilog-auto-inout () 8788(defun verilog-auto-inout ()
8931 "Expand AUTOINOUT statements, as part of \\[verilog-auto]. 8789 "Expand AUTOINOUT statements, as part of \\[verilog-auto].
@@ -8978,8 +8836,7 @@ Typing \\[verilog-auto] will make this into:
8978 (verilog-modi-get-inouts modi) 8836 (verilog-modi-get-inouts modi)
8979 (verilog-modi-get-inputs modi) 8837 (verilog-modi-get-inputs modi)
8980 (verilog-modi-get-sub-inputs modi) 8838 (verilog-modi-get-sub-inputs modi)
8981 (verilog-modi-get-sub-outputs modi) 8839 (verilog-modi-get-sub-outputs modi)))))
8982 ))))
8983 (setq sig-list (verilog-signals-not-matching-regexp 8840 (setq sig-list (verilog-signals-not-matching-regexp
8984 sig-list verilog-auto-inout-ignore-regexp)) 8841 sig-list verilog-auto-inout-ignore-regexp))
8985 (forward-line 1) 8842 (forward-line 1)
@@ -8989,8 +8846,7 @@ Typing \\[verilog-auto] will make this into:
8989 (verilog-insert-definition sig-list "inout" indent-pt v2k) 8846 (verilog-insert-definition sig-list "inout" indent-pt v2k)
8990 (verilog-modi-cache-add-inouts modi sig-list) 8847 (verilog-modi-cache-add-inouts modi sig-list)
8991 (verilog-insert-indent "// End of automatics\n")) 8848 (verilog-insert-indent "// End of automatics\n"))
8992 (when v2k (verilog-repair-close-comma)) 8849 (when v2k (verilog-repair-close-comma)))))
8993 )))
8994 8850
8995(defun verilog-auto-inout-module () 8851(defun verilog-auto-inout-module ()
8996 "Expand AUTOINOUTMODULE statements, as part of \\[verilog-auto]. 8852 "Expand AUTOINOUTMODULE statements, as part of \\[verilog-auto].
@@ -9062,8 +8918,7 @@ Typing \\[verilog-auto] will make this into:
9062 (verilog-modi-cache-add-outputs modi sig-list-o) 8918 (verilog-modi-cache-add-outputs modi sig-list-o)
9063 (verilog-modi-cache-add-inouts modi sig-list-io) 8919 (verilog-modi-cache-add-inouts modi sig-list-io)
9064 (verilog-insert-indent "// End of automatics\n")) 8920 (verilog-insert-indent "// End of automatics\n"))
9065 (when v2k (verilog-repair-close-comma)) 8921 (when v2k (verilog-repair-close-comma)))))))
9066 )))))
9067 8922
9068(defun verilog-auto-sense-sigs (modi presense-sigs) 8923(defun verilog-auto-sense-sigs (modi presense-sigs)
9069 "Return list of signals for current AUTOSENSE block." 8924 "Return list of signals for current AUTOSENSE block."
@@ -9164,8 +9019,7 @@ Typing \\[verilog-auto] will make this into:
9164 (not-first (insert " or "))) 9019 (not-first (insert " or ")))
9165 (insert (verilog-sig-name (car sig-list))) 9020 (insert (verilog-sig-name (car sig-list)))
9166 (setq sig-list (cdr sig-list) 9021 (setq sig-list (cdr sig-list)
9167 not-first t)) 9022 not-first t)))))
9168 )))
9169 9023
9170(defun verilog-auto-reset () 9024(defun verilog-auto-reset ()
9171 "Expand AUTORESET statements, as part of \\[verilog-auto]. 9025 "Expand AUTORESET statements, as part of \\[verilog-auto].
@@ -9260,8 +9114,7 @@ Typing \\[verilog-auto] will make this into:
9260 ";\n") 9114 ";\n")
9261 (indent-to indent-pt) 9115 (indent-to indent-pt)
9262 (setq sig-list (cdr sig-list)))) 9116 (setq sig-list (cdr sig-list))))
9263 (insert "// End of automatics")) 9117 (insert "// End of automatics")))))
9264 )))
9265 9118
9266(defun verilog-auto-tieoff () 9119(defun verilog-auto-tieoff ()
9267 "Expand AUTOTIEOFF statements, as part of \\[verilog-auto]. 9120 "Expand AUTOTIEOFF statements, as part of \\[verilog-auto].
@@ -9316,8 +9169,7 @@ Typing \\[verilog-auto] will make this into:
9316 (verilog-modi-get-consts modi) 9169 (verilog-modi-get-consts modi)
9317 (verilog-modi-get-gparams modi) 9170 (verilog-modi-get-gparams modi)
9318 (verilog-modi-get-sub-outputs modi) 9171 (verilog-modi-get-sub-outputs modi)
9319 (verilog-modi-get-sub-inouts modi) 9172 (verilog-modi-get-sub-inouts modi)))))
9320 ))))
9321 (when sig-list 9173 (when sig-list
9322 (forward-line 1) 9174 (forward-line 1)
9323 (verilog-insert-indent "// Beginning of automatic tieoffs (for this module's unterminated outputs)\n") 9175 (verilog-insert-indent "// Beginning of automatic tieoffs (for this module's unterminated outputs)\n")
@@ -9330,8 +9182,7 @@ Typing \\[verilog-auto] will make this into:
9330 (insert "= " (verilog-sig-tieoff sig) 9182 (insert "= " (verilog-sig-tieoff sig)
9331 ";\n") 9183 ";\n")
9332 (setq sig-list (cdr sig-list)))) 9184 (setq sig-list (cdr sig-list))))
9333 (verilog-insert-indent "// End of automatics\n") 9185 (verilog-insert-indent "// End of automatics\n")))))
9334 ))))
9335 9186
9336(defun verilog-auto-unused () 9187(defun verilog-auto-unused ()
9337 "Expand AUTOUNUSED statements, as part of \\[verilog-auto]. 9188 "Expand AUTOUNUSED statements, as part of \\[verilog-auto].
@@ -9395,8 +9246,7 @@ Typing \\[verilog-auto] will make this into:
9395 (append (verilog-modi-get-inputs modi) 9246 (append (verilog-modi-get-inputs modi)
9396 (verilog-modi-get-inouts modi)) 9247 (verilog-modi-get-inouts modi))
9397 (append (verilog-modi-get-sub-inputs modi) 9248 (append (verilog-modi-get-sub-inputs modi)
9398 (verilog-modi-get-sub-inouts modi) 9249 (verilog-modi-get-sub-inouts modi)))))
9399 ))))
9400 (setq sig-list (verilog-signals-not-matching-regexp 9250 (setq sig-list (verilog-signals-not-matching-regexp
9401 sig-list verilog-auto-unused-ignore-regexp)) 9251 sig-list verilog-auto-unused-ignore-regexp))
9402 (when sig-list 9252 (when sig-list
@@ -9408,8 +9258,7 @@ Typing \\[verilog-auto] will make this into:
9408 (indent-to indent-pt) 9258 (indent-to indent-pt)
9409 (insert (verilog-sig-name sig) ",\n") 9259 (insert (verilog-sig-name sig) ",\n")
9410 (setq sig-list (cdr sig-list)))) 9260 (setq sig-list (cdr sig-list))))
9411 (verilog-insert-indent "// End of automatics\n") 9261 (verilog-insert-indent "// End of automatics\n")))))
9412 ))))
9413 9262
9414(defun verilog-enum-ascii (signm elim-regexp) 9263(defun verilog-enum-ascii (signm elim-regexp)
9415 "Convert a enum name SIGNM to a ascii string for insertion. 9264 "Convert a enum name SIGNM to a ascii string for insertion.
@@ -9543,8 +9392,7 @@ Typing \\[verilog-auto] will make this into:
9543 (verilog-insert-indent "endcase\n") 9392 (verilog-insert-indent "endcase\n")
9544 (setq indent-pt (- indent-pt verilog-indent-level)) 9393 (setq indent-pt (- indent-pt verilog-indent-level))
9545 (verilog-insert-indent "end\n" 9394 (verilog-insert-indent "end\n"
9546 "// End of automatics\n") 9395 "// End of automatics\n"))))
9547 )))
9548 9396
9549(defun verilog-auto-templated-rel () 9397(defun verilog-auto-templated-rel ()
9550 "Replace Templated relative line numbers with absolute line numbers. 9398 "Replace Templated relative line numbers with absolute line numbers.
@@ -9694,8 +9542,7 @@ Wilson Snyder (wsnyder@wsnyder.org), and/or see http://www.veripool.com."
9694 ;; Must be after all inputs outputs are generated 9542 ;; Must be after all inputs outputs are generated
9695 (verilog-auto-search-do "/*AUTOARG*/" 'verilog-auto-arg) 9543 (verilog-auto-search-do "/*AUTOARG*/" 'verilog-auto-arg)
9696 ;; Fix line numbers (comments only) 9544 ;; Fix line numbers (comments only)
9697 (verilog-auto-templated-rel) 9545 (verilog-auto-templated-rel))
9698 )
9699 ;; 9546 ;;
9700 (run-hooks 'verilog-auto-hook) 9547 (run-hooks 'verilog-auto-hook)
9701 ;; 9548 ;;
@@ -9709,14 +9556,13 @@ Wilson Snyder (wsnyder@wsnyder.org), and/or see http://www.veripool.com."
9709 ;; Unwind forms 9556 ;; Unwind forms
9710 (progn 9557 (progn
9711 ;; Restore font-lock 9558 ;; Restore font-lock
9712 (when fontlocked (font-lock-mode t))) 9559 (when fontlocked (font-lock-mode t))))))
9713 )))
9714 9560
9715 9561
9716;; 9562;;
9717;; Skeleton based code insertion 9563;; Skeleton based code insertion
9718;; 9564;;
9719(defvar verilog-template-map 9565(defvar verilog-template-map
9720 (let ((map (make-sparse-keymap))) 9566 (let ((map (make-sparse-keymap)))
9721 (define-key map "a" 'verilog-sk-always) 9567 (define-key map "a" 'verilog-sk-always)
9722 (define-key map "b" 'verilog-sk-begin) 9568 (define-key map "b" 'verilog-sk-begin)
@@ -9985,16 +9831,14 @@ and the case items."
9985(defun verilog-sk-define-signal () 9831(defun verilog-sk-define-signal ()
9986 "Insert a definition of signal under point at top of module." 9832 "Insert a definition of signal under point at top of module."
9987 (interactive "*") 9833 (interactive "*")
9988 (let* ( 9834 (let* ((sig-re "[a-zA-Z0-9_]*")
9989 (sig-re "[a-zA-Z0-9_]*")
9990 (v1 (buffer-substring 9835 (v1 (buffer-substring
9991 (save-excursion 9836 (save-excursion
9992 (skip-chars-backward sig-re) 9837 (skip-chars-backward sig-re)
9993 (point)) 9838 (point))
9994 (save-excursion 9839 (save-excursion
9995 (skip-chars-forward sig-re) 9840 (skip-chars-forward sig-re)
9996 (point)))) 9841 (point)))))
9997 )
9998 (if (not (member v1 verilog-keywords)) 9842 (if (not (member v1 verilog-keywords))
9999 (save-excursion 9843 (save-excursion
10000 (setq verilog-sk-signal v1) 9844 (setq verilog-sk-signal v1)
@@ -10003,10 +9847,7 @@ and the case items."
10003 (verilog-forward-syntactic-ws) 9847 (verilog-forward-syntactic-ws)
10004 (verilog-sk-def-reg) 9848 (verilog-sk-def-reg)
10005 (message "signal at point is %s" v1)) 9849 (message "signal at point is %s" v1))
10006 (message "object at point (%s) is a keyword" v1)) 9850 (message "object at point (%s) is a keyword" v1))))
10007 )
10008 )
10009
10010 9851
10011(define-skeleton verilog-sk-wire 9852(define-skeleton verilog-sk-wire
10012 "Insert a wire definition." 9853 "Insert a wire definition."
@@ -10109,7 +9950,7 @@ and the case items."
10109 "^`include\\s-+\"\\([^\n\"]*\\)\"" 9950 "^`include\\s-+\"\\([^\n\"]*\\)\""
10110 "Regexp that matches the include file.") 9951 "Regexp that matches the include file.")
10111 9952
10112(defvar verilog-mode-mouse-map 9953(defvar verilog-mode-mouse-map
10113 (let ((map (make-sparse-keymap))) ; as described in info pages, make a map 9954 (let ((map (make-sparse-keymap))) ; as described in info pages, make a map
10114 (set-keymap-parent map verilog-mode-map) 9955 (set-keymap-parent map verilog-mode-map)
10115 ;; mouse button bindings 9956 ;; mouse button bindings
@@ -10189,8 +10030,7 @@ Files are checked based on `verilog-library-directories'."
10189 (progn 10030 (progn
10190 (message 10031 (message
10191 "File '%s' isn't readable, use shift-mouse2 to paste in this field" 10032 "File '%s' isn't readable, use shift-mouse2 to paste in this field"
10192 (match-string 1)))) 10033 (match-string 1)))))))
10193 )))
10194 10034
10195;; ffap isn't useable for verilog mode. It uses library paths. 10035;; ffap isn't useable for verilog mode. It uses library paths.
10196;; so define this function to do more or less the same as ffap 10036;; so define this function to do more or less the same as ffap
@@ -10208,8 +10048,7 @@ Files are checked based on `verilog-library-directories'."
10208 (file-readable-p (car (verilog-library-filenames 10048 (file-readable-p (car (verilog-library-filenames
10209 (match-string 1) (buffer-file-name))))) 10049 (match-string 1) (buffer-file-name)))))
10210 (find-file (car (verilog-library-filenames 10050 (find-file (car (verilog-library-filenames
10211 (match-string 1) (buffer-file-name)))))) 10051 (match-string 1) (buffer-file-name))))))))
10212 ))
10213 10052
10214 10053
10215;; 10054;;
@@ -10230,6 +10069,7 @@ Files are checked based on `verilog-library-directories'."
10230 (princ "\n"))) 10069 (princ "\n")))
10231 10070
10232(autoload 'reporter-submit-bug-report "reporter") 10071(autoload 'reporter-submit-bug-report "reporter")
10072(defvar reporter-prompt-for-summary-p)
10233 10073
10234(defun verilog-submit-bug-report () 10074(defun verilog-submit-bug-report ()
10235 "Submit via mail a bug report on verilog-mode.el." 10075 "Submit via mail a bug report on verilog-mode.el."