;;
;; This variable will always hold the version number of the mode
-(defconst verilog-mode-version "2019-03-05-39b4dac-vpo-GNU"
+(defconst verilog-mode-version "2019-04-02-5d62d3f-vpo-GNU"
"Version of this Verilog mode.")
(defconst verilog-mode-release-emacs t
"If non-nil, this version of Verilog mode was released with Emacs itself.")
:type '(choice (const nil) regexp))
(put 'verilog-auto-input-ignore-regexp 'safe-local-variable 'stringp)
+(defcustom verilog-auto-reg-input-assigned-ignore-regexp nil
+ "If non-nil, when creating AUTOINPUTREG, ignore signals matching this regexp."
+ :version "27.1"
+ :group 'verilog-mode-auto
+ :type '(choice (const nil) regexp))
+(put 'verilog-auto-reg-input-assigned-ignore-regexp 'safe-local-variable 'stringp)
+
(defcustom verilog-auto-inout-ignore-regexp nil
"If non-nil, when creating AUTOINOUT, ignore signals matching this regexp.
See the \\[verilog-faq] for examples on using this."
) nil ) ) )
(defconst verilog-vmm-statement-re
- (eval-when-compile
- (verilog-regexp-opt
- '(
- "`vmm_\\(data\\|env\\|scenario\\|subenv\\|xactor\\)_member_\\(scalar\\|string\\|enum\\|vmm_data\\|channel\\|xactor\\|subenv\\|user_defined\\)\\(_array\\)?"
- ;; "`vmm_xactor_member_enum_array"
- ;; "`vmm_xactor_member_scalar_array"
- ;; "`vmm_xactor_member_scalar"
- ) nil )))
+ "`vmm_\\(data\\|env\\|scenario\\|subenv\\|xactor\\)_member_\\(scalar\\|string\\|enum\\|vmm_data\\|channel\\|xactor\\|subenv\\|user_defined\\)\\(_array\\)?")
(defconst verilog-ovm-statement-re
(eval-when-compile
;; `timescale time_unit / time_precision
"\\<\\(`timescale\\)\\>\\s-+10\\{0,2\\}\\s-*[munpf]?s\\s-*/\\s-*10\\{0,2\\}\\s-*[munpf]?s"
"\\)\\|\\(?:"
- ;; `define and `if can span multiple lines if line ends in '\'. NOTE: `if is not IEEE 1800-2012
+ ;; `define and `if can span multiple lines if line ends in '\'.
+ ;; NOTE: `if is not IEEE 1800-2012.
;; from http://www.emacswiki.org/emacs/MultilineRegexp
(concat "\\<\\(`define\\|`if\\)\\>" ; directive
"\\s-+" ; separator
(defun verilog-auto-reg-input ()
"Expand AUTOREGINPUT statements, as part of \\[verilog-auto].
-Make reg statements instantiation inputs that aren't already declared.
-This is useful for making a top level shell for testing the module that is
-to be instantiated.
+Make reg statements instantiation inputs that aren't already
+declared or assigned to. This is useful for making a top level
+shell for testing the module that is to be instantiated.
Limitations:
This ONLY detects inputs of AUTOINSTants (see `verilog-read-sub-decls').
This does NOT work on memories, declare those yourself.
+ Assignments cause the assigned-to variable not to be declared unless
+ the name matches `verilog-auto-reg-input-assigned-ignore-regexp'.
+
An example (see `verilog-auto-inst' for what else is going on here):
module ExampRegInput (o,i);
(append (verilog-subdecls-get-inputs modsubdecls)
(verilog-subdecls-get-inouts modsubdecls))
(append (verilog-decls-get-signals moddecls)
- (verilog-decls-get-assigns moddecls))))))
+ (verilog-signals-not-matching-regexp
+ (verilog-decls-get-assigns moddecls)
+ verilog-auto-reg-input-assigned-ignore-regexp))))))
(when sig-list
(verilog-forward-or-insert-line)
(verilog-insert-indent "// Beginning of automatic reg inputs (for undeclared instantiated-module inputs)\n")