diff options
| author | Wilson Snyder | 2014-10-06 20:19:10 -0700 |
|---|---|---|
| committer | Glenn Morris | 2014-10-06 20:19:10 -0700 |
| commit | dd7023e4f7b9b7d8cec14829ca371a9fd424b939 (patch) | |
| tree | c10b4bf078d6684560c885d5648c2a814e13e7fa | |
| parent | 83f046769b634f215e1ca946cf45a705c955c79f (diff) | |
| download | emacs-dd7023e4f7b9b7d8cec14829ca371a9fd424b939.tar.gz emacs-dd7023e4f7b9b7d8cec14829ca371a9fd424b939.zip | |
Sync with upstream verilog-mode revision c075a492
* lisp/progmodes/verilog-mode.el (verilog-mode-version): Bump.
(verilog-menu): Add AUTOINSERTLAST.
(verilog-no-indent-begin-re): When `verilog-indent-begin-after-if'
is nil, fix indenting initial/final to match always statements, bug825.
Reported by Tim Clapp.
(verilog-extended-complete-re): Fix indentation of DPI-C imports,
bug557. Reported by ZeDong Mao and Jason Forkey.
(verilog-read-decls): Fix parsing typed interfaces.
Fix AUTOINOUTMODPORT missing types. Reported by Stephan Bourduas.
(verilog-auto-arg-ports): Fix verilog-auto-arg-format single.
(verilog-auto-output-every): Add regexp to AUTOOUTPUTEVERY, bug793.
Reported by Pierre-David Pfister.
(verilog-auto-insert-lisp): Doc fix.
(verilog-auto-insert-last, verilog-auto): Add AUTOINSERTLAST to
allow post-AUTO user fixups, bug826. Reported by Dennis Muhlestein.
(verilog-sk-ovm-class, verilog-sk-uvm-object)
(verilog-sk-uvm-component): Fix missing string keyword in class
skeletons, bug824. Reported by eldad faruhi.
| -rw-r--r-- | lisp/ChangeLog | 22 | ||||
| -rw-r--r-- | lisp/progmodes/verilog-mode.el | 68 |
2 files changed, 76 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8c3a239e662..88096b3e78c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,25 @@ | |||
| 1 | 2014-10-07 Wilson Snyder <wsnyder@wsnyder.org> | ||
| 2 | |||
| 3 | Sync with upstream verilog-mode revision c075a492. | ||
| 4 | * progmodes/verilog-mode.el (verilog-mode-version): Bump. | ||
| 5 | (verilog-menu): Add AUTOINSERTLAST. | ||
| 6 | (verilog-no-indent-begin-re): When `verilog-indent-begin-after-if' | ||
| 7 | is nil, fix indenting initial/final to match always statements, bug825. | ||
| 8 | Reported by Tim Clapp. | ||
| 9 | (verilog-extended-complete-re): Fix indentation of DPI-C imports, | ||
| 10 | bug557. Reported by ZeDong Mao and Jason Forkey. | ||
| 11 | (verilog-read-decls): Fix parsing typed interfaces. | ||
| 12 | Fix AUTOINOUTMODPORT missing types. Reported by Stephan Bourduas. | ||
| 13 | (verilog-auto-arg-ports): Fix verilog-auto-arg-format single. | ||
| 14 | (verilog-auto-output-every): Add regexp to AUTOOUTPUTEVERY, bug793. | ||
| 15 | Reported by Pierre-David Pfister. | ||
| 16 | (verilog-auto-insert-lisp): Doc fix. | ||
| 17 | (verilog-auto-insert-last, verilog-auto): Add AUTOINSERTLAST to | ||
| 18 | allow post-AUTO user fixups, bug826. Reported by Dennis Muhlestein. | ||
| 19 | (verilog-sk-ovm-class, verilog-sk-uvm-object) | ||
| 20 | (verilog-sk-uvm-component): Fix missing string keyword in class | ||
| 21 | skeletons, bug824. Reported by eldad faruhi. | ||
| 22 | |||
| 1 | 2014-10-06 Stefan Monnier <monnier@iro.umontreal.ca> | 23 | 2014-10-06 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 24 | ||
| 3 | * term/w32-win.el: Move all code from 32-common-fns.el here. | 25 | * term/w32-win.el: Move all code from 32-common-fns.el here. |
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index e9faa81fd82..71af582578d 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el | |||
| @@ -123,7 +123,7 @@ | |||
| 123 | ;;; Code: | 123 | ;;; Code: |
| 124 | 124 | ||
| 125 | ;; This variable will always hold the version number of the mode | 125 | ;; This variable will always hold the version number of the mode |
| 126 | (defconst verilog-mode-version "2014-05-31-3cd8144-vpo" | 126 | (defconst verilog-mode-version "2014-10-03-c075a49-vpo" |
| 127 | "Version of this Verilog mode.") | 127 | "Version of this Verilog mode.") |
| 128 | (defconst verilog-mode-release-emacs t | 128 | (defconst verilog-mode-release-emacs t |
| 129 | "If non-nil, this version of Verilog mode was released with Emacs itself.") | 129 | "If non-nil, this version of Verilog mode was released with Emacs itself.") |
| @@ -1474,6 +1474,8 @@ If set will become buffer local.") | |||
| 1474 | :help "Help on AUTOINPUT - adding inputs from cells"] | 1474 | :help "Help on AUTOINPUT - adding inputs from cells"] |
| 1475 | ["AUTOINSERTLISP" (describe-function 'verilog-auto-insert-lisp) | 1475 | ["AUTOINSERTLISP" (describe-function 'verilog-auto-insert-lisp) |
| 1476 | :help "Help on AUTOINSERTLISP - insert text from a lisp function"] | 1476 | :help "Help on AUTOINSERTLISP - insert text from a lisp function"] |
| 1477 | ["AUTOINSERTLAST" (describe-function 'verilog-auto-insert-last) | ||
| 1478 | :help "Help on AUTOINSERTLISPLAST - insert text from a lisp function"] | ||
| 1477 | ["AUTOINST" (describe-function 'verilog-auto-inst) | 1479 | ["AUTOINST" (describe-function 'verilog-auto-inst) |
| 1478 | :help "Help on AUTOINST - adding pins for cells"] | 1480 | :help "Help on AUTOINST - adding pins for cells"] |
| 1479 | ["AUTOINST (.*)" (describe-function 'verilog-auto-star) | 1481 | ["AUTOINST (.*)" (describe-function 'verilog-auto-star) |
| @@ -2265,7 +2267,10 @@ find the errors." | |||
| 2265 | ;; "\\(assert\\|assume\\|cover\\)\\s-+property\\>" | 2267 | ;; "\\(assert\\|assume\\|cover\\)\\s-+property\\>" |
| 2266 | 2268 | ||
| 2267 | (defconst verilog-no-indent-begin-re | 2269 | (defconst verilog-no-indent-begin-re |
| 2268 | "\\<\\(if\\|else\\|while\\|for\\|repeat\\|always\\|always_comb\\|always_ff\\|always_latch\\)\\>") | 2270 | (eval-when-compile |
| 2271 | (verilog-regexp-words | ||
| 2272 | '( "if" "else" "while" "for" "repeat" "always" "always_comb" "always_ff" "always_latch" | ||
| 2273 | "initial" "final")))) | ||
| 2269 | 2274 | ||
| 2270 | (defconst verilog-ends-re | 2275 | (defconst verilog-ends-re |
| 2271 | ;; Parenthesis indicate type of keyword found | 2276 | ;; Parenthesis indicate type of keyword found |
| @@ -2719,9 +2724,9 @@ find the errors." | |||
| 2719 | (defconst verilog-disable-fork-re "\\(disable\\|wait\\)\\s-+fork\\>") | 2724 | (defconst verilog-disable-fork-re "\\(disable\\|wait\\)\\s-+fork\\>") |
| 2720 | (defconst verilog-extended-case-re "\\(\\(unique0?\\s-+\\|priority\\s-+\\)?case[xz]?\\)") | 2725 | (defconst verilog-extended-case-re "\\(\\(unique0?\\s-+\\|priority\\s-+\\)?case[xz]?\\)") |
| 2721 | (defconst verilog-extended-complete-re | 2726 | (defconst verilog-extended-complete-re |
| 2722 | (concat "\\(\\(\\<extern\\s-+\\|\\<\\(\\<pure\\>\\s-+\\)?virtual\\s-+\\|\\<protected\\s-+\\)*\\(\\<function\\>\\|\\<task\\>\\)\\)" | 2727 | (concat "\\(\\(\\<extern\\s-+\\|\\<\\(\\<\\(pure\\|context\\)\\>\\s-+\\)?virtual\\s-+\\|\\<protected\\s-+\\)*\\(\\<function\\>\\|\\<task\\>\\)\\)" |
| 2723 | "\\|\\(\\(\\<typedef\\>\\s-+\\)*\\(\\<struct\\>\\|\\<union\\>\\|\\<class\\>\\)\\)" | 2728 | "\\|\\(\\(\\<typedef\\>\\s-+\\)*\\(\\<struct\\>\\|\\<union\\>\\|\\<class\\>\\)\\)" |
| 2724 | "\\|\\(\\(\\<import\\>\\s-+\\)?\\(\"DPI-C\"\\s-+\\)?\\(\\<pure\\>\\s-+\\)?\\(function\\>\\|task\\>\\)\\)" | 2729 | "\\|\\(\\(\\<import\\>\\s-+\\)?\\(\"DPI-C\"\\s-+\\)?\\(\\<\\(pure\\|context\\)\\>\\s-+\\)?\\([A-Za-z_][A-Za-z0-9_]*\\s-+=\\s-+\\)?\\(function\\>\\|task\\>\\)\\)" |
| 2725 | "\\|" verilog-extended-case-re )) | 2730 | "\\|" verilog-extended-case-re )) |
| 2726 | (defconst verilog-basic-complete-re | 2731 | (defconst verilog-basic-complete-re |
| 2727 | (eval-when-compile | 2732 | (eval-when-compile |
| @@ -8258,7 +8263,8 @@ Return an array of [outputs inouts inputs wire reg assign const]." | |||
| 8258 | (setq typedefed | 8263 | (setq typedefed |
| 8259 | (if typedefed (concat typedefed " " keywd) keywd))) | 8264 | (if typedefed (concat typedefed " " keywd) keywd))) |
| 8260 | (t (setq vec nil enum nil rvalue nil signed nil | 8265 | (t (setq vec nil enum nil rvalue nil signed nil |
| 8261 | typedefed nil multidim nil sig-paren paren | 8266 | typedefed keywd ; Have a type |
| 8267 | multidim nil sig-paren paren | ||
| 8262 | expect-signal 'sigs-var modport nil)))) | 8268 | expect-signal 'sigs-var modport nil)))) |
| 8263 | ;; Interface with optional modport in v2k arglist? | 8269 | ;; Interface with optional modport in v2k arglist? |
| 8264 | ;; Skip over parsing modport, and take the interface name as the type | 8270 | ;; Skip over parsing modport, and take the interface name as the type |
| @@ -10650,6 +10656,7 @@ Takes SIGS list, adds MESSAGE to front and inserts each at INDENT-PT." | |||
| 10650 | (indent-to indent-pt) | 10656 | (indent-to indent-pt) |
| 10651 | (while sigs | 10657 | (while sigs |
| 10652 | (cond ((equal verilog-auto-arg-format 'single) | 10658 | (cond ((equal verilog-auto-arg-format 'single) |
| 10659 | (insert space) | ||
| 10653 | (indent-to indent-pt) | 10660 | (indent-to indent-pt) |
| 10654 | (setq space "\n")) | 10661 | (setq space "\n")) |
| 10655 | ;; verilog-auto-arg-format 'packed | 10662 | ;; verilog-auto-arg-format 'packed |
| @@ -11816,10 +11823,18 @@ Typing \\[verilog-auto] will make this into: | |||
| 11816 | wire tempa = i; | 11823 | wire tempa = i; |
| 11817 | wire tempb = tempa; | 11824 | wire tempb = tempa; |
| 11818 | wire o = tempb; | 11825 | wire o = tempb; |
| 11819 | endmodule" | 11826 | endmodule |
| 11827 | |||
| 11828 | You may also provide an optional regular expression, in which case only | ||
| 11829 | signals matching the regular expression will be included. For example the | ||
| 11830 | same expansion will result from only extracting outputs starting with ov: | ||
| 11831 | |||
| 11832 | /*AUTOOUTPUTEVERY(\"^ov\")*/" | ||
| 11820 | (save-excursion | 11833 | (save-excursion |
| 11821 | ;;Point must be at insertion point | 11834 | ;;Point must be at insertion point |
| 11822 | (let* ((indent-pt (current-indentation)) | 11835 | (let* ((indent-pt (current-indentation)) |
| 11836 | (params (verilog-read-auto-params 0 1)) | ||
| 11837 | (regexp (nth 0 params)) | ||
| 11823 | (v2k (verilog-in-paren-quick)) | 11838 | (v2k (verilog-in-paren-quick)) |
| 11824 | (modi (verilog-modi-current)) | 11839 | (modi (verilog-modi-current)) |
| 11825 | (moddecls (verilog-modi-get-decls modi)) | 11840 | (moddecls (verilog-modi-get-decls modi)) |
| @@ -11827,6 +11842,11 @@ Typing \\[verilog-auto] will make this into: | |||
| 11827 | (verilog-signals-not-in | 11842 | (verilog-signals-not-in |
| 11828 | (verilog-decls-get-signals moddecls) | 11843 | (verilog-decls-get-signals moddecls) |
| 11829 | (verilog-decls-get-ports moddecls))))) | 11844 | (verilog-decls-get-ports moddecls))))) |
| 11845 | (when regexp | ||
| 11846 | (setq sig-list (verilog-signals-matching-regexp | ||
| 11847 | sig-list regexp))) | ||
| 11848 | (setq sig-list (verilog-signals-not-matching-regexp | ||
| 11849 | sig-list verilog-auto-output-ignore-regexp)) | ||
| 11830 | (verilog-forward-or-insert-line) | 11850 | (verilog-forward-or-insert-line) |
| 11831 | (when v2k (verilog-repair-open-comma)) | 11851 | (when v2k (verilog-repair-open-comma)) |
| 11832 | (when sig-list | 11852 | (when sig-list |
| @@ -12417,9 +12437,13 @@ driver/monitor using AUTOINST in the testbench." | |||
| 12417 | 12437 | ||
| 12418 | (defun verilog-auto-insert-lisp () | 12438 | (defun verilog-auto-insert-lisp () |
| 12419 | "Expand AUTOINSERTLISP statements, as part of \\[verilog-auto]. | 12439 | "Expand AUTOINSERTLISP statements, as part of \\[verilog-auto]. |
| 12420 | The Lisp code provided is called, and the Lisp code calls | 12440 | The Lisp code provided is called before other AUTOS are expanded, |
| 12421 | `insert` to insert text into the current file beginning on the | 12441 | and the Lisp code generally will call `insert` to insert text |
| 12422 | line after the AUTOINSERTLISP. | 12442 | into the current file beginning on the line after the |
| 12443 | AUTOINSERTLISP. | ||
| 12444 | |||
| 12445 | See also AUTOINSERTLAST and `verilog-auto-insert-last' which | ||
| 12446 | executes after (as opposed to before) other AUTOs. | ||
| 12423 | 12447 | ||
| 12424 | See also AUTO_LISP, which takes a Lisp expression and evaluates | 12448 | See also AUTO_LISP, which takes a Lisp expression and evaluates |
| 12425 | it during `verilog-auto-inst' but does not insert any text. | 12449 | it during `verilog-auto-inst' but does not insert any text. |
| @@ -12476,6 +12500,20 @@ text: | |||
| 12476 | (setq verilog-scan-cache-tick nil) ;; Clear cache; inserted unknown text | 12500 | (setq verilog-scan-cache-tick nil) ;; Clear cache; inserted unknown text |
| 12477 | (verilog-delete-empty-auto-pair)))) | 12501 | (verilog-delete-empty-auto-pair)))) |
| 12478 | 12502 | ||
| 12503 | (defun verilog-auto-insert-last () | ||
| 12504 | "Expand AUTOINSERTLAST statements, as part of \\[verilog-auto]. | ||
| 12505 | The Lisp code provided is called after all other AUTOS have been | ||
| 12506 | expanded, and the Lisp code generally will call `insert` to | ||
| 12507 | insert text into the current file beginning on the line after the | ||
| 12508 | AUTOINSERTLAST. | ||
| 12509 | |||
| 12510 | Other than when called (after AUTOs are expanded), the functionality | ||
| 12511 | is otherwise identical to AUTOINSERTLISP and `verilog-auto-insert-lisp' which | ||
| 12512 | executes before (as opposed to after) other AUTOs. | ||
| 12513 | |||
| 12514 | See `verilog-auto-insert-lisp' for examples." | ||
| 12515 | (verilog-auto-insert-lisp)) | ||
| 12516 | |||
| 12479 | (defun verilog-auto-sense-sigs (moddecls presense-sigs) | 12517 | (defun verilog-auto-sense-sigs (moddecls presense-sigs) |
| 12480 | "Return list of signals for current AUTOSENSE block." | 12518 | "Return list of signals for current AUTOSENSE block." |
| 12481 | (let* ((sigss (verilog-read-always-signals)) | 12519 | (let* ((sigss (verilog-read-always-signals)) |
| @@ -13202,6 +13240,7 @@ Using \\[describe-function], see also: | |||
| 13202 | `verilog-auto-inout-param' for AUTOINOUTPARAM copying params from elsewhere | 13240 | `verilog-auto-inout-param' for AUTOINOUTPARAM copying params from elsewhere |
| 13203 | `verilog-auto-input' for AUTOINPUT making hierarchy inputs | 13241 | `verilog-auto-input' for AUTOINPUT making hierarchy inputs |
| 13204 | `verilog-auto-insert-lisp' for AUTOINSERTLISP insert code from lisp function | 13242 | `verilog-auto-insert-lisp' for AUTOINSERTLISP insert code from lisp function |
| 13243 | `verilog-auto-insert-last' for AUTOINSERTLAST insert code from lisp function | ||
| 13205 | `verilog-auto-inst' for AUTOINST instantiation pins | 13244 | `verilog-auto-inst' for AUTOINST instantiation pins |
| 13206 | `verilog-auto-star' for AUTOINST .* SystemVerilog pins | 13245 | `verilog-auto-star' for AUTOINST .* SystemVerilog pins |
| 13207 | `verilog-auto-inst-param' for AUTOINSTPARAM instantiation params | 13246 | `verilog-auto-inst-param' for AUTOINSTPARAM instantiation params |
| @@ -13278,7 +13317,6 @@ Wilson Snyder (wsnyder@wsnyder.org)." | |||
| 13278 | (verilog-inject-arg)) | 13317 | (verilog-inject-arg)) |
| 13279 | ;; | 13318 | ;; |
| 13280 | ;; Do user inserts first, so their code can insert AUTOs | 13319 | ;; Do user inserts first, so their code can insert AUTOs |
| 13281 | ;; We may provide an AUTOINSERTLISPLAST if another cleanup pass is needed | ||
| 13282 | (verilog-auto-re-search-do "/\\*AUTOINSERTLISP(.*?)\\*/" | 13320 | (verilog-auto-re-search-do "/\\*AUTOINSERTLISP(.*?)\\*/" |
| 13283 | 'verilog-auto-insert-lisp) | 13321 | 'verilog-auto-insert-lisp) |
| 13284 | ;; Expand instances before need the signals the instances input/output | 13322 | ;; Expand instances before need the signals the instances input/output |
| @@ -13312,11 +13350,13 @@ Wilson Snyder (wsnyder@wsnyder.org)." | |||
| 13312 | (verilog-auto-re-search-do "/\\*AUTOREG\\*/" 'verilog-auto-reg) | 13350 | (verilog-auto-re-search-do "/\\*AUTOREG\\*/" 'verilog-auto-reg) |
| 13313 | (verilog-auto-re-search-do "/\\*AUTOREGINPUT\\*/" 'verilog-auto-reg-input) | 13351 | (verilog-auto-re-search-do "/\\*AUTOREGINPUT\\*/" 'verilog-auto-reg-input) |
| 13314 | ;; outputevery needs AUTOOUTPUTs done first | 13352 | ;; outputevery needs AUTOOUTPUTs done first |
| 13315 | (verilog-auto-re-search-do "/\\*AUTOOUTPUTEVERY\\*/" 'verilog-auto-output-every) | 13353 | (verilog-auto-re-search-do "/\\*AUTOOUTPUTEVERY\\((.*?)\\)?\\*/" 'verilog-auto-output-every) |
| 13316 | ;; After we've created all new variables | 13354 | ;; After we've created all new variables |
| 13317 | (verilog-auto-re-search-do "/\\*AUTOUNUSED\\*/" 'verilog-auto-unused) | 13355 | (verilog-auto-re-search-do "/\\*AUTOUNUSED\\*/" 'verilog-auto-unused) |
| 13318 | ;; Must be after all inputs outputs are generated | 13356 | ;; Must be after all inputs outputs are generated |
| 13319 | (verilog-auto-re-search-do "/\\*AUTOARG\\*/" 'verilog-auto-arg) | 13357 | (verilog-auto-re-search-do "/\\*AUTOARG\\*/" 'verilog-auto-arg) |
| 13358 | ;; User inserts | ||
| 13359 | (verilog-auto-re-search-do "/\\*AUTOINSERTLAST(.*?)\\*/" 'verilog-auto-insert-last) | ||
| 13320 | ;; Fix line numbers (comments only) | 13360 | ;; Fix line numbers (comments only) |
| 13321 | (when verilog-auto-inst-template-numbers | 13361 | (when verilog-auto-inst-template-numbers |
| 13322 | (verilog-auto-templated-rel)) | 13362 | (verilog-auto-templated-rel)) |
| @@ -13485,7 +13525,7 @@ See also `verilog-header' for an alternative format." | |||
| 13485 | > "`ovm_object_utils_begin(" name ")" \n | 13525 | > "`ovm_object_utils_begin(" name ")" \n |
| 13486 | > (- verilog-indent-level) " `ovm_object_utils_end" \n | 13526 | > (- verilog-indent-level) " `ovm_object_utils_end" \n |
| 13487 | > _ \n | 13527 | > _ \n |
| 13488 | > "function new(name=\"" name "\");" \n | 13528 | > "function new(string name=\"" name "\");" \n |
| 13489 | > "super.new(name);" \n | 13529 | > "super.new(name);" \n |
| 13490 | > (- verilog-indent-level) "endfunction" \n | 13530 | > (- verilog-indent-level) "endfunction" \n |
| 13491 | > _ \n | 13531 | > _ \n |
| @@ -13499,7 +13539,7 @@ See also `verilog-header' for an alternative format." | |||
| 13499 | > "`uvm_object_utils_begin(" name ")" \n | 13539 | > "`uvm_object_utils_begin(" name ")" \n |
| 13500 | > (- verilog-indent-level) "`uvm_object_utils_end" \n | 13540 | > (- verilog-indent-level) "`uvm_object_utils_end" \n |
| 13501 | > _ \n | 13541 | > _ \n |
| 13502 | > "function new(name=\"" name "\");" \n | 13542 | > "function new(string name=\"" name "\");" \n |
| 13503 | > "super.new(name);" \n | 13543 | > "super.new(name);" \n |
| 13504 | > (- verilog-indent-level) "endfunction" \n | 13544 | > (- verilog-indent-level) "endfunction" \n |
| 13505 | > _ \n | 13545 | > _ \n |
| @@ -13513,7 +13553,7 @@ See also `verilog-header' for an alternative format." | |||
| 13513 | > "`uvm_component_utils_begin(" name ")" \n | 13553 | > "`uvm_component_utils_begin(" name ")" \n |
| 13514 | > (- verilog-indent-level) "`uvm_component_utils_end" \n | 13554 | > (- verilog-indent-level) "`uvm_component_utils_end" \n |
| 13515 | > _ \n | 13555 | > _ \n |
| 13516 | > "function new(name=\"\", uvm_component parent);" \n | 13556 | > "function new(string name=\"\", uvm_component parent);" \n |
| 13517 | > "super.new(name, parent);" \n | 13557 | > "super.new(name, parent);" \n |
| 13518 | > (- verilog-indent-level) "endfunction" \n | 13558 | > (- verilog-indent-level) "endfunction" \n |
| 13519 | > _ \n | 13559 | > _ \n |